--- /dev/null
+#!/bin/bash
+#
+# Scripts to run by MySQL systemd service
+#
+# Needed argument: pre | post
+#
+# pre mode : try to perform sanity check for configuration, log, data
+# post mode : ping server until answer is received
+
+sanity () {
+ if [ ! -r /etc/mysql/my.cnf ]; then
+ echo "MySQL configuration not found at /etc/mysql/my.cnf. Please create one."
+ exit 1
+ fi
+
+ if [ ! -d /var/lib/mysql ] && [ ! -L /var/lib/mysql ]; then
+ echo "MySQL data dir not found at /var/lib/mysql. Please create one."
+ exit 1
+ fi
+
+ if [ ! -d /var/lib/mysql/mysql ] && [ ! -L /var/lib/mysql/mysql ]; then
+ echo "MySQL system database not found. Please run mysql_install_db tool."
+ 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
+ if [ ! $server_up ]; then
+ echo "MySQL server not started"
+ exit 1
+ fi
+}
+
+case $1 in
+ "pre") sanity ;;
+ "post") pinger ;;
+esac
-mysql-wsrep-5.6 (5.6.30-0~u14.04+mos2) mos; urgency=high
+mysql-wsrep-5.6 (5.6.35-0~u14.04+mos1) mos; urgency=low
- * SECURITY UPDATE: Fix CVE-2016-6662
- - https://security-tracker.debian.org/tracker/CVE-2016-6662
+ * New release from codership merged with
+ https://github.com/codership/mysql-wsrep/pull/264
- -- Anton Chevychalov <mos-maintanance@mirantis.com> Thu, 22 Sep 2016 17:01:53 +0300
+ -- Ivan Suzdal <mos-linux@mirantis.com> Thu, 26 Jan 2017 12:42:43 +0000
-mysql-wsrep-5.6 (5.6.30-0~u14.04+mos1) mos; urgency=high
+mysql-wsrep-5.6 (5.6.34-0~u14.04+mos3) mos; urgency=low
- * SECURITY UPDATE: Update to 5.6.30 to fix security issues (LP: #1572559)
- * Closes: #1578370
- - http://www.oracle.com/technetwork/security-advisory/cpuapr2016v3-2985753.html
- - http://www.ubuntu.com/usn/usn-2953-1
- - CVE-2016-0639
- - CVE-2016-0640
- - CVE-2016-0641
- - CVE-2016-0642
- - CVE-2016-0643
- - CVE-2016-0644
- - CVE-2016-0646
- - CVE-2016-0647
- - CVE-2016-0648
- - CVE-2016-0649
- - CVE-2016-0650
- - CVE-2016-0655
- - CVE-2016-0661
- - CVE-2016-0665
- - CVE-2016-0666
- - CVE-2016-0668
- - CVE-2016-2047
+ * Add replace for mysql-server-wsrep-core-5.6 package
- Sourced from https://github.com/codership/mysql-wsrep/tree/wsrep_5.6.30-25.15
+ -- Ivan Suzdal <mos-linux@mirantis.com> Thu, 01 Dec 2016 13:06:18 +0000
- -- Ivan Suzdal <mos-linux-team@mirantis.com> Thu, 09 Jun 2016 15:21:53 +0000
+mysql-wsrep-5.6 (5.6.34-0~u14.04+mos2) mos; urgency=low
-mysql-wsrep-5.6 (5.6.23-1~u14.04+mos3) mos9.0; urgency=medium
+ * Add mysql-testsuite-5.6 metapackage
- * Reverting temporary fix for LP Bug 1541338 as it's not RC
+ -- Ivan Suzdal <mos-linux@mirantis.com> Tue, 29 Nov 2016 15:37:54 +0000
- -- Sergii Golovatiuk <sgolovatiuk@mirantis.com> Sat, 26 Mar 2016 13:19:00 +0100
+mysql-wsrep-5.6 (5.6.34-0~u14.04+mos1) mos; urgency=low
-mysql-wsrep-5.6 (5.6.23-1~u14.04+mos2) mos9.0; urgency=medium
+ * Newest version with merged pull request
+ https://github.com/codership/mysql-wsrep/pull/264
+ * Change replases for mysql-wsrep-common-5.6
- * Temporary fix for LP Bug 1541338
+ -- Ivan Suzdal <mos-linux@mirantis.com> Wed, 23 Nov 2016 12:48:39 +0000
- -- Dmitry Bilunov <dbilunov@mirantis.com> Wed, 23 Mar 2016 13:54:00 +0300
+mysql-wsrep-5.6 (5.6.34-25.18) UNRELEASED; urgency=low
-mysql-wsrep-5.6 (5.6.23-1~u14.04+mos1) mos7.0; urgency=medium
-
- * Update to MySQL 5.6.23:
- - remove d/p/CVE-2014-0001.patch as it was merged.
- * Update to wsrep 25.10 (Closes: #1438516):
- - fix misuse of thread-safe functions in innodb-wsrep,
- - patch obtained by diffing mysql-5.6.23 against mysql-wsrep-5.6.23-25.10
- and resolving conflicts.
-
- -- Pavel Boldin <pboldin@mirantis.com> Sun, 12 Apr 2015 17:40:48 +0300
-
-mysql-wsrep-5.6 (5.6.16-2~u14.04+mos2) mos6.1; urgency=low
-
- * Fix version according to Fuel versioning policy:
- https://github.com/stackforge/fuel-specs/blob/master/specs/6.1/separate-mos-from-linux.rst
- * No actual changes in source package
- * Partial-Bug: #1454382
-
- -- Ivan Udovichenko <iudovichenko@mirantis.com> Tue, 12 May 2015 23:17:22 +0300
-
-mysql-wsrep-5.6 (5.6.16-2~u14.04+mos1) trusty; urgency=low
-
- * The package is maintained by MOS Linux team, update the info accordingly.
- * Adjust the package revision according to the blueprint separate-mos-from-linux
- (https://review.openstack.org/148279)
-
- -- Alexei Sheplyakov <asheplyakov@mirantis.com> Fri, 13 Mar 2015 12:18:26 +0300
-
-mysql-wsrep-5.6 (5.6.16-2~mos6.1+1) trusty; urgency=low
-
- * Enable only the simplest tests (as test-mtr fails for unknown reasons)
- * Adjust the version for Ubuntu 14.04 rebuild
-
- -- Alexei Sheplyakov <asheplyakov@mirantis.com> Thu, 29 Jan 2015 15:52:10 +0300
-
-mysql-wsrep-5.6 (5.6.16-2) precise; urgency=low
-
- * Add Set nice for wsrep_sst_mysqldump
-
- -- sgolovatiuk <sgolovatiuk@mirantis.com> Thu, 31 Jul 2014 17:24:00 +0000
-
-mysql-wsrep-5.6 (5.6.16-1) precise; urgency=low
-
- * Add wsrep patch
-
- -- dburmistrov <dburmistrov@mirantis.com> Fri, 27 Jun 2014 16:00:06 +0400
-
-mysql-5.6 (5.6.16-1~exp1) experimental; urgency=medium
-
- * New upstream point release:
- - d/p/*: Refreshed.
- * d/rules: Don't run dh_install with --fail-missing and exclusions until
- package is a complete replacement for mysql-5.5.
- * d/p/CVE-2014-0001.patch:
- - Fix buffer overflow in client/mysql.cc via a long server version string.
- CVE-2014-0001 (Closes: #741590).
- * d/mysql-server-5.6.mysql.upstart: Add upstart configuration.
- * d/tests/*,control: Add autopkgtest from mysql-5.5:
- - disable binlog.binlog_server_start_options as it requires writable /usr.
- - disable build autopkgtest until package ships libmysqlclient18.
- * d/rules,mysql-server-5.6.install,apparmor-profile: Fixup install of
- apparmor profile.
-
- -- James Page <james.page@ubuntu.com> Mon, 17 Mar 2014 08:56:24 +0000
-
-mysql-5.6 (5.6.15-1~exp2) experimental; urgency=medium
-
- * d/control,rules: Drop libmysqlclient18.1* and libmysqld-5.6* due to conflicts
- with libmysqlclient{18}-dev and incorrect SONAME naming (Closes: #741200).
- NOTE: libmysqlclient* and libmysqld* can be re-instated when the 5.5->5.6
- transition happens.
- * d/control: Align Conflicts/Breaks/Replaces/Provides with virtual-mysql-*
- approach for switching in/out MySQL alternatives.
- * d/mysql-server-5.6.mysql.init: Bump timeout on start to 30 seconds inline
- with mysql-5.5 changes.
-
- -- James Page <james.page@ubuntu.com> Mon, 10 Mar 2014 17:36:34 +0000
-
-mysql-5.6 (5.6.15-1~exp1) experimental; urgency=low
-
- [ Akhil Mohan ]
- * added libmysqlclient.so link to libmysqlclient18.1-dev package
- * revisited patches in d/patches/series; removed extra patches not needed
- * some patches were modified to handle 5.6 issues
- * mysql-server-5.6 and mysql-client-5.6 now depend on mysql-common (>= 5.5)
- * mysql-server-5.6 now provides only virtual-mysql-server
- * mysql-client-5.6 now provides only virtual-mysql-client
- * MySQL 5.6 now contains mysql-common-5.6 which is only suggested
- * moved mysql-common/etc/mysql/my.cnf to
- mysql-common-5.6/usr/share/mysql/my.cnf
- * MySQL 5.6 now gives libmysqlclient18.1, libmysqlclient18.1-dev,
- libmysqld-5.6-dev and libmysqld-5.6-pic
- * libmysqlclient18.1-dev, libmysqld-5.6-dev and libmysqld-5.6-pic packages
- conflict with their respective counterparts from MySQL 5.5
- * link traversal for libmysqlclient is
- libmysqlclient.so (contained in libmysqclient18.1-dev) ->
- libmysqlclient.so.18 (contained in libmysqclient18.1) ->
- libmysqlclient.so.18.1 (contained in libmysqclient18.1) ->
- libmysqlclient.so.18.1.0 (contained in libmysqclient18.1)
- * Placeholder packages mysql-server, mysql-client, mysql-testsuite
- have been discontinued
- * d/rules, d/control removed gcc-4.4 dependency and disable X86 assembly in
- taocrypt.
- - Cherry-pick from Debian svn r2231 with thanks to Clint Byrum.
- * changed mirror to download source tar
- * replaced mysql_install_db script with small shell script to create
- root accounts. This avoids creating anonymous users which were
- security concern.
- * Docs/mysql.info has been removed in the mysql 5.6.15 source
- * removed debian/repack.* and 'DFSG and repacking' section in
- debian/README.source because repack not needed
- * dropped '+dfsg' from version in changelog since there is no repack
- * simplified debian/watch since there is no repack
- * removed redundant *_r* links to mysql client library in libmysqlclient18
- and libmysqlclient-dev packages
- * updated debian/control to allow mysql-*-5.6 packages upgrade/ replace
- an existing installation of mysql-*-5.5 packages
- * modified debian/rules to use system zlib library, install additional
- man pages and remove execute bit on few test and result files
- * added patches to fix link path in man page mysql_client_test_embedded.1
- and mysqltest_embedded.1
- * added man page for mysql_config_pic at debian/additions/mysql_config_pic.1
- * added man page for mysql_embedded at debian/additions/mysql_embedded.1
- * moved libmysqlcient.so link from libmysqlclient18 to libmysqlclient-dev
- based on lintian warning non-dev-pkg-with-shlib-symlink
- * moved mysql_client_test_embedded binary from mysql-testsuite-5.6
- package to mysql-client-5.6 package
- * moved mysql_config_editor.1 man page to mysql-client-5.6 package
- * moved mysql_embedded from mysql-testsuite-5.6 package to mysql-client-5.6
- package
- * moved mysqltest_embedded binary from mysql-testsuite-5.6
- package to mysql-server-5.6 package
- * removed absolute path for mysql_install_db script in mysql-server-5.6
- postinst script based on lintian warning
-
- [ Bjoern Boschman ]
- * Initial release of mysql-5.6 package.
- * mysql_install_db is now a perl script. Do not run it with bash.
- * added innodb_data_file_path to my.cnf for mysql-5.1 => mysql-5.6 upgrade
- path.
- * added multiarch support
- * do not include .a files within libmysqlclient18
-
- -- James Page <jamespage@debian.org> Wed, 12 Feb 2014 12:11:53 +0000
-
-mysql-5.5 (5.5.25+dfsg-2) quantal; urgency=low
-
- [ Nicholas Bamber ]
- * Made DFSG repacking mechanism independent of local installs and improved
- the documentation
- * Setting the gcc/g++ version to 4.4 on i386 platforms (Closes: #674267)
- but see #678252 for follow up from upstream
- * Danish debconf translation (Closes: #599483)
- * Spanish debconf translation (Closes: #679053)
-
- [ Bjoern Boschman ]
- * mysqld_safe is now running as User 'mysql' (Closes: 664639)
- * logrotate now handles all /var/log/mysql/*log files
-
- -- Bjoern Boschman <bjoern.boschman@nfon.net> Wed, 09 Jan 2013 11:15:29 +0100
-
-mysql-5.5 (5.5.25+dfsg-1) experimental; urgency=low
-
- * Fixing regular expression in tests to guard against build path containing
- the '+' symbol (Closes: #674210)
- * Setting the gcc/g++ version to 4.5 on i386 platforms (cf. #674267)
- * Removed main_openssl_1 patch
- * Set SYSTEM_TYPE according to GNU Build System
- * In an effort to get a better handle on test coverage, made test failures
- on kfreebsd-i386 fatal and re-enabled full tests on hurd, skipped certain
- tests on kfreebsd and changed disabled tests to selectively skipped tests
- * Updated French translation (Closes: #674025)
- * Updated Dutch translation (Closes: #674124)
- * Updated Russian translation (Closes: #674189)
- * Updated Portuguese translation (Closes: #674953)
- * Updated Swedish translation (Closes: #675108)
- * Updated German translation (Closes: #675766)
- * Migrated libmysqlclient-dev, mysql-client-5.5, mysql-server-core-5.5
- and mysql-server-5.5 off dh_movefiles
- * Removed dh_movefiles override
- * Rewrote libmysqlclient_r linking stuff to generate
- ephemeral dh_link files so that the hack is more comprehensible
- * Stopped attempts to install non-existent files for libmysqlclient-dev
- and mysql-server-5.5
- * Added --fail-missing to dh_install to catch executables not being installed
- * Distributed unused resources amongst packages appropriately
- * Added fixes to mop up various permissions issues in auto-install rule
- * Enhanced documentation around the source package and the reasons for it
- being arch:any
- * Removed source cruft: debian/additions/*.1 (apart from mysqlreport.1)
- * Restored zlib1g-dev build dependency pending further investigation
- * Removed the numerical prefix from the patch files
- * Applied fix-mysqldump-test.patch from Ubuntu
- * Applied mysql-testsuite and mysql-client-core-5.5 package definitions
- from Ubuntu
- * Located and installed upstream changelog
- * Removed doxygen-latex, ghostscript as build dependency
- as these were needed only for the NDB docs
- * Added lintian overrides
- - spelling false positive: yuR
- - long lines in man pages that cannot be reformatted
- - missing symbols file (cf. #590905)
- * Added patch for hyphen/minus sign confusion
- * Dropped mailx to Suggests clause (Closes: #535496)
- * New upstream source
- * Refreshed patches
- * Standardized debian/watch and get-orig-source and made DFSG exclusion
- of Docs/mysql.info explicit (Closes: #673528)
- * Revert having libssl-dev as a build dependency and changed
- WITH_SSL option to 'bundled' from 'yes' (Closes: #590905)
- and (Closes: #673865)
- * Added patch to libmysql/CMakeLists.txt to restore symbol versioning
- and bumped dependency in shlibs (Closes: #660686)
- * Ensured that /etc/mysql/conf.d is installed as part of mysql-common
- so that client programs work without a co-located server (Closes: #672359)
- * Added versioned dependency on initscripts and revert /var/run
- to /run change (Closes: #676560)
-
- -- Nicholas Bamber <nicholas@periapt.co.uk> Wed, 13 Jun 2012 16:09:54 +0100
-
-mysql-5.5 (5.5.23-2) unstable; urgency=low
-
- * Stopped overriding the -j build parameter (Closes: #512964)
- * Stopped testing for /proc filesystem. It is no longer used
- for determining the number of CPUs.
- * Removed unnecessary build dependencies:
- - procps as it is required by cmake, cf. #96768
- - zlib1g newer version required by cmake
- - libtool obsoleted by cmake
- - file required by debhelper
- * Migrated libmysqld-dev, libmysqld-pic, libmysqlclient18 to using
- dh_install rather than dh_movefiles
- * Changed /var/run to /run as required by Debian Policy 3.9.3 (9.1.1)
- * Raised standards version to 3.9.3
- * Moved '-e' from shebang line to explicit 'set -e' as requested by lintian
- * Restored ha_example.so to mysql-server-5.5 but added Breaks/Replaces
- clauses (cf. LP: #912487) and (Closes: #666721)
- * Added additional Breaks/Replaces clauses for other clashes:
- - mysql-server-5.5 overwrites perror from mysql-client-5.1
- - mysql-server-core-5.5 overwrites my_print_defaults from mysql-client-5.1
-
- -- Nicholas Bamber <nicholas@periapt.co.uk> Tue, 08 May 2012 05:59:09 +0100
-
-mysql-5.5 (5.5.23-1) experimental; urgency=low
-
- * Added patch to test suite to accept socket paths less than 40
- characters long (Closes: #540153)
- * Disabled some more tests including some reported by Olaf van der Speck
- * Removed ha_example.so from mysql-server-5.5 install (Closes: #666721)
- * New upstream release: unspecified security issues CVE-2012-1697,
- CVE-2012-1696
- * Added patch to correct spelling mistakes: preceeding -> preceding
-
- -- Nicholas Bamber <nicholas@periapt.co.uk> Thu, 03 May 2012 18:03:34 +0100
-
-mysql-5.5 (5.5.20-1) experimental; urgency=low
-
- [ Guillaume Plessis ]
- * d/rules: Enabling ARCHIVE, BLACKHOLE, and FEDERATED engines.
- (Closes: #649484)
- * d/rules: Turn off embedded libedit/readline.(Closes: #659566)
-
- [ Clint Byrum ]
- * New Upstream Release
- * d/copyright: rearranging to have standalone license paragraphs
- silencing lintian complaints about missing paragraphs.
- * d/mysql-client-5.5.files: add mysql_plugin
- * d/rules, d/control: 5.5.20 Fixes segfault on tests with gcc 4.6,
- change compiler back to system default.
- * Sync changes back from Ubuntu:
- * d/control: need to also break mysql-client-core-5.1 and
- mysql-server-core-5.1 as well so that apt knows not to
- remove mysql-server/mysql-client.
- * d/control: convert mysql-server back to a meta-package
- * d/control: convert mysql-client back to a meta-package as well.
- * d/patches/72_fix_standalone_tests.patch: fix testsuite so it
- will run all tests when run from system /usr/lib/mysql-testsuite
- directory.
- 5.1 is removed from the archive.
- * d/control: mysql-common includes configuration items that only
- work on mysql 5.5, so adding Breaks: for client and server 5.1.
- This will make mysql-server-5.1 and mysql-client-5.1
- uninstallable which is actually desired.
- * d/patches/71_disable_rpl_tests.patch: disables this test until
- Ubuntu bug #894146 can be triaged.
- * d/mysql-client-5.5.files: add missing mysql_plugin
- * d/libmysqlcient18.files,libmysqlclient-dev.files,d/rules: re-add
- libmysqlclient_r. In hindsight, removing it was not a productive
- change.
- * d/libmysqlclient-dev.files: ship entire contents of include dir,
- some of these files are included internally by others in the
- main dir.
- * d/patches/70_mysql_va_list.patch: cherry pick patch from
- upstream bug tracker to fix ARM build failure. (LP: #700982)
-
- [ Nicholas Bamber ]
- * Added myself to Uploaders
- * Added libssl-dev as a build dependency and patched main.openssl_1 test
- so that it works with that library (Closes: #660799)
- * Added patch to provide cmake options for GNU/Hurd (Closes: #651002)
- and tweaked debian/rules so that only 'make test' is run on Hurd.
- * Tweaked debian/rules to make build logs verbose (Closes: #651003)
- * Refreshed patches - and added a new patch to disable a further flurry
- of failing tests
- * Switched on native AIO in linux builds (Closes: #659565)
- * Numerous minor changes to improve lintian cleanliness (Closes: #663354)
- - Added dh_lintian lines to debian/rules to ensure that lintian
- overrides take effect and removed old commented out lines
- - Clarified Hurd procps dependency in debian/control
- - Rewrote short description of the libmysqld-pic package to be more accurate
- - Depersonalised long description of mysql-client
- - Removed dependencies relating to mysql-common-4.1
- - Tightened Breaks clauses for mysql-common
- - Removed duplicate entry from Replaces clauses for mysql-server-core-5.5
- - Rexpressed Conflicts clause as versioned dependency
- for mysql-testsuite-5.5
- - Added DEP-5 header fields to two patches
- - Refreshed and commented all lintian overrides and added override
- concerning lack of upstream changelog to all packages
- - Cleaned up debian/copyright
- * upgraded to latest version of DEP-5
- * encoding issues
- * out of date FSF address
- * Updated License short name from "PD" to "public-domain"
- * Converted to short form debhelper rules
- - Renamed stamp files to end in '-stamp' so that they are cleaned up
- automatically by dh_clean
- - Removed commented out lines
- - Removed obsolete -DINSTALL_LIBDIR clause from pic build
- - Overrode dh_auto_install so that the rules only run once
- - Migrated mysql-source, mysql-testsuite, mysql-common from
- dh_movefiles to dh_install
-
- -- Nicholas Bamber <nicholas@periapt.co.uk> Sat, 28 Apr 2012 15:02:16 +0100
-
-mysql-5.5 (5.5.17-4) experimental; urgency=low
-
- * d/control: Pre-Depend on multiarch-support and misc:Pre-Depends.
- also bump debhelper Build-Dep for multiarch.
- d/compat: raise to 9 for multiarch support.
-
- -- Clint Byrum <clint@ubuntu.com> Thu, 17 Nov 2011 17:38:19 -0800
-
-mysql-5.5 (5.5.17-3) experimental; urgency=low
-
- [Clint Byrum]
- * d/control: setting Multi-Arch fields where appropriate.
-
- [Norbert Tretkowski]
- * Add Clint Byrum to Uploaders.
-
- -- Clint Byrum <clint@ubuntu.com> Thu, 17 Nov 2011 14:36:50 -0800
-
-mysql-5.5 (5.5.17-2) experimental; urgency=low
-
- * d/rules, d/control: Build with gcc 4.5 to avoid
- gcc 4.6 compile problems (see Debian bug number 630471)
- * d/rules, d/libmysqlclient*.files: changes to support
- multiarch.
- * d/libmysqlclient18.files, d/libmysqlclient-dev.files: install
- symlinks to dev libraries properly and remove libmysqlclient_r
- since it is no longer needed. libmysqlclient is now perfectly
- thread safe. This will cause FTBFS but can be corrected by simply
- removing _r, and avoids uncomfortable problem of trying to properly
- mangle libmysqlclient_r symlinks to libmysqlclient.so.
-
- -- Clint Byrum <clint@ubuntu.com> Wed, 09 Nov 2011 23:27:36 -0800
-
-mysql-5.5 (5.5.17-1) experimental; urgency=low
-
- [Norbert Tretkowski]
- * New upstream release.
- * Fix empty libmysqld-pic package.
- * Run dh_apparmor on Ubuntu only.
-
- [Clint Byrum]
- * Rewrote debian/copyright file from scratch.
-
- -- Clint Byrum <clint@ubuntu.com> Tue, 08 Nov 2011 11:31:13 -0800
-
-mysql-5.5 (5.5.13-1) experimental; urgency=low
-
- [Clint Byrum]
- * New upstream major release. Changing source name to mysql-5.5.
- (closes: #609592, #637274)
- * Dropping usr/lib/libmysqlclient*.la as they are no longer built
- by the cmake build, and are not necessary for linking properly.
- * Removing obsolete automake and dpatch build deps.
- * Converted source format to 3.0 (quilt).
- * debian/patches: Converted to quilt, and removed all except disable
- long filename check to allow building on sbuild/chroots.
- * Renamed packages with -5.1 suffix to -5.5.
- * Renaming mysql-testsuite to mysql-testsuite-5.5.
- * Dropping unneeded docs files.
- * Dropping libmysqlclient16-dev as transition is complete.
- * Bumping libmysqlclient to v18 for new SONAME.
-
- [Norbert Tretkowski]
- * Update my.cnf to use --lc-messages-dir instead --language.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 23 Jun 2011 10:25:33 +0200
-
-mysql-5.1 (5.1.58-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 17 Jul 2011 17:26:27 +0200
-
-mysql-5.1 (5.1.57-3) unstable; urgency=low
-
- * Really fix syntax warning in preinst. (closes: #630672)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 21 Jun 2011 10:33:25 +0200
-
-mysql-5.1 (5.1.57-2) unstable; urgency=low
-
- * Acknowledge NMUs. (closes: #614044)
- * Fix syntax warning in preinst. (closes: #630672)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 18 Jun 2011 19:28:35 +0200
-
-mysql-5.1 (5.1.57-1.3) unstable; urgency=high
-
- * Non-maintainer upload.
- * Use correct DEB_HOST_GNU_TYPE and not DEB_HOST_BUILD_TYPE.
-
- -- Ondřej Surý <ondrej@debian.org> Mon, 13 Jun 2011 17:02:50 +0200
-
-mysql-5.1 (5.1.57-1.2) unstable; urgency=high
-
- * Non-maintainer upload.
- * Prefix gcc-4.5 and g++-4.5 with DEB_BUILD_GNU_TYPE to fix FTBFS on
- ia64, s390 and maybe more.
-
- -- Ondřej Surý <ondrej@debian.org> Mon, 13 Jun 2011 13:20:37 +0200
-
-mysql-5.1 (5.1.57-1.1) unstable; urgency=high
-
- * Non-maintainer upload (with permission of maintainer).
- * Build with gcc-4.5 (Closes: #614044)
- * Revert: "Build with -O2 instead -O3, MySQL seems not yet ready for -
- O3 when using gcc-4.6." since we are building with gcc-4.5.
-
- -- Ondřej Surý <ondrej@debian.org> Mon, 13 Jun 2011 08:51:51 +0200
-
-mysql-5.1 (5.1.57-1) unstable; urgency=medium
-
- * Bump libmysqlclient16 shlibs to 5.1.50-1 as it introduced a new symbol.
- (closes: #617240)
- * Build with -O2 instead -O3, MySQL seems not yet ready for -O3 when using
- gcc-4.6. (closes: #614044)
- * Ignore errors in testsuite run on ia64.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 14 May 2011 14:56:13 +0200
-
-mysql-5.1 (5.1.56-1) unstable; urgency=low
-
- * New upstream release.
- * Replace doxygen and texlive-latex-base build-deps with doxygen-latex.
- (closes: #616270)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 08 Mar 2011 20:59:41 +0100
-
-mysql-5.1 (5.1.55-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 08 Feb 2011 12:56:42 +0100
-
-mysql-5.1 (5.1.54-2) unstable; urgency=low
-
- * Upload to unstable.
- * Add mysql-source-5.1 package, patch from Clint Byrum. (closes: #611965)
- * Update debconf translations:
- - Dutch, from Eric Spreen. (closes: #605590)
- - Slovak, from Slavko. (closes: #608885)
- * Fix minor grammar infelicity in debian-start script. (closes: #582955)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 04 Feb 2011 16:28:08 +0100
-
-mysql-5.1 (5.1.54-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 17 Dec 2010 06:06:18 +0100
-
-mysql-5.1 (5.1.53-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 01 Dec 2010 12:41:28 +0100
-
-mysql-5.1 (5.1.51-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 02 Oct 2010 16:18:30 +0200
-
-mysql-5.1 (5.1.50-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 12 Sep 2010 20:13:25 +0200
-
-mysql-5.1 (5.1.49-3) unstable; urgency=high
-
- * SECURITY UPDATE: denial of service via incorrect propagation of type
- errors.
- - debian/patches/61_CVE-2010-3833.dpatch: properly check for execution
- errors in sql/item_func.cc. Add tests to mysql-test/*.
- - CVE-2010-3833
- * SECURITY UPDATE: denial of service via derived table materializing.
- - debian/patches/61_CVE-2010-3834.dpatch: handle temporary tables in
- sql/field.cc, sql/sql_select.*. Add tests to mysql-test/*.
- - CVE-2010-3834
- * SECURITY UPDATE: denial of service via user-variable assignment
- expression.
- - debian/patches/61_CVE-2010-3835.dpatch: fix logic in sql/item_func.*,
- Add tests to mysql-test/*.
- - CVE-2010-3835
- * SECURITY UPDATE: denial of service via pre-evaluation of LIKE
- predicates during view preparation.
- - debian/patches/61_CVE-2010-3836.dpatch: make sure we're not in view
- preparation mode in sql/item_cmpfunc.cc. Add tests to mysql-test/*.
- - CVE-2010-3836
- * SECURITY UPDATE: denial of service via use of GROUP_CONCAT() and
- WITH ROLLUP together.
- - debian/patches/61_CVE-2010-3837.dpatch: create a copy of the order
- structures in sql/item_sum.cc, sql/table.h. Add tests to
- mysql-test/*.
- - CVE-2010-3837
- * SECURITY UPDATE: denial of service via longblob and union or update
- with subquery.
- - debian/patches/61_CVE-2010-3838.dpatch: handle REAL_RESULT in
- sql/item_func.cc. Add tests to mysql-test/*.
- - CVE-2010-3838
- * SECURITY UPDATE: denial of service via certain queries with nested
- joins.
- - debian/patches/61_CVE-2010-3839.dpatch: fix nesting in
- sql/sql_select.cc. Add tests to mysql-test/*.
- - CVE-2010-3839
- * SECURITY UPDATE: denial of service via PolyFromWKB() function and
- improper data.
- - debian/patches/61_CVE-2010-3840.dpatch: improve data handling in
- sql/spatial.cc. Add tests to mysql-test/*.
- - CVE-2010-3840
-
- * Patches and changelog entries taken from Ubuntu. (closes: #599937)
- * Import and ACK NMU 5.1.49-2.1. (closes: #595120, #601152)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 30 Nov 2010 09:20:33 +0100
-
-mysql-5.1 (5.1.49-2.1) unstable; urgency=high
-
- * Non-maintainer upload.
- * debian/mysql-server-5.1.mysql.init: Remove $named from
- Should-Start/Should-Stop (closes: #595120).
- Thanks for Clint Byrum <clint@ubuntu.com> patch.
- * Update Portuguese translation (closes: #601152).
- Thanks for Miguel Figueiredo <elmig@debianpt.org> patch.
-
- -- Xavier Oswald <xoswald@debian.org> Sat, 27 Nov 2010 17:43:13 +0100
-
-mysql-5.1 (5.1.49-2) unstable; urgency=low
-
- * Check for server binary before executing any script. (closes: #583611)
- * Move my_print_defaults and perror from mysql-server-5.1 to mysql-client-5.1
- package. (closes: #591373)
- * Update debconf translations:
- - Spanish, from Javier Fernández-Sanguino. (closes: #592171)
- - Galician, from Jorge Barreiro. (closes: #592813)
- - Arabic, from Ossama Khayat. (closes: #596169, #600884)
- - Czech, from Miroslav Kure. (closes: #598339)
- - Danish, from Joe Dalton. (closes: #599483)
- - Portuguese, from Rui Branco. (closes: #599759)
- - Catalan, from Jordi Mallach. (closes: #601098)
- * Add patch 99_fix_testsuite_for_installed_env.dpatch from Ubuntu to fix
- mysql-testsuite to work with the installation location.
- * Add README.source file to make lintian happy.
- * Update Standards-Version to 3.9.1, no changes required.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 27 Oct 2010 14:41:19 +0200
-
-mysql-5.1 (5.1.49-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 31 Jul 2010 12:34:43 +0200
-
-mysql-5.1 (5.1.48-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 17 Jun 2010 22:38:56 +0200
-
-mysql-5.1 (5.1.47-1) unstable; urgency=low
-
- * New upstream release. (closes: #582526)
- * Add patch to fix compile issue with embedded enabled.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 22 May 2010 08:59:41 +0200
-
-mysql-5.1 (5.1.46-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 11 May 2010 18:47:32 +0200
-
-mysql-5.1 (5.1.45-3) unstable; urgency=low
-
- * Upload to unstable.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 10 Apr 2010 19:22:55 +0200
-
-mysql-5.1 (5.1.45-2) experimental; urgency=low
-
- * Add mysql-server-core-5.1 package, containing the package and its manpage,
- to let packages like akonadi use the mysqld binary without using system
- databases. Thanks to Didier Raboud for the patch! (closes: #548419)
- * Add libterm-readkey-perl suggestion to mysql-client-5.1 package.
- (closes: #574505, #575769)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 31 Mar 2010 11:36:25 +0200
-
-mysql-5.1 (5.1.45-1) unstable; urgency=low
-
- * New upstream release.
- * Drop patch 10_readline_build_fix.dpatch.
- * Rename source package to mysql-5.1.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 17 Mar 2010 14:56:02 +0100
-
-mysql-dfsg-5.1 (5.1.44-3) unstable; urgency=low
-
- * Add patch that reinstates the reloading of character set data when a
- mysql_library_init() is done after a mysql_library_end().
- (closes: #569549, #569595)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Mon, 01 Mar 2010 18:22:35 +0100
-
-mysql-dfsg-5.1 (5.1.44-2) unstable; urgency=low
-
- * Disable innodb.innodb_information_schema test in testsuite run, it fails
- randomly on at least i386. (closes: #570693)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 21 Feb 2010 20:45:59 +0100
-
-mysql-dfsg-5.1 (5.1.44-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 18 Feb 2010 21:38:09 +0100
-
-mysql-dfsg-5.1 (5.1.43-1) unstable; urgency=low
-
- * New upstream release.
- * Drop patches:
- + 11_binlog_wrong_offset.dpatch
- + 96_SECURITY_CVE-2009-4484.dpatch
- * Disable SSL related test in the testsuite until MySQL gets shipped with an
- updated SSL certificate.
- * Include symlinks for mysqlcheck manpages. (closes: #558760)
- * Fix some lintian warnings:
- + debian-news-entry-has-unknown-version
- + postinst-has-useless-call-to-ldconfig
- + postrm-has-useless-call-to-ldconfig
- * Bump Standards-Version to 3.8.4, no changes required.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Mon, 01 Feb 2010 22:03:42 +0100
-
-mysql-dfsg-5.1 (5.1.41-4) unstable; urgency=high
-
- * SECURITY:
- Fix for CVE-2009-4484: Copying name tags into an internal buffer from
- incoming stream we didn't check the buffer overflow. That may lead to
- memory overrun, crash etc.
- * Add -fno-strict-aliasing to $CFLAGS to get around testsuite errors when
- building with gcc 4.4.x. (closes: #554207)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Mon, 18 Jan 2010 19:03:25 +0100
-
-mysql-dfsg-5.1 (5.1.41-3) unstable; urgency=low
-
- * Let mysql-server-5.1 replace libmysqlclient-dev (>= 5.1.41-1) because of
- moved InnoDB plugin. (closes: #557806)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 24 Nov 2009 19:20:36 +0100
-
-mysql-dfsg-5.1 (5.1.41-2) unstable; urgency=low
-
- * Move InnoDB plugin into -server package.
- * Fix some lintian errors and warnings:
- + weak-library-dev-dependency
- + dir-or-file-in-var-run
- + command-with-path-in-maintainer-script
- * Ignore errors in testsuite run on s390.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 21 Nov 2009 13:37:17 +0100
-
-mysql-dfsg-5.1 (5.1.41-1) unstable; urgency=medium
-
- * New upstream release.
- * Drop patch 60_zlib_innodb_workaround.dpatch, merged upstream.
- * Make $DATADIR readable/writeable only for user mysql. (closes: #555626)
- * Build with --without-readline to use system readline instead of bundled
- copy. (closes: #552003)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 20 Nov 2009 17:35:42 +0100
-
-mysql-dfsg-5.1 (5.1.40-1) unstable; urgency=low
-
- * New upstream release.
- * Set thread_stack size to 192K rather than 128K.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 23 Oct 2009 19:12:45 +0200
-
-mysql-dfsg-5.1 (5.1.39-1) unstable; urgency=low
-
- * New upstream release.
- * New patch 60_zlib_innodb_workaround.dpatch to fix an incompatibility
- between zlib and innodb during testsuite run.
- * Wait in the SIGHUP trap to avoid killing an existing mysqld process when a
- HUP signal is sent to mysqld_safe, patch based based on Mathias Gug's fix
- from 5.0 series. (closes: #545044)
- * Update debconf translations:
- - Japanese, from Hideki Yamane. (closes: #545329)
- - Swedish, from Martin Bagge. (closes: #545731)
- * Fix some options in my.cnf about log_file have their named changed, patch
- from Mathias Gug. (closes: #545761)
- * Do not upgrade if there is an ndb management node configured, patch from
- Mathias Gug. (closes: #545760)
- * Switch build-dependency from libreadline5-dev to libreadline-dev.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Mon, 28 Sep 2009 17:41:51 +0200
-
-mysql-dfsg-5.1 (5.1.37-2) unstable; urgency=low
-
- * Update debconf translations:
- - Swedish, from Martin Bagge. (closes: #539207)
- - Russian, from Yuri Kozlov. (closes: #540216)
- - French, from Christian Perrier. (closes: #540508)
- - Italian, from Luca Monducci. (closes: #541465)
- - German, from Thomas Mueller. (closes: #544477)
- * Handle DEB_BUILD_OPTIONS correctly, patch from Stephen Depooter.
- (closes: #523928)
- * Support ANSI mode in debian-start.inc.sh, patch from Mathias Gug.
- (closes: #534606)
- * Enable hardening. (closes: #542746)
- * Drop old_passwords option. (closes: #540366)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 02 Sep 2009 20:26:59 +0200
-
-mysql-dfsg-5.1 (5.1.37-1) unstable; urgency=low
-
- * New upstream release.
- * Drop empty transitional package libmysqlclient15-dev, and provide/replace
- it with libmysqlclient-dev. (closes: #538659)
- * Ignore errors in testsuite on all archs but amd64, i386, ia64 and s390.
- (closes: #539679)
- * Update debconf translations:
- - French, from Christian Perrier. (closes: #539703)
- * Fixed typo regarding log_type in my.cnf.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 04 Aug 2009 19:25:45 +0200
-
-mysql-dfsg-5.1 (5.1.36-5) unstable; urgency=low
-
- [ Christian Hammers ]
- * Applied debconf template patch from debian-l10n-english (thanks to
- Justin B Rye).
- * Added a missing misc:Depends to debian/control for lintian.
- * Fixes typo in initscript (thanks to Gaspar Lajos).
-
- [ Norbert Tretkowski ]
- * Ignore errors in testsuite run on mips. (closes: #539095)
- * Update debconf translations:
- - Basque, from Piarres Beobide. (closes: #539130)
- - Russian, from Yuri Kozlov. (closes: #539459)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 01 Aug 2009 11:13:55 +0200
-
-mysql-dfsg-5.1 (5.1.36-4) unstable; urgency=low
-
- * dpkg-gensymbols caused a lot of FTBFS because the C++ libraries have
- slightly different symbol names on other archs (long vs. int somebody
- told me on IRC). We now limit the ABI compatibility check to amd64.
-
- -- Christian Hammers <ch@debian.org> Sun, 26 Jul 2009 11:46:20 +0200
-
-mysql-dfsg-5.1 (5.1.36-3) unstable; urgency=low
-
- * Moving from experimental to unstable!
-
- -- Christian Hammers <ch@debian.org> Sat, 25 Jul 2009 20:42:39 +0200
-
-mysql-dfsg-5.1 (5.1.36-2) experimental; urgency=low
-
- * Build both -fPIC (libmysql_pic.a) and non -fPIC (libmysqld.a) as
- some packages seem to need the -fPIC variant for their own build
- process. Documented in README.Debian. Thanks to Modestas Vainius
- for the patch. Closes: #508406
- * Switch to out-of-source true build mode was a side effect of this change.
- * Added libmysqlclient16.symbols file (thanks to Raphael Hertzog).
- * Raised debian/compat from 4 to 7.
- * Updated innotop to 1.7.1.
- * Minor cleanups that lintian suggested.
-
- -- Christian Hammers <ch@debian.org> Sun, 19 Jul 2009 18:48:53 +0200
-
-mysql-dfsg-5.1 (5.1.36-1) experimental; urgency=low
-
- * Ex-maintainer upload :)
- * New upstream release.
- * SECURITY: Upstream fix for "mysql client does not escape strings in
- --html mode." (CVE-2008-4456) Closes: #526254
- * Upstream fixes REPEAT() function. Closes: #447028
- * Upstream fixes problems when mixing ORDER and GROUP BY. Closes: #470854
- * There were many innodb fixes in the last two years, probably
- also for this unreproducible crash. CLoses: #447713
- * Removed amd64 specific -fPIC compiler option that was introduced
- especially for building the NDB cluster module which is no longer
- part of this package (thanks to Modestas Vainius). Closes: #508406
- * Put /etc/mysql/conf.d to mysql-server-5.1.dirs (thanks to Alexander
- Gerasiov). Closes: #515145
- * Fixed mysql-test suite by adding 50_mysql-test__db_test.dpatch.
- It now passes 100% of the tests again. Also Closes: #533999
- * Preinst now prevents Installation if NDB configuration is detected.
- * Applied Ubuntu patch that fixes privilege bootstrapping in postinst
- (thanks to Mathias Gug). Closes: #535492
- * Applied Ubuntu patch that sets the debconf prio for the root password
- question to high and prevents it from being asked on 5.0 -> 5.1 upgrades
- (thanks to Mathias Gug). Closes: #535500
- * Removed the check for ISAM tables as the only supported upgrade path is
- from lenny's MySQL-5.0.
- * Added /etc/mysql/conf.d/mysqld_safe_syslog.cnf which enables mysqld_safe
- to pipe all mysqld output into the syslog. The reason for not letting dpkg
- handle it via a normal config file change was that my.cnf is usually
- heavily tuned by the admin so the setting would go lost too easily.
- * Updated mysqlreport to version 3.5 (including two minor patches by me).
-
- -- Christian Hammers <ch@debian.org> Wed, 01 Jul 2009 20:54:58 +0200
-
-mysql-dfsg-5.1 (5.1.34-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Mon, 20 Apr 2009 20:23:10 +0200
-
-mysql-dfsg-5.1 (5.1.33-2) experimental; urgency=low
-
- * Remove no longer active developers from uploaders field.
- * Drop workaround for upgrades from MySQL 3.23, not necessary any more.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 07 Apr 2009 11:23:25 +0200
-
-mysql-dfsg-5.1 (5.1.33-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 02 Apr 2009 21:12:23 +0200
-
-mysql-dfsg-5.1 (5.1.32-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 06 Mar 2009 18:48:23 +0100
-
-mysql-dfsg-5.1 (5.1.31-2) experimental; urgency=low
-
- * Update SSL certificates, and re-enable SSL related tests when running
- the testsuite.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 10 Feb 2009 16:08:42 +0100
-
-mysql-dfsg-5.1 (5.1.31-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 08 Feb 2009 17:07:11 +0100
-
-mysql-dfsg-5.1 (5.1.30-2) experimental; urgency=low
-
- * Drop MySQL Cluster support, it's deprecated since 5.1.24-RC.
- * Fix FTBFS if build twice in a row. (closes: #487091)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 05 Dec 2008 21:04:55 +0100
-
-mysql-dfsg-5.1 (5.1.30-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 27 Nov 2008 09:09:55 +0100
-
-mysql-dfsg-5.1 (5.1.29rc-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Mon, 27 Oct 2008 20:00:43 +0100
-
-mysql-dfsg-5.1 (5.1.26rc-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Mon, 14 Jul 2008 21:46:59 +0200
-
-mysql-dfsg-5.1 (5.1.25rc-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 21 Jun 2008 13:55:02 +0200
-
-mysql-dfsg-5.1 (5.1.24rc-1) experimental; urgency=low
-
- * New upstream release.
- * Ignore errors in testsuite on ia64 and s390.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 16 Apr 2008 22:03:44 +0200
-
-mysql-dfsg-5.1 (5.1.23rc-1) experimental; urgency=low
-
- * New upstream release.
-
- [ Christian Hammers ]
- * Add PIC support for NDB libraries on amd64 (thanks to Monty Taylor).
- * Add extra information when aborting due to a detected downgrade (thanks to
- Raphael Pinson).
- * Move libndbclient.so.3 to its own package as it now has a version != 0
- (thanks to Raphael Pinson for reminding me).
-
- [ Monty Taylor ]
- * Remove 85_ndb__staticlib.dpatch since we have a libndbclient package now.
- * Add myself to the uploaders so that I don't get complaints about package
- signing.
- * Add libndbclient-dev package to go with libndbclient3.
-
- [ Norbert Tretkowski ]
- * Update patches:
- + 41_scripts__mysql_install_db.sh__no_test.dpatch
- * Drop patches:
- + 70_upstream_debian__configure.dpatch
- + 71_upstream_debian__Makefile.in.dpatch
- + 99_TEMP_minmax.dpatch
- * Remove Adam Conrad from uploaders on his request. Thanks for your work in
- the past!
- * Ignore errors in testsuite on amd64 and i386.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 29 Feb 2008 10:38:27 +0100
-
-mysql-dfsg-5.1 (5.1.22rc-1) experimental; urgency=low
-
- * New upstream version.
- * Let mysql-server-5.1 pre-depend on debconf as it uses it in the preinst.
- * Fixed mysql-client-5.1 menu entry for upcoming menu policy 1.4.
-
- -- Christian Hammers <ch@debian.org> Tue, 02 Oct 2007 22:45:37 +0200
-
-mysql-dfsg-5.1 (5.1.21beta-1) experimental; urgency=low
-
- * My "Greetings from FrOSCon!" release.
- * New upstream version.
- * libmysqlclient.so.15 has been superseded by libmysqlclient.so.16.
- * Renamed libmysqlclient15-dev to libmysqlclient-dev but added an empty
- package libmysqlclient15-dev to ease the transition for packages with
- a versioned build-dep to libmysqlclient15-dev which is something that
- currently does not work with "Provides:".
- * Synced with 5.0 branch up to subversion release r909.
- * Commented out most of the compile conditionals in the hope that
- all architectures can be build the same way.
- * Added a lot of new binaries and manpages.
- * Switched to plugin based engines.
-
- -- Christian Hammers <ch@debian.org> Sat, 25 Aug 2007 14:24:40 +0200
-
-mysql-dfsg-5.1 (5.1.19beta-1) experimental; urgency=low
-
- * New upstream release.
-
- -- Christian Hammers <ch@debian.org> Mon, 11 Jun 2007 23:18:35 +0200
-
-mysql-dfsg-5.1 (5.1.16beta-4) experimental; urgency=high
-
- * Merged with 5.0 r850:
- * SECURITY:
- In some previous versions mysql_install_db was not idempotent and did
- always create passwordless root accounts although it should only on
- initial installs (thanks to Olaf van der Spek). Closes: #418672
- * Added check for passwordless root accounts to debian-start.
- * As MySQL-5.0 is, at least currently, incompatible with Kernel 2.4 the
- installation is aborted for such old kernels. Debian Etch does not
- support them anyway according to the release notes but this might be
- unexpected and many production servers still have self build ones
- installed (thanks to Marc-Christian Petersen). See: #416841
- * Adjusted TeX build-deps to texlive.
- * Added innotop.
- * Changed maintainer email address to
- pkg-mysql-commits@lists.alioth.debian.org
-
- -- Christian Hammers <ch@debian.org> Thu, 19 Apr 2007 19:29:29 +0200
-
-mysql-dfsg-5.1 (5.1.16beta-3) experimental; urgency=low
-
- * Merged with 5.0 r837:
- * Activated the blackhole engine as it's needed for replicating partition
- designs (thanks to Cyril SCETBON).
- * Fixed segfault on i486 systems without cpuid instruction (thanks to
- Lennart Sorensen). Closes: #410474
- * Only use of the non-essential debconf package in postrm if it is
- still installed (thanks to Michael Ablassmeier). Closes: #416838
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Mar 2007 21:48:11 +0100
-
-mysql-dfsg-5.1 (5.1.16beta-2) experimental; urgency=low
-
- * Merged with 5.0 r818:
- * Fixed FTBFS on Sparc introduced with the "make -j" trick in
- 5.0.32-8 (thanks to Frank Lichtenheld). Closes: #415026
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Mar 2007 21:20:11 +0100
-
-mysql-dfsg-5.1 (5.1.16beta-1) experimental; urgency=low
-
- * New upstream release.
- * SECURITY: Using an INFORMATION_SCHEMA table with ORDER BY in a subquery
- could cause a server crash (CVE-2007-1420).
- * Added temporary patch 90_TEMP_sqlparse-ifdef to avoid build problems.
- * Merged with 5.0 r809:
- * Updated mysqlreport to latest upstream (and patched --help usage
- message and "return if qcache_size==0").
- * Merged with 5.0 r798:
- * Adapt MAKE_J to use the -j option with the number of available
- processors. (thanks to Raphael Pinson).
- * Merged with 5.0 r758:
- * Changed minimum required version in dh_makeshlibs to 5.0.27-1 as
- 5.0.26 had an ABI breakage in it!
- This is the cause for Perl programs crashing with the following error:
- Transactions not supported by database at /usr/lib/perl5/DBI.pm line 672
- * Added some more comments to the default my.cnf.
- * Added support for /etc/mysql/conf.d/.
- * The debian-start script that runs on every server start now first upgrades
- the system tables (if neccessary) and then check them as it sometimes did
- not work the other way around (e.g. for MediaWiki). The script now uses
- mysql_update instead of mysql_update_script as recommended. See: 409780
-
- -- Christian Hammers <ch@debian.org> Fri, 2 Mar 2007 01:00:55 +0100
-
-mysql-dfsg-5.1 (5.1.15beta-1) experimental; urgency=low
-
- * New upstream release.
- [Monty Taylor]
- * Removed patches/25_mysys__default.c - fixed upstream.
- * Removed patches/26_client__mysql_upgrade.c - fixed upstream.
- * Removed patches/29_scripts__mysqlbug.sh - fixed upstream.
- * Removed patches/39_scripts__mysqld_safe.sh__port_dir - fixed upstream.
- * Removed patches/42_scripts__mysqldumpslow__slowdir - fixed upstream.
- * Removed patches/45_warn-CLI-passwords - fixed upstream.
- * Removed patches/89_ndb__records.dpatch - fixed upstream.
- * Removed patches/86_ndbapi_tc_selection.dpatch - fixed upstream.
- [Christian Hammers]
- * Synced with 5.0.32-4.
- * mysql-server-5.0 pre-depends on adduser now and has --disabled-login
- explicitly added to be on the safe side (thanks to the puiparts team).
- Closes: #408362
- * Corrections the terminology regarding NDB in the comments of all config
- files and init scripts (thanks to Geert Vanderkelen of MySQL).
-
- -- Christian Hammers <ch@debian.org> Wed, 7 Feb 2007 11:34:52 -0200
-
-mysql-dfsg-5.1 (5.1.14beta-2) experimental; urgency=low
-
- [Christian Hammers]
- * Readded 85_ndb__staticlib.dpatch with slight modifications.
- * Backported debian-start scripts from 5.0.
- [Monty Taylor]
- * Now build-depends on bison.
- * Updated to standards 3.7.2.
- * Removed references to comp_err.
- * build-depend on automake1.9 to match upstream
- * Merged runlevel changes from 5.0.
- * Added 26_client__mysql_upgrade.c.dpatch to fix a segfault in mysql_upgrade
- when using a password. It's been fixed upstream in 5.1.15.
- * Moved BDB check to sanity_checks() and added a note about deprecation.
- * Use my_print_defaults instead of mysqld --print-defaults
- * Changed NDB Data and Management node startup seqence. Prevented both
- from restarting on upgrade to address rolling upgrade issues.
- * Added a "start-initial" option to the Data Node init script to support
- initial node starts.
- * Added 86_ndbapi_tc_selection.dpatch to fix a bug that causes a segfault
- when using the NdbApi. http://bugs.mysql.com/bug.php?id=24914
- Fixed in 5.1.15
- * Added 89_ndb__records.dpatch to fix
- http://bugs.mysql.com/bug.php?id=25567, which causes a table scan per
- table per query.
-
- -- Christian Hammers <ch@debian.org> Wed, 31 Jan 2007 01:17:35 +0100
-
-mysql-dfsg-5.1 (5.1.14beta-1) experimental; urgency=low
-
- * New upstream.
- * Removed references to mysql_explain_log
- * Changed context for patch to mysqld_multi.1
- * Removed 70_kfreebsd.dpatch - applied to upstream
- * Removed 87_ps_Hurd - applied to upstream
- * Replaced --without-readline to --with-libedit to configure options, as
- --without-readline doesn't seem to do the right thing anymore.
-
- -- Monty Taylor <mordred@inaugust.com> Wed, 10 Jan 2007 12:59:55 -0800
-
-mysql-dfsg-5.1 (5.1.11beta-1) experimental; urgency=low
-
- * Starting new 5.1 branch!
- * FIXME: Following patch couldn't be applied:
- ## 85_ndb__staticlib.dpatch by <ch@debian.org>
- * FIXME: Following patch couldn't be applied:
- ## 86_PATH_MAX.dpatch
-
- -- Christian Hammers <ch@debian.org> Sat, 29 Jul 2006 11:35:42 +0200
-
-mysql-dfsg-5.0 (5.0.84-1) unstable; urgency=low
-
- * New upstream release.
- * Update patches:
- + debian/patches/60_disabled_tests.dpatch
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 24 Jul 2009 18:05:11 +0200
-
-mysql-dfsg-5.0 (5.0.83-1) unstable; urgency=low
-
- * New upstream release.
- * Update patches:
- + debian/patches/45_warn-CLI-passwords.dpatch (closes: #536548)
- + debian/patches/60_disabled_tests.dpatch
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 18 Jul 2009 08:18:53 +0200
-
-mysql-dfsg-5.0 (5.0.81-1) unstable; urgency=low
-
- * New upstream release.
- * Remove patches:
- + debian/patches/63_update_ssl_certs.dpatch
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Mon, 04 May 2009 18:53:05 +0200
-
-mysql-dfsg-5.0 (5.0.77-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 17 Feb 2009 18:42:46 +0100
-
-mysql-dfsg-5.0 (5.0.75-1) unstable; urgency=low
-
- * New upstream release.
- * Update patches:
- + debian/patches/33_scripts__mysql_create_system_tables__no_test.dpatch
- * Remove patches:
- + debian/patches/50_fix_agg_functions.dpatch
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Mon, 22 Dec 2008 11:01:38 +0100
-
-mysql-dfsg-5.0 (5.0.67-3) unstable; urgency=low
-
- * Really apply patch from 5.0.74 to fix check for non-aggregated columns
- in queries.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 16 Dec 2008 07:19:23 +0100
-
-mysql-dfsg-5.0 (5.0.67-2) unstable; urgency=low
-
- * New patch from 5.0.74 to fix check for non-aggregated columns in queries.
- (closes: #505179, #505181)
- * Add patch from Dan Munckton:
- + Clearly indicate that we do not support running multiple instances
- of mysqld by duplicating the init script.
- (closes: #314785, #324834, #435165, #444216)
- + Properly parameterize all existing references to the mysql config
- file (/etc/mysql/my.cnf).
- * Really fix FTBFS if build twice in a row. (closes: #442684)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 14 Dec 2008 10:12:30 +0100
-
-mysql-dfsg-5.0 (5.0.67-1) unstable; urgency=low
-
- * New upstream release.
- * Update patches:
- + debian/patches/25_mysys__default.c.dpatch
- + debian/patches/80_fix_user_setup_on_localhost.dpatch
- * Remove patches:
- + debian/patches/50_fix_mysqldump.dpatch
- + debian/patches/51_incorrect-order.dpatch
- + debian/patches/52_ndb-gcc-4.2.dpatch
- + debian/patches/53_integer-gcc-4.2.dpatch
- + debian/patches/54_ssl-client-support.dpatch
- + debian/patches/55_testsuite-2008.dpatch
- + debian/patches/56_fix_order_by.dpatch
- + debian/patches/57_fix_mysql_replication.dpatch
- + debian/patches/58_disable-ndb-backup-print.dpatch
- + debian/patches/59_fix_relay_logs_corruption.dpatch
- + debian/patches/60_rpl_test_failure.dpatch
- + debian/patches/90_upstreamdebiandir.dpatch
- + debian/patches/91_SECURITY_CVE-2007-5925.dpatch
- + debian/patches/92_SECURITY_CVE-2008-2079.dpatch
- + debian/patches/93_SECURITY_CVE-2008-3963.dpatch
- * Fix FTBFS if build twice in a row. (closes: #442684)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 02 Nov 2008 13:51:50 +0100
-
-mysql-dfsg-5.0 (5.0.51a-24) testing-proposed-updates; urgency=low
-
- * Update SSL certificates, and re-enable SSL related tests when running
- the testsuite.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 03 Feb 2009 15:40:47 +0100
-
-mysql-dfsg-5.0 (5.0.51a-23) testing-proposed-updates; urgency=medium
-
- * Reset debconf password variable root_password_again immediately after
- using it. (closes: #513262)
- * Disable SSL related tests when running the testsuite until MySQL bug
- #42366 gets fixed.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 29 Jan 2009 14:07:32 +0100
-
-mysql-dfsg-5.0 (5.0.51a-22) testing-proposed-updates; urgency=low
-
- * New patch 10_mysql_secure_installation.dpatch to fix failure on passwords
- which need quoting. (closes: #511929)
- * New patch 62_delete_with_self-join.dpatch from 5.0.54 to fix MyISAM
- storage engine error (134) doing delete with self-join. (closes: #512651)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 25 Jan 2009 10:02:35 +0100
-
-mysql-dfsg-5.0 (5.0.51a-21) testing-proposed-updates; urgency=low
-
- * Ask for MySQL root password at high priority, because otherwise all
- default installations will miss this question, thanks to Thijs Kinkhorst
- for the patch. (closes: #510875)
- * Do not fail checking tables when using sql-mode ansi-quotes, thanks to
- Renato Alves for the patch. (closes: #507049)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 09 Jan 2009 10:24:23 +0100
-
-mysql-dfsg-5.0 (5.0.51a-20) testing-proposed-updates; urgency=low
-
- * New patch 60_fix_leap_seconds.dpatch from 5.0.74 to return leap second
- values with a time part that ends with :59:59. (closes: #510177)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 30 Dec 2008 10:32:46 +0100
-
-mysql-dfsg-5.0 (5.0.51a-19) testing-proposed-updates; urgency=low
-
- * New patch 50_fix_mysqldump2.dpatch from 5.0.60 to fix dumping databases
- from mysql 4.0 server. (closes: #507789)
- * Do not create a guest account during bootstrap. (closes: #463704)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 04 Dec 2008 23:07:19 +0100
-
-mysql-dfsg-5.0 (5.0.51a-18) testing-proposed-updates; urgency=high
-
- * SECURITY:
- Fix for CVE-2008-4098: Inadequate validation of paths used in DATA
- DIRECTORY and INDEX DIRECTORY clauses of CREATE TABLE statements enabled
- attackers to write to tables in other databases to which they could not
- ordinarily have access.
-
- -- Devin Carraway <devin@debian.org> Tue, 25 Nov 2008 05:38:45 +0000
-
-mysql-dfsg-5.0 (5.0.51a-17) testing-proposed-updates; urgency=low
-
- * Don't use commented out passwords from debian.cnf. (closes: #453820)
- * Update watch file to recognize releases > 5.0.45.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 02 Nov 2008 13:31:32 +0100
-
-mysql-dfsg-5.0 (5.0.51a-16) unstable; urgency=low
-
- * New patch 60_rpl_test_failure.dpatch from 5.0.54 to fix a race condition
- with the rpl_packet test in some cases. (closes: #501413)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 09 Oct 2008 08:50:43 +0200
-
-mysql-dfsg-5.0 (5.0.51a-15) unstable; urgency=high
-
- * SECURITY:
- Fix for CVE-2008-3963: An empty bit-string literal (b'') caused a server
- crash. Now the value is parsed as an empty bit value (which is treated as
- an empty string in string context or 0 in numeric context).
- (closes: #498362)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 14 Sep 2008 18:27:46 +0200
-
-mysql-dfsg-5.0 (5.0.51a-14) unstable; urgency=low
-
- * Update debconf translations:
- - Swedish, from Martin Bagge. (closes: #491688)
- - Netherlands, from Thijs Kinkhorst. (closes: #492723)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 07 Sep 2008 20:18:31 +0200
-
-mysql-dfsg-5.0 (5.0.51a-13) unstable; urgency=medium
-
- * New patch 59_fix_relay_logs_corruption.dpatch from 5.0.56 to fix
- corruption in relay logs. (closes: #463515)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 03 Sep 2008 09:13:46 +0200
-
-mysql-dfsg-5.0 (5.0.51a-12) unstable; urgency=low
-
- * Disable rpl_ndb_innodb_trans test when running the testsuite, fails
- randomly on i386. (closes: #494238)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 09 Aug 2008 15:56:45 +0200
-
-mysql-dfsg-5.0 (5.0.51a-11) unstable; urgency=low
-
- * Disable innodb_handler test when running the testsuite, fails randomly
- on s390. (closes: #491363)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 23 Jul 2008 08:34:51 +0200
-
-mysql-dfsg-5.0 (5.0.51a-10) unstable; urgency=high
-
- * Merge testing-security upload to finally fix CVE-2008-2079, thanks to
- Devin Carraway and Steffen Joeris. (closes: #480292)
- * New patch 58_disable-ndb-backup-print.dpatch from 5.0.54 to disable
- ndb_backup_print, ndb_alter_table and ndb_replace tests when running the
- testsuite. (closes: #474893)
- * Reenable error handling in testsuite on i386, disabling it was just a
- workaround for the problem which is now fixed with the above patch.
- * Update debconf translations:
- - Vietnamese, from Clytie Siddall. (closes: #486443)
- - Spanish, from Javier Fernández-Sanguino Peña. (closes: #488740)
- - Slovak, from helix84. (closes: #489266)
- * Make lintian happy:
- - Fix build-dependency on -1 revision.
- - Fix deprecated chown usage.
- - Fix spelling error in description.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Tue, 15 Jul 2008 19:37:35 +0200
-
-mysql-dfsg-5.0 (5.0.51a-9+lenny2) testing-security; urgency=high
-
- * Non-maintainer upload by the security team.
- * Correct error number in symlink.test to avoid FTBFS on some archs.
-
- -- Steffen Joeris <white@debian.org> Sun, 13 Jul 2008 11:44:57 +0000
-
-mysql-dfsg-5.0 (5.0.51a-9+lenny1) testing-security; urgency=high
-
- * Non-maintainer upload by the security team.
- * Correct and expand 92_SECURITY_CVE-2008-2079.dpatch to cover all symlinks
- and check the output of fn_format(). (closes: #480292)
- Fixes: CVE-2008-2079
-
- -- Steffen Joeris <white@debian.org> Sat, 12 Jul 2008 05:30:39 +0000
-
-mysql-dfsg-5.0 (5.0.51a-9) unstable; urgency=low
-
- * Ignore errors in testsuite on i386. (workaround for #474893)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 25 Jun 2008 15:07:03 +0200
-
-mysql-dfsg-5.0 (5.0.51a-8) unstable; urgency=low
-
- * New patch 80_fix_user_setup_on_localhost.dpatch from Daniel Hahler to fix
- a duplicate key error when install MySQL server on a host with hostname
- localhost. (closes: #478319)
- * Really fix build on non-linux systems, this time without producing a build
- error on some architectures. (closes: #485971)
- * Update debconf translations:
- - French, from Christian Perrier. (closes: #478553)
- - German, from Alwin Meschede. (closes: #478672)
- - Italian, from Luca Monducci. (closes: #479363)
- - Czech, from Miroslav Kure. (closes: #480924)
- - Galician, from Jacobo Tarrio. (closes: #480965)
- - Basque, from Piarres Beobide. (closes: #481840)
- - Swedish, from Martin Bagge. (closes: #482466, #486307)
- - Turkish, from Mert Dirik. (closes: #484704)
- - Russian, from Yuri Kozlov. (closes: #486149)
- - Finnish, from Esko Arajärvi. (closes: #486554)
- - Portuguese, from Miguel Figueiredo. (closes: #486709)
- - Romanian, from Eddy Petrișor. (closes: #486944)
- - Japanese, from Hideki Yamane. (closes: #487270)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 21 Jun 2008 19:20:48 +0200
-
-mysql-dfsg-5.0 (5.0.51a-7) unstable; urgency=high
-
- [ Norbert Tretkowski ]
- * SECURITY:
- Fix for CVE-2008-2079: It was possible to circumvent privileges through
- the creation of MyISAM tables employing the DATA DIRECTORY and INDEX
- DIRECTORY options to overwrite existing table files in the MySQL data
- directory. Use of the MySQL data directory in DATA DIRECTORY and INDEX
- DIRECTORY is now disallowed. Patch from openSUSE 11.0, thanks to Michal
- Marek. (closes: #480292)
- * Fix build on non-linux systems, like hurd-i386. (closes: #480362)
- * Include symlinks for mysqlcheck. (closes: #480647)
-
- [ Monty Taylor ]
- * Remove ndb_cpcd, as it is only for the NDB test suite and not useful as a
- public program.
- * Fix debian-start.inc.sh for table names with characters needing quotes.
- Thanks Felix Rublack! (closes: #480525, #481154, #481303, #484012)
- * Delete mysql-common.README.Debian. Nothing in it was relevant, and the
- useful information is in mysql-server anyway. (closes: #480940)
- * Remove a spurious HOME= in logrotate script.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 05 Jun 2008 11:49:45 +0200
-
-mysql-dfsg-5.0 (5.0.51a-6) unstable; urgency=low
-
- * Fix debian-start.inc.sh to not print the row counts of the tables
- queried. (closes: #478256, #479697)
-
- -- Monty Taylor <mordred@inaugust.com> Wed, 14 May 2008 00:47:46 -0700
-
-mysql-dfsg-5.0 (5.0.51a-5) unstable; urgency=medium
-
- * New patch 57_fix_mysql_replication.dpatch from 5.0.54 to fix directory for
- relay logs when using replication.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 27 Apr 2008 13:55:04 +0200
-
-mysql-dfsg-5.0 (5.0.51a-4) unstable; urgency=low
-
- [ Monty Taylor ]
- * Remove build of ndb docs, since they are not installed. Removed build deps
- on TeX and doxygen since that's all they were there for.
- * Replace script in check_for_crashed_tables with a myisam-recover option
- and a script to trigger a check of those tables. (thanks HarrisonF and
- kolbe)
- * Replace direct calls to test suite with calls to the make targets used by
- the MySQL build and qa teams for releases.
- * Add --skip-ndbcluster to the postinst bootstrap command. It's really a
- workaround for a bug in 5.1, but it's probably a good idea anyway since we
- certainly don't need cluster to spin up, and if people have enabled
- cluster in their my.cnf file, there could be postinst issues if cluster
- isn't running.
- * Remove reference to configure options that no longer exist.
- * Add myself to uploaders.
-
- [ Norbert Tretkowski ]
- * New patch 56_fix_order_by.dpatch from Ubuntu to fix ORDER BY not working
- with GROUP BY. (closes: #471737)
- * Add note about filename extensions in the /etc/mysql/conf.d/ directory in
- my.cnf. (closes: #461759)
- * Confirm password on install, patch from Nicolas Valcárcel.
- (closes: #471887)
- * Remove Adam Conrad from uploaders on his request. Thanks for your work in
- the past!
- * Use lsb_release to detect distribution.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 05 Apr 2008 21:51:43 +0200
-
-mysql-dfsg-5.0 (5.0.51a-3) unstable; urgency=low
-
- * Disable patch 60_raise-max-keylength.dpatch in default build, but still
- ship it in the source package.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 17 Feb 2008 18:54:42 +0100
-
-mysql-dfsg-5.0 (5.0.51a-2) unstable; urgency=low
-
- * Replace 54_ssl-client-support.dpatch added in 5.0.51-2 with patch from
- upstream.
- * Ignore errors in testsuite on powerpc.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 17 Feb 2008 12:42:58 +0100
-
-mysql-dfsg-5.0 (5.0.51a-1) unstable; urgency=low
-
- [ Norbert Tretkowski ]
- * New upstream security hotfix release. Low priority upload anyway because
- 5.0.51-3 already contained all security fixes.
- * Remove patches:
- + debian/patches/51_mysqlcheck-result.dpatch
- + debian/patches/92_SECURITY_CVE-2007-6303.dpatch
- + debian/patches/93_SECURITY_CVE-2007-6304.dpatch
- + debian/patches/94_SECURITY_CVE-2008-0226+0227.dpatch
- * Add recommendation on libhtml-template-perl to -server package, used by
- ndb_size. (closes: #462265)
- * New patch 60_raise-max-keylength.dpatch to raise the maximum key length to
- 4005 bytes or 1335 UTF-8 characters. (closes: #463137)
- * New patch 51_sort-order.dpatch from 5.0.52 to fix incorrect order when
- using range conditions on 2 tables or more.
- * Support DEB_BUILD_OPTIONS option 'nocheck' to skip tests.
- * Update mysqlreport to 3.4a release.
-
- [ Luk Claes ]
- * Updated Japanese debconf translation. (closes: #462158)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 06 Feb 2008 11:57:45 +0100
-
-mysql-dfsg-5.0 (5.0.51-3) unstable; urgency=high
-
- * SECURITY:
- Fix for CVE-2008-0226 and CVE-2008-0227: Three vulnerabilities in yaSSL
- versions 1.7.5 and earlier were discovered that could lead to a server
- crash or execution of unauthorized code. The exploit requires a server
- with yaSSL enabled and TCP/IP connections enabled, but does not require
- valid MySQL account credentials. The exploit does not apply to OpenSSL.
- (closes: #460873)
- * Fix LSB header in init scripts (patch from Petter Reinholdtsen).
- (closes: #458798)
- * Run testsuite on all archs, but ignore errors on alpha, arm, armel, hppa,
- mipsel and sparc. (closes: #460402)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 23 Jan 2008 11:37:11 +0100
-
-mysql-dfsg-5.0 (5.0.51-2) unstable; urgency=low
-
- [ Monty Taylor ]
- * Added --with-system-type to set the version_compile_os field.
- * Cleaned up some lintian warnings.
- * Removed 43_scripts__mysql_update__password.dpatch since we don't use
- mysql_upgrade_shell anymore and use mysql_upgrade instead.
- * Removed 88_mctype_attrib.dpatch, http://bugs.mysql.com/bug.php?id=25118 is
- closed with http://lists.mysql.com/commits/24337
- * Added mysql-community/mysql-enterprise virtual packages in provides and
- conflicts to ease transitions between versions.
-
- [ Norbert Tretkowski ]
- * Add -fPIC to CFLAGS to allow other packages to be built against
- libmysqld.a on amd64. (closes: #457915)
- * New patch 55_testsuite-2008.dpatch to fix FTBFS in testsuite.
- (closes: #458695)
- * New patch 54_ssl-client-support.dpatch to fix SSL client support.
- * Don't run testsuite on alpha, arm, hppa, mipsel and sparc.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 02 Jan 2008 18:40:04 +0100
-
-mysql-dfsg-5.0 (5.0.51-1) unstable; urgency=low
-
- * New upstream release.
- + Fix a crash in mysql_client_test due to gcc 4.x optimizations.
- (closes: #452558)
- * Update patches:
- + debian/patches/41_scripts__mysql_install_db.sh__no_test.dpatch
- + debian/patches/89_ndb__staticlib.dpatch
- * Run testsuite after build.
- * Re-add manpages, they are licensed under GPL now and redistribution is
- permitted.
- * Drop linux-libc-dev build-dependency, it's now being pulled by libc-dev
- which is build-essential. (closes: #431018)
- * Remove old optimizations for MySQL 3.23.x, they are no longer required.
- (closes: #436552)
- * Don't fail when upgrading mysql-common if $datadir is empty or not defined
- (patch from Edward Allcutt). (closes: #453127)
- * New patch from 5.0.52 to fix mysqldump because 'null' is shown as type of
- fields for view with bad definer. (closes: #454227)
- * New patch from 5.0.52 to fix mysqlcheck test result.
- * New patch from 5.0.52 to fix wrong optimization in ndb code when building
- with gcc 4.2.x.
- * New patch from 5.0.54 to fix wrong number output due to integer overflow
- when building with gcc 4.2.x.
- * New Finnish debconf translation from Esko Arajärvi. (closes: #448776)
- * Update Basque debconf translation from Aitor Ibañez. (closes: #456193)
- * Add Vcs-* and Homepage fields to source stanza in control file.
- * Update mysqlreport to 3.2 release.
- * Let mysql-server-5.0 pre-depend on debconf, because it's preinst is using
- it.
- * Drop menu item for innotop.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Fri, 14 Dec 2007 09:59:36 +0100
-
-mysql-dfsg-5.0 (5.0.45-5) unstable; urgency=high
-
- * SECURITY:
- Fix for CVE-2007-6303: ALTER VIEW retained the original DEFINER value,
- even when altered by another user, which could allow that user to gain the
- access rights of the view. Now ALTER VIEW is allowed only to the original
- definer or users with the SUPER privilege. (closes: #455737)
- * SECURITY:
- Fix for CVE-2007-6304: When using a FEDERATED table, the local server can
- be forced to crash if the remote server returns a result with fewer columns
- than expected.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 12 Dec 2007 20:23:43 +0100
-
-mysql-dfsg-5.0 (5.0.45-4) unstable; urgency=high
-
- * SECURITY:
- Fix for CVE-2007-5969: Using RENAME TABLE against a table with explicit
- DATA DIRECTORY and INDEX DIRECTORY options can be used to overwrite system
- table information by replacing the file to which the symlink points.
- (closes: #455010)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Sun, 09 Dec 2007 12:29:54 +0100
-
-mysql-dfsg-5.0 (5.0.45-3) unstable; urgency=high
-
- * SECURITY:
- Fix for CVE-2007-5925: The convert_search_mode_to_innobase function in
- ha_innodb.cc in the InnoDB engine in MySQL 5.1.23-BK and earlier allows
- remote authenticated users to cause a denial of service (database crash)
- via a certain CONTAINS operation on an indexed column, which triggers an
- assertion error. (closes: #451235)
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Thu, 15 Nov 2007 18:40:11 +0100
-
-mysql-dfsg-5.0 (5.0.45-2) unstable; urgency=low
-
- * Package is now team-maintained. (closes: #421026)
-
- [ Sean Finney ]
- * New/updated debconf translations:
- - Spanish, from Javier Fernández-Sanguino Peña (closes: #426442).
- - German, from Alwin Meschede (closes: #426545).
- - Danish, from Claus Hindsgaul (closes: #426783).
- - French, from Christian Perrier (closes: #430944).
- * Add Recommends on libterm-readkey-perl for mysql-client-5.0 package, used
- by mysqlreport add-on to mask password entry (closes: #438375).
-
- [ Norbert Tretkowski ]
- * Add myself to uploaders.
- * Suggest usage of an update statement on the user table to change the mysql
- root user password instead using mysqladmin, to catch all root users from
- all hosts. (closes: #435744)
- * Remove informations about a crash in the server during flush-logs when
- having expire_logs_days enabled but log-bin not, this bug was fixed in
- 5.0.32 already. (closes: #368547)
- * Disable log_bin option in default config file and add a note to the NEWS
- file. (closes: #349661)
- * Fix FTBFS if build twice in a row. (closes: #442684)
- * Remove check for buggy options from init script.
- * Update innotop to 1.6.0 release.
- * Add mysqlreport and innotop to mysql-client description.
- * Use shorter server version string.
-
- -- Norbert Tretkowski <norbert@tretkowski.de> Wed, 14 Nov 2007 20:00:06 +0100
-
-mysql-dfsg-5.0 (5.0.45-1) unstable; urgency=low
-
- * New upstream release.
-
- [sean finney]
- * removed patches that are incorporated into the latest release:
- - 70_cpuid_on_i486.dpatch
- - 91_SECURITY_CVE-2007-2691_alter-drop
- * new patch 90_upstreamdebiandir.dpatch to keep a few lingering references
- to the upstream ./debian dir out of the build, at least until we find
- a nice way to collaborate on sharing the directory.
- * updated CRUFT list to fix double-build breakage (closes: #424590).
- * add conditional build-deps for linux-libc-dev to fix FTBFS for
- non-linux arch's (closes: #431018).
- * added notes to my.cnf and README.Debian about setting tmpdir when
- configuring a replication slave. thanks to Rudy Gevaert for pointing
- this out (closes: #431825).
-
- -- sean finney <seanius@debian.org> Tue, 17 Jul 2007 23:50:33 +0200
-
-mysql-dfsg-5.0 (5.0.41a-1) unstable; urgency=high
-
- [sean finney]
- * SECURITY:
- Fix for CVE-2007-2691: DROP/RENAME TABLE statements (closes: #424778).
- [Christian Hammers]
- * Removed all manpages from the source (therefore the "41a") as they
- are not licensed under the GPL and redistribution is not permitted
- (thanks to Mathias Gug). Closes: #430018
- * Added linux-libc-dev to the build-depends as else an illegal dependency to
- asm/atomic.h is generated in /usr/include/mysql/my_global.h. Closes: 424276
- [Christian Perrier]
- * Debconf templates and debian/control reviewed by the debian-l10n-
- english team as part of the Smith review project. Closes: #419974
- * Debconf translation updates:
- - French. Closes: #422187
- - Galician. Closes: #420118
- - Italian. Closes: #421349
- - Brazilian Portuguese. Closes: #421516
- - Arabic. Closes: #421751
- - Czech. Closes: #421766
- - Portuguese. Closes: #422428
-
- -- Christian Hammers <ch@debian.org> Sun, 24 Jun 2007 21:12:42 +0200
-
-mysql-dfsg-5.0 (5.0.41-2) unstable; urgency=low
-
- * the previous "translation changes" inadvertently introduced unrelated
- changes in the package control file.
-
- -- sean finney <seanius@debian.org> Sun, 13 May 2007 12:32:45 +0200
-
-mysql-dfsg-5.0 (5.0.41-1) unstable; urgency=low
-
- * New upstream release
- [sean finney]
- * Bump the priority of the debconf prompt for the root password to high, to
- ensure the question shows up in a default installation (closes: #418672).
- * Debconf templates and debian/control reviewed by the debian-l10n-
- english team as part of the Smith review project. Closes: #419974
- * Debconf translation updates:
- - French. Closes: #422187
- - Galician. Closes: #420118
- - Italian. Closes: #421349
- - Brazilian Portuguese. Closes: #421516
- - Arabic. Closes: #421751
- - Czech. Closes: #421766
- - Portuguese. Closes: #422428
- * massaged the local PATH_MAX patch.
- * removed temp sql parsing patch which has been incorporated upstream
- * upstream no longer includes the mysql_create_system_tables command,
- so removed our local patches for it.
- * the following issues may have been fixed in a previous version of
- mysql-server-5.0, but the exact version is not clear so they will be
- marked as fixed in this version.
- * lots of NDB-related fixes, including those related to problems with
- AUTO_INCREMENT (closes: #310878).
- * fix for "connections remaining in sleep state" (closes: #318011).
- * fix for "denies queries randomly" (closes: #399602).
- * problems indexing on char() binary fields were ISAM specific, which is
- no longer supported (closes: #326698).
- * fix for problems with "complicated joins" (closes: 348682).
- * fix for problems with "flushing logs, server crash" (closes: #348682).
- * fix for AUTO_INCREMENT and duplicate keys (closes: #416145).
- * fix for "DROP FUNCTIONS doesn't work" (closes: #290670).
-
- -- sean finney <seanius@debian.org> Sat, 12 May 2007 12:10:20 +0200
-
-mysql-dfsg-5.0 (5.0.38-3) unstable; urgency=low
-
- * Added innotop.
- * Changed maintainer email address to
- pkg-mysql-commits@lists.alioth.debian.org
-
- -- Christian Hammers <ch@debian.org> Thu, 19 Apr 2007 19:21:15 +0200
-
-mysql-dfsg-5.0 (5.0.38-2) unstable; urgency=high
-
- * SECURITY:
- In some previous versions mysql_install_db was not idempotent and did
- always create passwordless root accounts although it should only on
- initial installs (thanks to Olaf van der Spek). Closes: #418672
- * Added check for passwordless root accounts to debian-start.
- * As MySQL-5.0 is, at least currently, incompatible with Kernel 2.4 the
- installation is aborted for such old kernels. Debian Etch does not support
- them anyway according to the release notes but this might be unexpected
- and many production servers still have self build ones installed (thanks
- to Marc-Christian Petersen). See: #416841
- * Adjusted TeX build-deps to texlive.
-
- -- Christian Hammers <ch@debian.org> Tue, 17 Apr 2007 01:00:41 +0200
-
-mysql-dfsg-5.0 (5.0.38-1) unstable; urgency=low
-
- * New upstream release.
- * Activated the blackhole engine as it's needed for replicating partition
- designs (thanks to Cyril SCETBON).
- * Fixed segfault on i486 systems without cpuid instruction (thanks to
- Lennart Sorensen). Closes: #410474
- * Only use of the non-essential debconf package in postrm if it is still
- installed (thanks to Michael Ablassmeier). Closes: #416838
-
- -- Christian Hammers <ch@debian.org> Thu, 5 Apr 2007 22:43:41 +0200
-
-mysql-dfsg-5.0 (5.0.36-1) unstable; urgency=low
-
- * New upstream release.
- Closes: #400460, #408159, #408533
-
- -- Christian Hammers <ch@debian.org> Thu, 22 Mar 2007 22:16:31 +0100
-
-mysql-dfsg-5.0 (5.0.32-10) unstable; urgency=high
-
- * Really fixed FTBFS on Sparc introduced with the "make -j" trick in
- 5.0.32-8 (thanks to Frank Lichtenheld). Closes: #415026
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Mar 2007 20:52:33 +0100
-
-mysql-dfsg-5.0 (5.0.32-9) unstable; urgency=high
-
- * Fixed FTBFS on Sparc introduced with the "make -j" trick in 5.0.32-8
- (thanks to Frank Lichtenheld). Closes: #415026
-
- -- Christian Hammers <ch@debian.org> Tue, 15 Mar 2007 18:55:42 +0100
-
-mysql-dfsg-5.0 (5.0.32-8) unstable; urgency=high
-
- [Sean Finney]
- * SECURITY:
- - CVE-2007-1420: Single Row Subselect DoS. Specially crafted subselect
- queries could crash the mysql server. Patch backported from upstream
- changeset 19685 (46_CVE-2007-1420_subselect_dos.dpatch)
- closes: #414790.
- [Christian Hammers]
- * Adapt MAKE_J to use the -j option with the number of available processors.
- (thanks to Raphael Pinson).
- * Updated mysqlreport to latest upstream (and patched --help usage message
- and "return if qcache_size==0").
-
- -- sean finney <seanius@debian.org> Wed, 14 Mar 2007 20:19:08 +0100
-
-mysql-dfsg-5.0 (5.0.32-7) unstable; urgency=low
-
- * Updated French Debconf translation (thanks to Christian Perrier).
- Closes: #411330
- * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
- Closes: #411328
- * Updated Portuguese Debconf translation (thanks to "Traduz").
- Closes: #411339
- * Updated Czech Debconf translation (thanks to Miroslav Kure).
- Closes: #411341
- * Added Norwegian Debconf translation (thanks to Bjorn Steensrud).
- Closes: #411345
- * Updated Spanish Debconf translation (thanks to Javier Fernandez-Sanguino
- Pena). Closes: #411347
- * Updated Japanese Debconf translation (thanks to Hideki Yamane).
- Closes: #411368
- * Updated Swedish Debconf translation (thanks to Andreas Henriksson).
- Closes: #411370
- * Updated Italian Debconf translation (thanks to Luca Monducci).
- Closes: #411377
- * Updated Galician Debconf translation (thanks to Jacobo Tarrio).
- Closes: #411379
- * Updated Russian Debconf translation (thanks to Yuriy Talakan).
- Closes: #411442
- * Updated Basque Debconf translation (thanks to Piarres Beobide).
- Closes: #411457
- * Updated German Debconf translation (thanks to Alwin Meschede).
- Closes: #411480
- * Updated Dutch Debconf translation (thanks to Thijs Kinkhorst).
- * Updated Brazilian Portuguese translation (thanks to Andre Luis Lopes).
- Closes: #411536
- * Updated Romanian Debconf translation (thanks to Stan Ioan-Eugen).
- Closes: #411764
-
- -- Christian Hammers <ch@debian.org> Fri, 16 Feb 2007 23:20:42 +0100
-
-mysql-dfsg-5.0 (5.0.32-6) unstable; urgency=low
-
- * Changed wording in Debconf templates to better fit to the graphical
- interface (thanks to Frank Kuester). Closes: #411165
- * Lintian suggested style changes to some other Debconf questions.
- * Removed accidently stdout output from init script.
-
- -- Christian Hammers <ch@debian.org> Fri, 16 Feb 2007 20:29:18 +0100
-
-mysql-dfsg-5.0 (5.0.32-5) unstable; urgency=medium
-
- * Backported upstream patch for a bug that crashed the server when using
- certain join/group/limit combinations.
- Users of the Joomla CMS seemed to be affected by this. Closes: #403721
- * The debian-start script that runs on every server start now first upgrades
- the system tables (if neccessary) and then check them as it sometimes did
- not work the other way around (e.g. for MediaWiki). The script now uses
- mysql_update instead of mysql_update_script as recommended. Closes: 409780
- * Remove the Debconf generated config file in postrm.
-
- -- Christian Hammers <ch@debian.org> Thu, 15 Feb 2007 04:47:04 +0100
-
-mysql-dfsg-5.0 (5.0.32-4) unstable; urgency=high
-
- [Christian Hammers]
- * Changed minimum required version in dh_makeshlibs to 5.0.27-1 as
- 5.0.26 had an ABI breakage in it!
- This is the cause for Perl programs crashing with the following error:
- "Transactions not supported by database at /usr/lib/perl5/DBI.pm line 672"
- * The old_passwords setting that is set according to a Debconf question is
- now written to /etc/mysql/conf.d/old_passwords.cnf instead directly to the
- conffile /etc/mysql/my.cnf which would be fobidden by policy (thanks to
- Robert Bihlmeyer). Closes: #409750
- * Added some more comments to the default my.cnf.
- [Monty Taylor]
- * Added bison to build dependencies.
- * Added a "start-initial" option to the Data Node init script to support
- initial node starts.
- * Changed NDB Data and Management node startup seqence. Prevented both from
- restarting on upgrade to address rolling upgrade issues.
- * Updated build-depends to depend on automake1.9 instead of automake1.8
- to match what upstream uses.
-
- -- Christian Hammers <ch@debian.org> Wed, 31 Jan 2007 01:14:09 +0100
-
-mysql-dfsg-5.0 (5.0.32-3) unstable; urgency=high
-
- * mysql-server-5.0 pre-depends on adduser now and has --disabled-login
- explicitly added to be on the safe side (thanks to the puiparts team).
- Closes: #408362
- * Corrections the terminology regarding NDB in the comments of all config
- files and init scripts (thanks to Geert Vanderkelen of MySQL).
- * Updated Swedish Debconf translation (thanks to Andreas Henriksson).
- Closes: #407859
- * Updated Czech Debconf translation (thanks to Miroslav Kure).
- Closes: #407809
-
- -- Christian Hammers <ch@debian.org> Thu, 11 Jan 2007 11:18:47 +0100
-
-mysql-dfsg-5.0 (5.0.32-2) unstable; urgency=high
-
- * The last upload suffered from a regression that made NDB totally
- unusable and caused a dependency to libmysqlclient15-dev in the
- mysql-server-5.0 package. The relevant 85_* patch was re-added again.
- Closes: #406435
- * Added lintian-overrides for an error that does not affect our packages.
- There are now only warnings and not errors left.
-
- -- Christian Hammers <ch@debian.org> Tue, 9 Jan 2007 23:55:10 +0100
-
-mysql-dfsg-5.0 (5.0.32-1) unstable; urgency=high
-
- * New upstream version.
- * SECURITY: mysql_fix_privilege_tables.sql altered the
- table_privs.table_priv column to contain too few privileges, causing
- loss of the CREATE VIEW and SHOW VIEW privileges. (MySQL Bug#20589)
- * SECURITY (DoS): ALTER TABLE statements that performed both RENAME TO
- and {ENABLE|DISABLE} KEYS operations caused a server crash. (MySQL
- Bug#24089)
- * SECURITY (DoS): LAST_DAY('0000-00-00') could cause a server crash.
- (MySQL Bug#23653)
- * SECURITY (DoS): Using EXPLAIN caused a server crash for queries that
- selected from INFORMATION_SCHEMA in a subquery in the FROM clause.
- (MySQL Bug#22413)
- * SECURITY (DoS): Invalidating the query cache (e.g. when using stored procedures)
- caused a server crash for INSERT INTO ... SELECT statements that
- selected from a view. (MySQL Bug#20045)
- * Using mysql_upgrade with a password crashed the server. Closes: #406229
- * yaSSL crashed on pre-Pentium Intel and Cyrix CPUs. (MySQL Bug#21765)
- Closes: #383759
- * Lots of small fixes to the NDB cluster storage engine.
- * Updated Japanese Debconf template (thanks to Hideki Yamane).
- Closes: #405793
- * Fixed comment regarding "mycheck" in debian-start (thanks to
- Enrico Zini). Closes: #405787
-
- -- Christian Hammers <ch@debian.org> Sat, 6 Jan 2007 14:26:20 +0100
-
-mysql-dfsg-5.0 (5.0.30-3) unstable; urgency=low
-
- * Updated Brazilian Debconf translation (thanks to Andre Luis Lopes).
- Closes: #403821
- * Added Romanian Debconf translation (thanks to Stan Ioan-Eugen).
- Closes: #403943
- * Updated Spanish Debconf translation (thanks to Javier Fernandez-Sanguino
- Pena). Closes: #404084
- * Updated Galician Debconf translation (thanks to Jacobo Tarrio).
- Closes: #404318
- * Updated Dutch Debconf translation (thanks to Vincent Zweije).
- Closes: #404566
- * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
- Closes: #405018
-
- -- Christian Hammers <ch@debian.org> Thu, 21 Dec 2006 21:35:09 +0100
-
-mysql-dfsg-5.0 (5.0.30-2) unstable; urgency=high
-
- * Fixed upstream regression in header files that lead to FTBFS for
- mysql-admin, mysql-query-browser and probably other pacakges.
- (thanks to Andreas Henriksson). Closes: #403081, #403082
- * Fixed some upstream scripts by replacing /etc by /etc/mysql (thanks to
- Julien Antony). Closes: #401083
- * Updated French Debconf translation (thanks to Christian Perrier).
- Closes: #401434
- * Added Spanish Debconf translation (thanks to Javier Fernandez-Sanguino
- Pena). Closes: #401953
- * Marked a Debconf question that is just a dummy and only internally
- used as not-needing-translation. Closes: #403163
- * Fixed mysqlslowdump patch to not remove the usage() function (thanks
- to Monty Tailor).
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Dec 2006 19:20:10 +0100
-
-mysql-dfsg-5.0 (5.0.30-1) unstable; urgency=low
-
- * New upstream version (switch to the MySQL Enterprise branch).
- * Upstream bugfix for the Innodb performance bug:
- "Very poor performance with multiple queries running
- concurrently (Bug#15815)".
- * Upstream bugfix for a possible server crash:
- "Selecting from a MERGE table could result in a server crash if the
- underlying tables had fewer indexes than the MERGE table itself
- (Bug#22937)"
- * Upstream bugfies for *lot* of NDB problems.
- * Upstream bugfix for Innodb optimizer bug. Closes: #397597
- * Updated Italian Debconf translation (thanks to Luca Monducci).
- Closes: #401305
- * Updated debian/watch file to MySQL Enterprise branch.
-
- -- Christian Hammers <ch@debian.org> Sat, 2 Dec 2006 16:36:38 +0100
-
-mysql-dfsg-5.0 (5.0.27-2) unstable; urgency=medium
-
- * Disabled YaSSL x86 assembler as it was reported to crash applications
- like pam-mysql or proftpd-mysql which are linked against libmysqlclient
- on i486 and Cyrix (i586) CPUs. Closes: #385147
- * Adjusted mysql-server-4.1 priority to extra and section to oldlibs
- according to the ftp masters overrides.
- * Updated German Debconf translation (thanks to Alwin Meschede).
- Closes: #400809
-
- -- Christian Hammers <ch@debian.org> Wed, 22 Nov 2006 13:36:31 +0100
-
-mysql-dfsg-5.0 (5.0.27-1) unstable; urgency=medium
-
- * New upstream version (but no codechange, the only difference to 5.0.26
- was a patch to the ABI change which Debian already included.
- * When dist-upgrading from mysql-server-4.1/sarge dpkg does not longer
- ask unnecessary "config file has changed" questions regarding
- /etc/init.d/mysql, /etc/logrotate.d/mysql-server and
- /etc/mysql/debian-start just because these files previously belonged
- to mysql-server-4.1 and not to mysql-server-5.0.
- To archive this mysql-server-5.0 now pre-depends on mysql-common which
- provides current versions of those files.
- * The automatic run mysql_upgrade now works with non-standard datadir
- settings, too (thanks to Benjami Villoslada). Closes: #394607
- * Debconf now asks if the old_passwords option is really needed.
- * Improved explanations of the old_passwords variable in my.cnf.
- * Removed possibly leftover cron script from MySQL-4.1 (thanks to
- Mario Oyorzabal Salgado). Closes: #390889
- * Postrm ignores failed "userdel mysql".
- * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
- Closes: #398784
- * Added Euskarian Debconf translation (thanks to Piarres Beobide).
- Closes: #399045
- * Updated Japanese Debconf translation (thanks to Hideki Yamane).
- Closes: #399074
- * Updated German Debconf translation (thanks to Alwin Meschede).
- Closes: #399087
- * New Portuguese debconf translations from Miguel Figueiredo.
- Closes: #398186
-
- -- Christian Hammers <ch@debian.org> Tue, 7 Nov 2006 21:26:25 +0100
-
-mysql-dfsg-5.0 (5.0.26-3) unstable; urgency=high
-
- [sean finney]
- * Fix for the deadly ISAM trap. Now during upgrades we will do our
- very best to convert pre-existing ISAM format tables using the
- binaries from the previous package. Success is not guaranteed, but
- this is probably as good as it gets. Note that this also necessitates
- re-introducing an (empty transitional) mysql-server-4.1 package.
- Closes: #354544, #354850
- * Remove a couple spurious and wrongly placed WARNING statements from
- 45_warn-CLI-passwords.dpatch. thanks to Dan Jacobsen for pointing these
- out. Closes: #394262
-
- -- sean finney <seanius@debian.org> Fri, 03 Nov 2006 18:34:46 +0100
-
-mysql-dfsg-5.0 (5.0.26-2) unstable; urgency=high
-
- * Fixed FTBFS for Alpha by applying an upstream patch (thanks to Falk
- Hueffner). Closes: #395921
-
- -- Christian Hammers <ch@debian.org> Sat, 28 Oct 2006 20:13:46 +0200
-
-mysql-dfsg-5.0 (5.0.26-1) unstable; urgency=high
-
- * SECURITY:
- This combined release of 5.0.25 and 5.0.26 fixes lot of possible server
- crashs so it should get into Etch. Quoting the changelog (bug numbers are
- bugs.mysql.com ones):
- - character_set_results can be NULL to signify no conversion, but some
- code did not check for NULL, resulting in a server crash. (Bug#21913)
- - Using cursors with READ COMMITTED isolation level could cause InnoDB to
- crash. (Bug#19834)
- - Some prepared statements caused a server crash when executed a second
- time. (Bug#21166)
- - When DROP DATABASE or SHOW OPEN TABLES was issued while concurrently
- issuing DROP TABLE (or RENAME TABLE, CREATE TABLE LIKE or any other
- statement that required a name lock) in another connection, the server
- crashed. (Bug#21216)
- - Use of zero-length variable names caused a server crash. (Bug#20908)
- - For InnoDB tables, the server could crash when executing NOT IN ()
- subqueries. (Bug#21077)
- - Repeated DROP TABLE statements in a stored procedure could sometimes
- cause the server to crash. (Bug#19399)
- - Performing an INSERT on a view that was defined using a SELECT that
- specified a collation and a column alias caused the server to crash
- (Bug#21086).
- - A query of the form shown here caused the server to crash. (Bug#21007)
- - NDB Cluster: Some queries involving joins on very large NDB tables could
- crash the MySQL server. (Bug#21059)
- - The character set was not being properly initialized for CAST() with a
- type like CHAR(2) BINARY, which resulted in incorrect results or even a
- server crash. (Bug#17903)
- - For certain queries, the server incorrectly resolved a reference to an
- aggregate function and crashed. (Bug#20868)
- - The server crashed when using the range access method to execut a
- subquery with a ORDER BY DESC clause. (Bug#20869)
- - Triggers on tables in the mysql database caused a server crash. Triggers
- for tables in this database now are disallowed. (Bug#18361)
- - Using SELECT on a corrupt MyISAM table using the dynamic record format
- could cause a server crash. (Bug#19835)
- - Use of MIN() or MAX() with GROUP BY on a ucs2 column could cause a
- server crash. (Bug#20076)
- - Selecting from a MERGE table could result in a server crash if the
- underlying tables had fewer indexes than the MERGE table itself.
- (Bug#21617, Bug#22937)
-
- * New upstream release.
- - This bug would cause trouble for Sarge->Etch upgrades, it was supposed to
- have been fixed in 5.0.16 but that apparently did not fix the whole
- problem:
- Using tables from MySQL 4.x in MySQL 5.x, in particular those with VARCHAR
- fields and using INSERT DELAYED to update data in the table would result in
- either data corruption or a server crash. (Bug#16611, Bug#16218, Bug#17294)
- Closes: #386337
- - Fixes data corruption as an automatic client reconnect used to set
- the wrong character set. Closes: #365050
- - Fixes an undefined ulong type in an include file. Closes: #389102
- - Fixes wrong output format when using Unicode characters. Closes: #355302
- - Fixes mysql_upgrade when using a password. Closes: #371841
-
- [Christian Hammers]
- * Removed --sysconfdir from debian/rules as it puts /etc/mysql/ at the
- end of the my.cnf search patch thus overriding $HOME/my.cnf
- (thanks to Christoph Biedl). Closes: #394992
- * The provided patch from bug #385947 was wrong, the variable is called
- BLOCKSIZE not BLOCK_SIZE according to "strings `which df`" (thanks to
- Bruno Muller). Closes: #385947
-
- [sean finney]
- * new dutch debconf translations from Vincent Zweije (closes: #392809).
- * new japanese debconf translations from Hideki Yamane (closes: #391625).
- * new italian debconf translations from Luca Monducci (closes: #391741).
- * new french debconf translations from Christian Perrier (closes: #393334).
- * ran debconf-updatepo to merge the fuzzies into svn.
- * massage the following patches so they continue to apply cleanly:
- - 44_scripts__mysql_config__libs.dpatch to cleanly apply.
- - 45_warn-CLI-passwords.dpatch
- - 96_TEMP__libmysqlclient_ssl_symbols.dpatch (note, this patch might
- no longer be needed, but is retained "just in case" after massaging it)
- * the following patches have been incorporated upstream:
- - 70_kfreebsd.dpatch
- - 80_hurd_mach.dpatch
- - 87_ps_Hurd.dpatch
- - 90_TEMP__client__mysql_upgrade__O_EXEC.dpatch
- - 91_TEMP__client__mysql_upgrade__password.dpatch
- - 92_TEMP__client__mysql_upgrade__defaultgroups.dpatch
- - 94_TEMP__CVE-2006-4227.dpatch
- - 95_TEMP__CVE-2006-4226.dpatch
- * the udf_example.cc has disappeared from the source code, but there's
- a udf_example.c which seems to be a good example to use instead :)
- * update documentation in the configuration to no longer reference
- using my.cnf in the DATADIR, as it's never been the recommended
- method for debian systems and hasn't worked since 5.0 was released
- anyway (closes: #393868).
-
- -- Christian Hammers <ch@debian.org> Wed, 25 Oct 2006 19:54:04 +0200
-
-mysql-dfsg-5.0 (5.0.24a-9) unstable; urgency=medium
-
- * Having expire_logs_days enabled but log-bin not crashes the server. Using
- both or none of those options is safe. To prevent this happening during the
- nightly log rotation via /etc/logrotate.d/mysql the initscript checks for
- malicious combination of options. See: #368547
- * The Sarge package "mysql-server" which used to include the mysqld daemon
- may still be in unselected-configured state (i.e. after a remove but not
- purge) in which case its now obsolete cronscript has to be moved away
- (thanks to Charles Lepple). Closes: #385669
- * Updated Danish Debconf translation (thanks to Claus Hindsgaul).
- Closes: #390315
- * Updated Frensh Debconf translation (thanks to Christian Perrier).
- Closes: #390980
-
- -- Christian Hammers <ch@debian.org> Tue, 3 Oct 2006 14:55:31 +0200
-
-mysql-dfsg-5.0 (5.0.24a-8) unstable; urgency=low
-
- * (broken upload)
-
- -- Christian Hammers <ch@debian.org> Tue, 3 Oct 2006 14:55:31 +0200
-
-mysql-dfsg-5.0 (5.0.24a-7) unstable; urgency=low
-
- * Stopped mysql_config from announcing unnecessary library dependencies
- which until now cause "NEEDED" dependencies in the "readelf -d" output
- of libraries who only depend on libmysqlclient.so (thanks to Michal
- Cihar). Closes: #390692
-
- -- Christian Hammers <ch@debian.org> Sun, 1 Oct 2006 23:59:43 +0200
-
-mysql-dfsg-5.0 (5.0.24a-6) unstable; urgency=low
-
- [sean finney]
- * finally add support for setting a root password at install.
- while this is not a random password as requested in one bug
- report, we believe it is the best solution and provides a
- means to set a random password via preseeding if it's really
- desired (Closes: #316127, #298295).
-
- -- sean finney <seanius@debian.org> Sun, 01 Oct 2006 23:34:30 +0200
-
-mysql-dfsg-5.0 (5.0.24a-5) unstable; urgency=low
-
- * Added ${shlibs:Depends} to debian/control section libmysqlclient-dev as it
- contains the experimental /usr/lib/mysql/libndbclient.so.0.0.0.
- * Bumped standards version to 3.7.2.
- * Added LSB info section to init scripts.
- * Rephrased Debconf templates as suggested by lintian.
- * Added benchmark suite in /usr/share/mysql/sql-bench/.
- * The mysql.timezone* tables are now filled by the postinst script (thanks
- to Mark Sheppard). Closes: #388491
- * Moved Debconf install notes to README.Debian. Displaying them with
- medium priority was a bug anyway. Closes: #388941
- * Replaced /usr/bin/mysql_upgrade by /usr/bin/mysql_upgrade_shell in
- /etc/mysql/debian-start.sh as it works without errors (thanks to Javier
- Kohen). Closes: #389443
-
- -- Christian Hammers <ch@debian.org> Wed, 20 Sep 2006 15:01:42 +0200
-
-mysql-dfsg-5.0 (5.0.24a-4) unstable; urgency=high
-
- * libmysqlclient.so.15 from 5.0.24 accidentaly exports some symbols that are
- historically exported by OpenSSL's libcrypto.so. This bug was supposed to
- be fixed in 5.0.24a bug according to the mysql bug tracking system will
- only be fixed in 5.0.25 so I backported the patch. People already reported
- crashing apps due to this (thanks to Duncan Simpson). See also: #385348
- Closes: #388262
- * Fixed BLOCKSIZE to BLOCK_SIZE in initscript (thanks to Bruno Muller).
- Closes: #385947
- * Added hint to "--extended-insert=0" to mysqldump manpage (thanks to Martin
- Schulze).
- * Documented the meaning of "NDB" in README.Debian (thanks to Dan Jacobson).
- Closes: #386274
- * Added patch to build on hurd-i386 (thanks to Cyril Brulebois). Closes: #387369
- * Fixed debian-start script to work together with the recend LSB modifications in
- the initscript (thanks to wens). Closes: #387481
- * Reverted tmpdir change in my.cnf back to /tmp to comply with FHS (thanks
- to Alessandro Valente). Closes: #382778
- * Added logcheck filter rule (thanks to Paul Wise). Closes: #381043
- * I will definetly not disable InnoDB but added a note to the default my.cnf
- that disabling it saves about 100MB virtual memory (thanks to Olivier
- Berger). Closes: #384399
- * Added thread_cache_size=8 to default my.cnf as this variable seems to have
- a negligible memory footprint but can improve performance when lots of
- threads connect simultaneously as often seen on web servers.
-
- -- Christian Hammers <ch@debian.org> Mon, 4 Sep 2006 00:21:50 +0200
-
-mysql-dfsg-5.0 (5.0.24a-3) unstable; urgency=low
-
- * Fixed potential tempfile problem in the newly added mysqlreport script.
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Sep 2006 23:17:24 +0200
-
-mysql-dfsg-5.0 (5.0.24a-2) unstable; urgency=low
-
- * Added "mysqlreport" (GPL'ed) from hackmysql.com.
- * Temporarily disabled expire_days option as it causes the server
- to crash. See #368547
- * Made output of init scripts LSB compliant (thanks to David Haerdeman).
- Closes: #385874
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Sep 2006 19:06:53 +0200
-
-mysql-dfsg-5.0 (5.0.24a-1) unstable; urgency=high
-
- * New upstream version.
- * The shared library in the 5.0.24 upstream release accidently exported
- some symbols that are also exported by the OpenSSL libraries (notably
- BN_bin2bn) causing unexpected behaviour in applications using these
- functions (thanks to Peter Cernak). Closes: #385348
- * Added note about possible crash on certain i486 clone CPUs.
- * Made recipient address of startup mysqlcheck output configurable
- (thanks to Mattias Guns). Closes: #385119
-
- -- Christian Hammers <ch@debian.org> Mon, 28 Aug 2006 01:22:12 +0200
-
-mysql-dfsg-5.0 (5.0.24-3) unstable; urgency=high
-
- * SECURITY:
- CVE-2006-4226:
- When run on case-sensitive filesystems, MySQL allows remote
- authenticated users to create or access a database when the database
- name differs only in case from a database for which they have
- permissions.
- CVE-2006-4227:
- MySQL evaluates arguments of suid routines in the security context of
- the routine's definer instead of the routine's caller, which allows
- remote authenticated users to gain privileges through a routine that
- has been made available using GRANT EXECUTE.
- Thanks to Stefan Fritsch for reporting. Closes: #384798
-
- -- Christian Hammers <ch@debian.org> Sat, 26 Aug 2006 04:55:17 +0200
-
-mysql-dfsg-5.0 (5.0.24-2) unstable; urgency=high
-
- * 5.0.24-1 introduced an ABI incompatibility, which this patch reverts.
- Programs compiled against 5.0.24-1 are not compatible with any other
- version and needs a rebuild.
- This bug already caused a lot of segfaults and crashes in various
- programs. Thanks to Chad MILLER from MySQL for quickly providing a patch.
- The shlibdeps version has been increased to 5.0.24-2.
- Closes: #384047, #384221, #383700
-
- -- Christian Hammers <ch@debian.org> Fri, 25 Aug 2006 21:47:35 +0200
-
-mysql-dfsg-5.0 (5.0.24-1) unstable; urgency=high
-
- * SECURITY: Upstream fixes a security bug which allows a user to continue
- accessing a table using a MERGE TABLE after the right to direct access to
- the database has been revoked (CVE-2006-4031, MySQL bug #15195).
- (Well they did not exactly fixed it, they documented the behaviour and
- allow the admin to disable merge table alltogether...). Closes: #380271
- * SECURITY: Applied patch that fixes a possibly insecure filehandling
- in the recently added mysql_upgrade binary file (MySQL bug #10320).
- * New upstream version.
- - Fixes nasty MySQL bug #19618 that leads to crashes when using
- "SELECT ... WHERE ... not in (1, -1)" (e.g. vbulletin was affected).
- - Fixes upstream bug #16803 so that linking ~/.mysql_history to /dev/null
- now has the desired effect of having no history.
- * Really fixed the runlevels. Closes: #377651
- * Added patch for broken upstream handling of "host=" to mysql_upgrade.c.
- * Adjusted /etc/mysql/debian-start to new mysql_upgrade.c
-
- -- Christian Hammers <ch@debian.org> Tue, 8 Aug 2006 00:44:13 +0200
-
-mysql-dfsg-5.0 (5.0.22-5) unstable; urgency=low
-
- * Added further line to the logcheck ignore files (thanks to Paul Wise).
- Closes: #381038
-
- -- Christian Hammers <ch@debian.org> Wed, 2 Aug 2006 00:28:50 +0200
-
-mysql-dfsg-5.0 (5.0.22-4) unstable; urgency=low
-
- * Upstream fixes a bug in the (never released) version 5.0.23 which could
- maybe used to crash the server if the mysqlmanager daemon is in use
- which is not yet the default in Debian. (CVE-2006-3486 *DISPUTED*)
- * Changed runlevel priority of mysqld from 20 to 19 so that it gets started
- before apache and proftpd etc. which might depend on an already running
- database server (thanks to Martin Gruner). Closes: #377651
- * Added patch which sets PATH_MAX in ndb (thanks to Cyril Brulebois).
- Closes: #378949
- * Activated YaSSL as licence issues are settled according to:
- http://bugs.mysql.com/?id=16755. This also closes the FTBFS bug
- regarding OpenSSL as it is discouraged to use now. Closes: #368639
- * Removed SSL-MINI-HOWTO as the official documentation is good enough now.
- * mysql_upgrade no longer gives --password on the commandline which would
- be insecure (thanks to Dean Gaudet). Closes: #379199
- * Adjusted debian/patches/45* to make consecutive builds in the same source
- tree possible (thanks to Bob Tanner). Closes: #368661
- * mysql-server-5.0 is now suggesting tinyca as yaSSL is enabled and tinyca
- was found to be really cool :)
- * Moved tempdir from /tmp to /var/tmp as it will more likely have enough
- free space as /tmp is often on the root partition and /var or at least
- /var/tmp is on a bigger one.
-
- -- Christian Hammers <ch@debian.org> Mon, 10 Jul 2006 23:30:26 +0200
-
-mysql-dfsg-5.0 (5.0.22-3) unstable; urgency=low
-
- * Added patch for MySQL bug #19618: "select x from x
- where x not in(1,-1)" may crash the server" (thanks to
- Ruben Puettmann).
-
- -- Christian Hammers <ch@debian.org> Fri, 9 Jun 2006 01:41:44 +0200
-
-mysql-dfsg-5.0 (5.0.22-2) unstable; urgency=high
-
- * Fixed debian-sys-maint related bug in postinst (thanks to
- Jean-Christophe Dubacq). Closes: #369970
- * The last upload was a security patch (which I did not know as I
- uploaded before the announcement came). I now added the CVE id for
- reference and set urgency to high as the last entry did not.
-
- -- Christian Hammers <ch@debian.org> Wed, 31 May 2006 01:04:11 +0200
-
-mysql-dfsg-5.0 (5.0.22-1) unstable; urgency=low
-
- * SECURITY: This upstream release fixes an SQL-injection with multibyte
- encoding problem. (CVE-2006-2753)
- * New upstream release.
- * Upstream fixes REPAIR TABLE problem. Closes: #354300
- * Upstream fixes problem that empty strings in varchar and text columns
- are displayed as NULL. Closes: #368663
-
- -- Christian Hammers <ch@debian.org> Tue, 30 May 2006 23:43:24 +0200
-
-mysql-dfsg-5.0 (5.0.21-4) unstable; urgency=low
-
- * Added "BLOCKSIZE=" to the diskfree check (thanks to Farzad FARID).
- Closes: #367027, #367083
- * Further fixed mysql_upgrade upstream script (thanks to Andreas Pakulat)
- Closes: #366155
- * Adjusted the /proc test in debian/rules from /proc/1 to /proc/self
- to make building on grsec systems possible (thanks to K. Rosenegger).
- Closes: #366824
- * Updated Russion Debconf translation (thanks to Yuriy Talakan).
- Closes: #367141
- * Updated Czech Debconf translation (thanks to Kiroslav Kure).
- Closes: #367160
- * Updated Galician Debconf translation (thanks to Jacobo Tarrio).
- Closes: #367384
- * Updated Swedish Debconf translation (thanks to Daniel Nylander).
- Closes: #368186
-
- -- Christian Hammers <ch@debian.org> Wed, 10 May 2006 08:45:42 +0200
-
-mysql-dfsg-5.0 (5.0.21-3) unstable; urgency=low
-
- * Fixed FTBFS problem which was caused by a patch that modifies Makefile.am
- as well as Makefile.in and was not deteced because my desktop was fast
- enough to patch both files within the same second and so fooled automake.
- (thanks to Blars Blarson for notifying me). Closes: #366534
-
- -- Christian Hammers <ch@debian.org> Sat, 6 May 2006 19:03:58 +0200
-
-mysql-dfsg-5.0 (5.0.21-2) unstable; urgency=low
-
- * Fixed bug in postinst that did not correctly rewrite
- /etc/mysql/debian.cnf (thanks to Daniel Leidert).
- Closes: #365433, #366155
-
- -- Christian Hammers <ch@debian.org> Thu, 4 May 2006 02:37:03 +0200
-
-mysql-dfsg-5.0 (5.0.21-1) unstable; urgency=high
-
- * SECURITY: New upstream release with some security relevant bugfixes:
- * "Buffer over-read in check_connection with usernames lacking a
- trailing null byte" (CVE-2006-1516)
- * "Anonymous Login Handshake - Information Leakage" (CVE-2006-1517)
- * "COM_TABLE_DUMP Information Leakage and Arbitrary command execution"
- (CVE-2006-1518)
- Closes: #365938, #365939
- * Added diskfree check to the init script (thanks to Tim Baverstock).
- Closes: #365460
- * First amd64 upload!
-
- -- Christian Hammers <ch@debian.org> Sat, 29 Apr 2006 04:31:27 +0200
-
-mysql-dfsg-5.0 (5.0.20a-2) unstable; urgency=low
-
- * The new mysql-upgrade which is started from /etc/mysql/debian-start
- does now use the debian-sys-maint user for authentication (thanks to
- Philipp). Closes: #364991
- * Wrote patch debian/patches/43* which adds a password option to
- mysql_update. See MySQL bug #19400.
- * Added "Provides: libmysqlclient-dev" to libmysqlclient15-dev as I saw no
- obvious reasons against it (problems should be documented in
- debian/README.Maintainer!) (thanks to Olaf van der Spek). Closes: #364899
- * Updated Netherlands debconf translation (thanks to Vincent Zweije)
- Closes: #364464
- * Updated French debconf translation (thanks to Christian Perrier)
- Closes: #364401
- * Updated Danish debconf translation (thanks to Claus Hindsgaul)
- Closes: #365135
-
- -- Christian Hammers <ch@debian.org> Wed, 26 Apr 2006 01:14:53 +0200
-
-mysql-dfsg-5.0 (5.0.20a-1) unstable; urgency=low
-
- * New upstream release.
- * Added the new mysql_upgrade script and added it to
- /etc/mysql/debian-start (thanks to Alessandro Polverini).
- The script is currently very noise that is a known bug and will be
- fixed in the next release!
- Closes: #363458
- * No longer creates the "test" database. This actuallay had been tried
- to archive before (at least patches) exists but apparently was not the
- case in the last versions (thanks to Olaf van der Spek). Closes: #362126
- * Reformatted libmysqlclient15off.NEWS.Debian to changelog format
- (thanks to Peter Palfrader). Closes: #363062
-
- -- Christian Hammers <ch@debian.org> Sat, 15 Apr 2006 13:05:22 +0200
-
-mysql-dfsg-5.0 (5.0.20-1) unstable; urgency=high
-
- * Upstream contains a fix for a nasty bug (MySQL#18153) that users
- already experienced and that caused corrupted triggers after
- REPAIR/OPTIMIZE/ALTER TABLE statements.
- (thanks to Jerome Despatis for pointing out)
- * Added patch for the "updates on multiple tables is buggy after
- upgrading from 4.1 to 5.0" problem which MySQL has been committed
- for the upcoming 5.0.21 release. Closes #352704
- * Added Netherlands debconf translation (thanks to Vincent Zweije).
- Closes: #360443
- * Added Galician debconf translation (thanks to Jacobo Tarrio).
- Closes: #361257
-
- -- Christian Hammers <ch@debian.org> Fri, 7 Apr 2006 00:00:43 +0200
-
-mysql-dfsg-5.0 (5.0.19-3) unstable; urgency=high
-
- [ Christian Hammers ]
- * Fixed libmysqlclient15.README.Debian regarding package name changes
- (thanks to Leppo).
- * Moved libheap.a etc. back to /usr/lib/mysql/ as their names are just
- too generic. Closes: #353924
- [ Sean Finney ]
- * updated danish debconf translation, thanks to Claus Hindsgaul
- (closes: #357424).
- [ Adam Conrad ]
- * Send stderr from 'find' in preinst to /dev/null to tidy up chatter.
- * Backport patch for CVE-2006-0903 from the upcoming release to resolve
- a log bypass vulnerability when using non-binary logs (closes: #359701)
-
- -- Adam Conrad <adconrad@0c3.net> Tue, 4 Apr 2006 15:23:18 +1000
-
-mysql-dfsg-5.0 (5.0.19-2) unstable; urgency=medium
-
- * New upstream release.
- * Renamed package libmysqlclient15 to libmysqlclient15off due to
- binary incompatible changes.
- See /usr/share/doc/libmysqlclient15off/README.Debian
- * Updated Czech debconf translation (thanks to Miroslav Kure).
- Closes: #356503
- * Updated French debconf translation (thanks to Christian Perrier).
- Closes: #356332
- * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702
- * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian
- file is (thanks to Ross Boylan). Closes: #355978
-
- -- Christian Hammers <ch@debian.org> Fri, 17 Mar 2006 02:32:19 +0100
-
-mysql-dfsg-5.0 (5.0.19-1) experimental; urgency=medium
-
- * New upstream release.
- * SECURITY: CVE-2006-3081: A bug where str_to_date(1,NULL) lead to a
- server crash has been fixed.
- (this note has been added subsequently for reference)
- * Renamed package libmysqlclient15 to libmysqlclient15off.
- See /usr/share/doc/libmysqlclient15off/NEWS.Debian
- * Updated Czech debconf translation (thanks to Miroslav Kure).
- Closes: #356503
- * Updated French debconf translation (thanks to Christian Perrier).
- Closes: #356332
- * Improved README.Debian (thanks to Olaf van der Spek). Closes: #355702
- * Fixed 5.0.18-8 changelog by saying in which package the NEWS.Debian
- file is (thanks to Ross Boylan). Closes: #355978
-
- -- Christian Hammers <ch@debian.org> Tue, 14 Mar 2006 22:56:13 +0100
-
-mysql-dfsg-5.0 (5.0.18-9) unstable; urgency=medium
-
- [ Christian Hammers ]
- * When using apt-get the check for left-over ISAM tables can abort the
- installation of mysql-server-5.0 but not prevent the mysql-server-4.1
- package from getting removed. The only thing I can do is reflect this
- in the Debconf notice that is shown and suggest to reinstall
- mysql-server-4.1 for converting. See: #354850
- * Suggests removing of /etc/cron.daily/mysql-server in last NEWS message
- (thanks to Mourad De Clerck). Closes: #354111
- * Added versioned symbols for kfreebsd and Hurd, too (thanks to Aurelien
- Jarno and Michael Bank). Closes: #353971
- * Added versioned symbols for kfreebsd, too (thanks to Aurelien Jarno).
- Closes: #353971
- [ Adam Conrad ]
- * Add 39_scripts__mysqld_safe.sh__port_dir.dpatch to ensure that the
- permissions on /var/run/mysqld are always correct, even on a tmpfs.
-
- -- Christian Hammers <ch@debian.org> Mon, 6 Mar 2006 21:42:13 +0100
-
-mysql-dfsg-5.0 (5.0.18-8) unstable; urgency=low
-
- * The rotation of the binary logs is now configured via
- expire-logs-days in /etc/mysql/my.cnf and handled completely
- by the server and no longer in configured in debian-log-rotate.conf
- and handled by a cron job. Thanks to David Johnson.
- See /usr/share/doc/mysql-server-5.0/NEWS.Debian
- * Ran aspell over some files in debian/ and learned a lot :)
- * debian/rules: Added check if versioned symbols are really there.
- * Updated SSL-MINI-HOWTO.
- * Updated copyright (removed the parts regarding the now removed
- BerkeleyDB table handler and mysql-doc package).
- * Relocated a variable in preinst (thanks to Michael Heldebrant).
- Closes: #349258, #352587, #351216
- * Updated Danish debconf translation (thanks to Claus Hindsgaul).
- Closes: #349013
- * Updated Swedish debconf translation (thanks to Daniel Nylander).
- Closes: #349522
- * Updated French debconf translation (thanks to Christian Perrier).
- Closes: #349592
- * Fixed typo in README.Debian (thanks to Vincent Ricard).
- * Prolonged waiting time for mysqld in the init script. Closes: #352070
-
- -- Christian Hammers <ch@debian.org> Mon, 23 Jan 2006 23:13:46 +0100
-
-mysql-dfsg-5.0 (5.0.18-7) unstable; urgency=low
-
- * Made mailx in debian-start.inc.sh optional and changed the dependency on it
- on it to a mere recommendation. Closes: #316297
- * the previous FTBFS patches for GNU/Hurd inadvertently led to configure
- being regenerating, losing a couple trivial things like our versioned
- symbols patch, causing many nasty problems (closes: #348854).
-
- -- sean finney <seanius@debian.org> Fri, 20 Jan 2006 20:59:27 +0100
-
-mysql-dfsg-5.0 (5.0.18-6) unstable; urgency=low
-
- * Added version comment (thanks to Daniel van Eeden).
- * Added two patches to build on GNU/Hurd (thanks to Michael Bank).
- Closes: #348182
- * Abort upgrade if old and now unsupported ISAM tables are present
- (thanks to David Coe). Closes: #345895
-
- -- Christian Hammers <ch@debian.org> Tue, 17 Jan 2006 19:25:59 +0100
-
-mysql-dfsg-5.0 (5.0.18-5) unstable; urgency=low
-
- * Bump shlibdeps for libmysqlclient15 to (>= 5.0.15-1), which was
- the first non-beta release from upstream, as well as being shortly
- after we broke the ABI in Debian by introducing versioned symbols.
-
- -- Adam Conrad <adconrad@0c3.net> Fri, 13 Jan 2006 13:18:03 +1100
-
-mysql-dfsg-5.0 (5.0.18-4) unstable; urgency=low
-
- * Munge our dependencies further to smooth upgrades even more, noting
- that we really need 5.0 to conflict with 4.1, and stealing a page from
- the book of mysql-common, it doesn't hurt to hint package managers in
- the direction of "hey, this stuff is a complete replacement for 4.1"
- * Change the description of mysql-server and mysql-client to remove the
- references to it being "transition", and instead point out that it's
- the way to get the "current best version" of each package installed.
-
- -- Adam Conrad <adconrad@0c3.net> Wed, 11 Jan 2006 11:39:45 +1100
-
-mysql-dfsg-5.0 (5.0.18-3) unstable; urgency=low
-
- * Make the mysql-{client,server}-5.0 conflict against mysql-{client,server}
- versioned, so they can be installed side-by-side and upgrade properly.
- * Add myself to Uploaders; since I have access to the alioth repository.
-
- -- Adam Conrad <adconrad@0c3.net> Tue, 10 Jan 2006 19:15:48 +1100
-
-mysql-dfsg-5.0 (5.0.18-2) unstable; urgency=low
-
- * Removed the transitional package that forced an upgrade from
- mysql-server-4.1 to mysql-server-5.0 as I was convinced that
- having a general "mysql-server" package with adjusted dependencies
- is enough (thanks to Adam Conrad).
- * Updated logcheck.ignore files (thanks to Jamie McCarthy). Closes: #340193
-
- -- Christian Hammers <ch@debian.org> Mon, 9 Jan 2006 21:54:53 +0100
-
-mysql-dfsg-5.0 (5.0.18-1) unstable; urgency=low
-
- * New upstream version.
- * Added empty transitional packages that force an upgrade from the
- server and client packages that have been present in Sarge.
- * Fixed SSL-MINI-HOWTO (thanks to Jonas Smedegaard). Closes: #340589
-
- -- Christian Hammers <ch@debian.org> Mon, 2 Jan 2006 21:17:51 +0100
-
-mysql-dfsg-5.0 (5.0.17-1) unstable; urgency=low
-
- * Never released as Debian package.
-
- -- Christian Hammers <ch@debian.org> Thu, 22 Dec 2005 07:49:52 +0100
-
-mysql-dfsg-5.0 (5.0.16-1) unstable; urgency=low
-
- * New upstream version.
- * Removed the error logs from the logrotate script as Debian does
- not use them anymore. Closes: #339628
-
- -- Christian Hammers <ch@debian.org> Tue, 22 Nov 2005 01:19:11 +0100
-
-mysql-dfsg-5.0 (5.0.15-2) unstable; urgency=medium
-
- * Added 14_configure__gcc-atomic.h.diff to fix FTBFS on m68k
- (thanks to Stephen R Marenka). Closes: #337082
- * Removed dynamic linking against libstdc++ as it was not really
- needed (thanks to Adam Conrad). Closes: #328613
- * Fixed the "/var/lib/mysql is a symlink" workaround that accidently
- left a stalled symlink (thanks to Thomas Lamy). Closes: #336759
- * As the init script cannot distinguish between a broken startup and
- one that just takes very long the "failed" message now says
- "or took more than 6s" (thanks to Olaf van der Spek). Closes: #335547
-
- -- Christian Hammers <ch@debian.org> Thu, 3 Nov 2005 22:00:15 +0100
-
-mysql-dfsg-5.0 (5.0.15-1) unstable; urgency=low
-
- * New upstream version. 5.0 has finally been declared STABLE!
- * Added small patch to debian/rules that fixed sporadic build errors
- where stdout and stderr were piped together, got mixed up and broke
- * Added --with-big-tables to ./configure (thanks to tj.trevelyan).
- Closes: #333090
- * Added capability to parse "-rc" to debian/watch.
- * Fixed cronscript (thanks to Andrew Deason). Closes: #335244
- * Added Swedish debconf translation (thanks to Daniel Nylander).
- Closes: #333670
- * Added comment to README.Debian regarding applications that manually
- set new-style passwords... Closes: #334444
- * Sean Finney:
- - Fix duplicate reference to [-e|--extended-insert]. Closes: #334957
- - Fix default behavior for mysqldumpslow. Closes: #334517
- - Reference documentation issue in mysql manpage. Closes: #335219
-
- -- Christian Hammers <ch@debian.org> Fri, 30 Sep 2005 00:10:39 +0200
-
-mysql-dfsg-5.0 (5.0.13rc-1) unstable; urgency=low
-
- * New upstream release. Now "release-candidate"!
- * Removed any dynamic link dependencies to libndbclient.so.0 which
- is due to its version only distributed as a static library.
- * Sean Finney:
- - FTBFS fix related to stripping rpath in debian/rules
-
- -- Christian Hammers <ch@debian.org> Mon, 26 Sep 2005 22:09:26 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-5) unstable; urgency=low
-
- * The recent FTBFS were probably result of a timing bug in the
- debian/patches/75_*.dpatch file where Makefile.in got patched just
- before the Makefile.shared which it depended on. For that reason
- only some of the autobuilders failed. Closes: #330149
- * Fixed chrpath removal (option -k had to be added).
- * Corrected debconf dependency as requested by Joey Hess.
-
- -- Christian Hammers <ch@debian.org> Mon, 26 Sep 2005 18:37:07 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-4) unstable; urgency=low
-
- * Removed experimental shared library libndbclient.so.0.0.0 as it
- is doomed to cause trouble as long as it is present in both MySQL 4.1
- and 5.0 without real soname and its own package. We still have
- libndbclient.a for developers. (thanks to Adam Conrad and
- mediaforest.net). Closes: #329772
-
- -- Christian Hammers <ch@debian.org> Fri, 23 Sep 2005 12:36:48 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-3) unstable; urgency=medium
-
- * Symbol versioning support! wooooohoooooo!
- (thanks to Steve Langasek) Closes: #236288
- * Moved libndbcclient.so.0 to the -dev package as it is provided by
- libmysqlclient14 and -15 which must be installable simultaneously.
- * Removed mysql-*-doc suggestions.
-
- -- Christian Hammers <ch@debian.org> Tue, 20 Sep 2005 00:07:03 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-2) unstable; urgency=low
-
- * Added patch to build on GNU/kFreeBSD (thanks to Aurelien Jarno).
- Closes: #327702
- * Added patch that was already been present on the 4.1 branch which
- makes the "status" command of the init script more sensible
- (thanks to Stephen Gildea). Closes: #311836
- * Added Vietnamese Debconf translation (thanks to Clytie Siddal).
- Closes: #313006
- * Updated German Debconf translation (thanks to Jens Seidel).
- Closes: #313957
- * Corrected commends in example debian-log-rotate.conf. The default is
- unlike the mysql-sever-4.1 package which needed to stay backwards
- compatible now 2 to avoid filling up the disk endlessly.
- * Fixed watch file to be "-beta" aware.
-
- -- Christian Hammers <ch@debian.org> Thu, 15 Sep 2005 20:50:19 +0200
-
-mysql-dfsg-5.0 (5.0.12beta-1) unstable; urgency=medium
-
- * Christian Hammers:
- - New upstream release.
- - Changed build-dep to libreadline5-dev as requested by Matthias Klose.
- Closes: #326316
- - Applied fix for changed output format of SHOW MASTER LOGS for
- binary log rotation (thanks to Martin Krueger). Closes: #326427, #326427
- - Removed explicit setting of $PATH as I saw no sense in it and
- it introduced a bug (thanks to Quim Calpe). Closes: #326769
- - Removed PID file creation from /etc/init.d/mysql-ndb as it does
- not work with this daemon (thanks to Quim Calpe).
- - Updated French Debconf translation (thanks to Christian Perrier).
- Closes: #324805
- - Moved conflicts line in debian/control from libmysqlclient15 to
- libmysqlclient15-dev and removed some pre-sarge conflicts as
- suggested by Adam Majer. Closes: #324623
- * Sean Finney:
- - For posterity, CAN-2005-2558 has been fixed since 5.0.7beta.
-
- -- Christian Hammers <ch@debian.org> Thu, 15 Sep 2005 19:58:22 +0200
-
-mysql-dfsg-5.0 (5.0.11beta-3) unstable; urgency=low
-
- * Temporarily build only with -O2 to circumvent gcc internal errors
- (thanks to Matthias Klose). Related to: #321165
-
- -- Christian Hammers <ch@debian.org> Thu, 18 Aug 2005 15:44:04 +0200
-
-mysql-dfsg-5.0 (5.0.11beta-2) unstable; urgency=low
-
- * Fixed README.Debian regarding the status of mysql-doc.
- * Added "set +e" around chgrp in mysql-server-5.0.preinst to
- not fail on .journal files (thanks to Christophe Nowicki).
- Closes: #318435
-
- -- Christian Hammers <ch@debian.org> Sun, 14 Aug 2005 18:02:08 +0200
-
-mysql-dfsg-5.0 (5.0.11beta-1) unstable; urgency=low
-
- * New upstream version.
- * Added Danish Debconf translations (thanks to Claus Hindsgaul).
- Closes: #322384
- * Updated Czech Debconf translations (thanks to Miroslav Kure).
- Closes: #321765
-
- -- Christian Hammers <ch@debian.org> Sat, 13 Aug 2005 11:56:15 +0000
-
-mysql-dfsg-5.0 (5.0.10beta-1) unstable; urgency=low
-
- * New upstream release.
- * Christian Hammers:
- - Added check for mounted /proc to debian/rules.
- * Sean Finney:
- - fix for fix_mysql_privilege_tables/mysql_fix_privilege_tables typo
- in mysql-server-5.0's README.Debian (see #319838).
-
- -- Christian Hammers <ch@debian.org> Sun, 31 Jul 2005 00:30:45 +0200
-
-mysql-dfsg-5.0 (5.0.7beta-1) unstable; urgency=low
-
- * Second try for new upstream release.
- * Renamed mysql-common-5.0 to mysql-common as future libmysqlclient16
- from e.g. MySQL-5.1 would else introduce mysql-common-5.1 which makes
- a simultanous installation of libmysqlclient14 impossible as that
- depends on either mysql-common or mysql-common-5.0 but not on future
- versions. Thus we decided to always let the newest MySQL version
- provide mysql-common.
- * Added ${misc:Depends} as suggested by debhelper manpage.
- * Raised standard in control file to 3.6.2.
- * Removed DH_COMPAT from rules in faviour of debian/compat.
- * Checkes for presence of init script before executing it in preinst.
- Referres: 315959
- * Added 60_includes_mysys.h__gcc40.dpatch for GCC-4.0 compatibility.
-
- -- Christian Hammers <ch@debian.org> Wed, 29 Jun 2005 00:39:05 +0200
-
-mysql-dfsg-5.0 (5.0.5beta-1) unstable; urgency=low
-
- * New major release! Still beta so be carefull...
- * Added federated storage engine.
-
- -- Christian Hammers <ch@debian.org> Wed, 8 Jun 2005 19:29:45 +0200
-
-mysql-dfsg-4.1 (4.1.12-1) unstable; urgency=low
-
- * Christian Hammers:
- - New upstream release.
- - Disabled BerkeleyDB finally. It has been obsoleted by InnoDB.
- * Sean Finney:
- - Updated French translation from Christian Perrier (Closes: #310526).
- - Updated Japanese translation from Hideki Yamane (Closes: #310263).
- - Updated Russian translation from Yuriy Talakan (Closes: #310197).
-
- -- Christian Hammers <ch@debian.org> Sat, 4 Jun 2005 05:49:11 +0200
-
-mysql-dfsg-4.1 (4.1.11a-4) unstable; urgency=high
-
- * Fixed FTBFS problem which was caused due to the fact that last uploads
- BerkeleyDB patch was tried to applied on all architectures and not only
- on those where BerkeleyDB is actually beeing built. Closes: #310296
-
- -- Christian Hammers <ch@debian.org> Mon, 23 May 2005 00:54:51 +0200
-
-mysql-dfsg-4.1 (4.1.11a-3) unstable; urgency=high
-
- * Added patch from Piotr Roszatycki to compile the bundled db3 library
- that is needed for the BerkeleyDB support with versioned symbols so
- that mysqld no longer crashes when it gets linked together with the
- Debian db3 version which happens when e.g. using libnss-db.
- Closes: #308966
-
- -- Christian Hammers <ch@debian.org> Thu, 19 May 2005 01:41:14 +0200
-
-mysql-dfsg-4.1 (4.1.11a-2) unstable; urgency=high
-
- * Okay, the hackery with /var/lib/dpkg/info/mysql-server.list will not
- stand and is removed from the preinst of mysql-server.
- * New workaround for the symlink problem that does not involve mucking
- with dpkg's file lists is storing the symlinks in a temporary location
- across upgrades.
- As this sometimes fails since apt-get does not always call new.preinst
- before old.postrm, some remarks were added to README.Debian and the
- Debconf installation notes to minimize the inconvinience this causes.
-
- -- sean finney <seanius@debian.org> Sun, 15 May 2005 10:25:31 -0400
-
-mysql-dfsg-4.1 (4.1.11a-1) unstable; urgency=high
-
- * Added the "a" to the version number to be able to upload a new
- .orig.tar.gz file which now has the non-free Docs/ directory removed
- as this has been forgotten in the 4.1.11 release (thanks to Goeran
- Weinholt). Closes: #308691
- * The Woody package listed /var/lib/mysql and /var/log/mysql in its
- /var/lib/dpkg/info/mysql-server.list. These directories are often
- replaced by symlinks to data partitions which triggers a dpkg bug
- that causes these symlinks to be removed on upgrades. The new preinst
- prevents this by removing the two lines from the .list file
- (thanks to Andreas Barth and Jamin W. Collins). See dpkg bug #287978.
- * Updated French Debconf translation (thanks to Christian Perrier).
- Closes: #308353
-
- -- Christian Hammers <ch@debian.org> Thu, 12 May 2005 21:52:46 +0200
-
-mysql-dfsg-4.1 (4.1.11-3) unstable; urgency=high
-
- * The "do you want to remove /var/lib/mysql when purging the package" flag
- from old versions is removed once this package is beeing installed so
- that purging an old Woody mysql-server package while having a
- mysql-server-4.1 package installed can no longer lead to the removal of
- all databases. Additionaly clarified the wording of this versions Debconf
- template and added a check that skips this purge in the postrm script
- if another mysql-server* package has /usr/sbin/mysqld installed.
- (thanks to Adrian Bunk for spotting that problem) Closes: #307473
- * Cronfile was not beeing installed as the filename was not in the
- correct format for "dh_installcron --name" (thanks to Tomislav
- Gountchev). Closes: #302712
-
- -- Christian Hammers <ch@debian.org> Sat, 23 Apr 2005 22:55:15 +0200
-
-mysql-dfsg-4.1 (4.1.11-2) unstable; urgency=low
-
- * Sean Finney:
- - don't freak out if we can't remove /etc/mysql during purge.
- - debian/rules clean works again.
- * Christian Hammers:
- - Fixed typo in README.Debian (thanks to Joerg Rieger). Closes: #304897
- - Completely removed the passwordless test user as it was not only
- insecure but also lead to irritations as MySQL checks first the
- permissions of this user and then those of a password having one.
- See bug report from Hilko Bengen for details. Closes: #301741
-
- -- Christian Hammers <ch@debian.org> Sat, 16 Apr 2005 15:55:00 +0200
-
-mysql-dfsg-4.1 (4.1.11-1) unstable; urgency=low
-
- * New upstream version.
- * Upstream fix for charset/collation problem. Closes: #282256
- * Upstream fix for subselect crash. Closes: #297687
- * Corrected minor issue in Debconf template regarding skip-networking
- (thanks to Isaac Clerencia). Closes: #303417
- * Made dependency to gawk unnecessary (thanks to Zoran Dzelajlija).
- Closes: #302284
- * Removed obsolete 50_innodb_mixlen.dpatch.
- * Removed obsolete 51_CAN-2004-0957_db_grant_underscore.dpatch.
-
- -- Christian Hammers <ch@debian.org> Fri, 8 Apr 2005 00:23:53 +0200
-
-mysql-dfsg-4.1 (4.1.10a-7) unstable; urgency=low
-
- * Sean Finney:
- - fix for the mysteriously disappeared cronjob. thanks to
- Peter Palfrader <weasel@debian.org> for pointing out this omission.
- (closes: #302712).
-
- -- sean finney <seanius@debian.org> Sat, 02 Apr 2005 16:54:13 -0500
-
-mysql-dfsg-4.1 (4.1.10a-6) unstable; urgency=high
-
- * Sean Finney:
- - the previous upload did not completely address the issue. this one
- should do so. d'oh.
-
- -- sean finney <seanius@debian.org> Thu, 31 Mar 2005 03:35:50 +0000
-
-mysql-dfsg-4.1 (4.1.10a-5) unstable; urgency=high
-
- * Sean Finney:
- - the following security issue is addressed in this upload:
- CAN-2004-0957 (grant privilege escalation on tables with underscores)
- thanks to sergei at mysql for all his help with this.
-
- -- sean finney <seanius@debian.org> Wed, 30 Mar 2005 21:19:26 -0500
-
-mysql-dfsg-4.1 (4.1.10a-4) unstable; urgency=low
-
- * Sean Finney:
- - FTBFS fix for amd64/gcc-4.0. Thanks to Andreas Jochens <aj@andaco.de>
- for reporting this (closes: #301807).
- - ANSI-compatible quoting fix in daily cron job. thanks to
- Karl Hammar <karl@aspodata.se> for pointing out the problem in
- the 4.0 branch.
- - Added myself as a co-maintainer in the control file (closes: #295312).
-
- -- sean finney <seanius@debian.org> Tue, 29 Mar 2005 18:54:42 -0500
-
-mysql-dfsg-4.1 (4.1.10a-3) unstable; urgency=low
-
- * BerkeleyDB is now disabled by default as its use is discouraged by MySQL.
- * Added embedded server libraries as they finally do compile.
- They are currently in libmysqlclient-dev as they are still
- experimental and only available as .a library (thanks to Keith Packard).
- Closes: #297062
- * Fixed obsolete "tail" syntax (thanks to Sven Mueller). Closes: #301413
- * Added CAN numbers for the latest security bugfix upload.
- * Updated manpage of mysqlmanager (thanks to Justin Pryzby). Closes: #299844
- * Added comments to default configuration.
-
- -- Christian Hammers <ch@debian.org> Sun, 20 Mar 2005 17:40:18 +0100
-
-mysql-dfsg-4.1 (4.1.10a-2) unstable; urgency=low
-
- * Disabled "--with-mysqld-ldflags=-all-static" as it causes sig11 crashes
- if LDAP is used for groups in /etc/nsswitch.conf. Confirmed by Sean Finney
- and Daniel Dehennin. Closes: #299382
-
- -- Christian Hammers <ch@debian.org> Mon, 14 Mar 2005 03:01:03 +0100
-
-mysql-dfsg-4.1 (4.1.10a-1) unstable; urgency=high
-
- * SECURITY:
- - The following security related updates are addressed:
- CAN-2005-0711 (temporary file creation with "CREATE TEMPORARY TABLE")
- CAN-2005-0709 (arbitrary library injection in udf_init())
- CAN-2005-0710 (arbitrary code execution via "CREATE FUNCTION")
- Closes: #299029, #299031, #299065
- * New Upstream Release.
- - Fixes some server crash conditions.
- - Upstream includes fix for TMPDIR overriding my.cnf tmpdir setting
- Closes: #294347
- - Fixes InnoDB error message. Closes: #298875
- - Fixes resouce limiting. Closes: #285044
- * Improved checking whether or not the server is alive in the init script
- which should make it possible to run several mysqld instances in
- different chroot environments. Closes: #297772
- * Fixed cron script name as dots are not allowed (thanks to Michel
- v/d Ven). Closes: #298447
- * Added -O3 and --with-mysqld-ldflags=-all-static as MySQL recommends to
- build the server binary statically in order to gain about 13% more
- performance (thanks to Marcin Kowalski).
- * Added patch to let mysqld_safe react to signals (thanks to Erich
- Schubert). Closes: #208364
- * (Thanks to Sean Finney for doing a great share of work for this release!)
-
- -- Christian Hammers <ch@debian.org> Thu, 3 Mar 2005 02:36:39 +0100
-
-mysql-dfsg-4.1 (4.1.10-4) unstable; urgency=medium
-
- * Fixed bug that prevented MySQL from starting after upgrades.
- Closes: #297198, #296403
- * Added comment about logging to syslog to the default my.cnf
- and the logrotate script (thanks to Ryszard Lach). Closes: #295507
-
- -- Christian Hammers <ch@debian.org> Thu, 3 Mar 2005 00:28:02 +0100
-
-mysql-dfsg-4.1 (4.1.10-3) unstable; urgency=low
-
- * Sean Finney: Cronjobs now exit silently when the server package
- has been removed but not purged (thanks to Vineet Kumar).
- Closes: #297404
- * Fixed comments of /etc/mysql/debian-log-rotate.conf (thanks to
- Philip Ross). Closes: #297467
- * Made mysqld_safe reacting sane on signals (thanks to Erich Schubert).
- Closes: #208364
-
- -- Christian Hammers <ch@debian.org> Tue, 1 Mar 2005 19:44:34 +0100
-
-mysql-dfsg-4.1 (4.1.10-2) unstable; urgency=low
-
- * Converted to dpatch.
- * debian/ is now maintained via Subversion on svn.debian.org.
-
- -- Christian Hammers <ch@debian.org> Tue, 1 Mar 2005 02:16:36 +0100
-
-mysql-dfsg-4.1 (4.1.10-1) unstable; urgency=low
-
- * New upstream version.
- * Upstream fixed memleak bug. Closes: #205587
- * Added debian/copyright.more for personal reference.
- * Lowered default query cache size as suggested by Arjen from MySQL.
- * Switched from log to log-bin as suggested by Arjen from MySQL.
- * Fixed typo in my.cnf (thanks to Sebastian Feltel). Closes: #295247
- * Replaced --defaults-extra-file by --defaults-file in Debian scripts
- as former lets password/host etc be overwriteable by /root/.my.cnf.
- Added socket to /etc/mysql/debian.cnf to let it work. (thanks to
- SATOH Fumiyasu). Closes: #295170
-
- -- Christian Hammers <ch@debian.org> Tue, 15 Feb 2005 23:47:02 +0100
-
-mysql-dfsg-4.1 (4.1.9-4) unstable; urgency=low
-
- * Improved the way mysqld is started and registered with update-rc.d
- in cases where the admin modifies the runlevel configuration.
- Most notably removed the debconf question whether or not mysql should
- start on when booting. Closes: #274264
- * Renamed configuration option old-passwords to the more preferred
- naming convention old_passwords. Same for some others (thanks to
- Patrice Pawlak). Closes: #293983
-
- -- Christian Hammers <ch@debian.org> Tue, 8 Feb 2005 02:21:18 +0100
-
-mysql-dfsg-4.1 (4.1.9-3) unstable; urgency=low
-
- * Renamed ca_ES.po to ca.po to reach a broader audience (thanks to
- Christian Perrier). Closes: #293786
- * Expicitly disabled mysqlfs support as it has never been enabled by
- configure during the autodetection but fails due to broken upstream
- code when users try to build the package theirselves while having
- liborbit-dev installed which triggers the mysqlfs autodetection
- (thanks to Max Kellermann). Closes: #293431
- * Added dependencies to gawk as one script does not work with original-awk
- (thanks to Petr Ferschmann). Closes: #291634
-
- -- Christian Hammers <ch@debian.org> Sun, 6 Feb 2005 23:33:11 +0100
-
-mysql-dfsg-4.1 (4.1.9-2) unstable; urgency=high
-
- * SECURITY:
- For historical reasons /usr/share/mysql/ was owned and writable by
- the user "mysql". This is a security problem as some scripts that
- are run by root are in this directory and could be modified and used
- by a malicious user who already has mysql privileges to gain full root
- rights (thanks to Matt Brubeck). Closes: #293345
- * Changed "skip-networking" to "bind-address 127.0.0.1" which is more
- compatible and not less secure but maybe even more, as less people enable
- networking for all interfaces (thanks to Arjen Lentz).
- * Enabled InnoDB by default as recommended by Arjen Lentz from MySQL.
- * Added remarks about hosts.allow to README.Debian (thanks to David
- Chappell). Closes: #291300
- * mysql-server-4.1 now provides mysql-server (thanks to Paul van den Berg).
- Closes: #287735
-
- -- Christian Hammers <ch@debian.org> Wed, 2 Feb 2005 23:31:55 +0100
-
-mysql-dfsg-4.1 (4.1.9-1) unstable; urgency=low
-
- * New upstream version.
- * mysql-client-4.1 now provides "mysql-client" so that packages depending
- on mysql-client (ca. 40) can now be used with MySQL-4.1, too.
-
- -- Christian Hammers <ch@debian.org> Sun, 23 Jan 2005 22:52:48 +0100
-
-mysql-dfsg-4.1 (4.1.8a-6) unstable; urgency=high
-
- * SECURITY:
- Javier Fernandez-Sanguino Pena from the Debian Security Audit Project
- discovered a temporary file vulnerability in the mysqlaccess script of
- MySQL that could allow an unprivileged user to let root overwrite
- arbitrary files via a symlink attack and could also could unveil the
- contents of a temporary file which might contain sensitive information.
- (CAN-2005-0004, http://lists.mysql.com/internals/20600) Closes: #291122
-
- -- Christian Hammers <ch@debian.org> Tue, 18 Jan 2005 23:11:48 +0100
-
-mysql-dfsg-4.1 (4.1.8a-5) unstable; urgency=medium
-
- * Fixed important upstream bug that causes from_unixtime(0) to return
- NULL instead of "1970-01-01 00:00:00" which fails on NOT NULL columns.
- Closes: #287792
- * Fixes upstream bug in mysql_list_fields() . Closes: #282486
- * Fixes bug that lead to double rotated logfiles when mysql-server 4.0
- was previously installed (thanks to Olaf van der Spek). Closes: #289851
- * Fixed typo in README.Debian (thanks to Mark Nipper). Closes: #289131
- * Changed max_allowed_packet in my.cnf to 16M as in 4.0.x (thanks to
- Olaf van der Spek). Closes: #289840
- * Updated French debconf translation (thanks to Christian Perrier).
- Closes: #287955
-
- -- Christian Hammers <ch@debian.org> Thu, 13 Jan 2005 01:29:05 +0100
-
-mysql-dfsg-4.1 (4.1.8a-4) unstable; urgency=low
-
- * Broken patch again :-(
-
- -- Christian Hammers <ch@debian.org> Sun, 9 Jan 2005 23:47:55 +0100
-
-mysql-dfsg-4.1 (4.1.8a-3) unstable; urgency=low
-
- * The mutex patch was a bit too x86 centric. This broke the alpha build.
-
- -- Christian Hammers <ch@debian.org> Sun, 9 Jan 2005 14:18:49 +0100
-
-mysql-dfsg-4.1 (4.1.8a-2) unstable; urgency=medium
-
- * Some Makefiles that were patched by me got overwritten by the GNU
- autotools, probably because I also patched ./configure. Fixed now,
- the critical mutex patch is now back in again. Closes: #286961
- * Added patch to make MySQL compile on ARM (thanks to Adam Majer).
- Closes: #285071
-
- -- Christian Hammers <ch@debian.org> Thu, 6 Jan 2005 09:30:13 +0100
-
-mysql-dfsg-4.1 (4.1.8a-1) unstable; urgency=medium
-
- * Upstream 4.1.8 had some problems in their GNU Autotools files so they
- released 4.1.8a. Debian's 4.1.8 was fixed by running autoreconf but this
- again overwrote MySQL changes to ltmain.sh which are supposed to fix some
- problems on uncommon architectures (maybe the FTBFS on alpha, arm, m68k
- and sparc?).
- * libmysqlclient_r.so.14 from 4.1.8-3 also missed a link dependency to
- libz which lead to unresolved symbols visible with "ldd -r" (thanks
- to Laurent Bonnaud). Closes: #287573
-
- -- Christian Hammers <ch@debian.org> Wed, 29 Dec 2004 14:26:33 +0100
-
-mysql-dfsg-4.1 (4.1.8-3) unstable; urgency=low
-
- * Fixed checking for error messages by forcing english language
- output by adding LC_ALL=C to debian-start (thanks to Rene
- Konasz) Closes: #285709
- * Fixed bashisms in Debian scripts. Closes: #286863
- * Updated Japanese Debconf translation (thanks to Hideki Yamane).
- Closes: #287003
- * Improved 4.0 to 4.1 upgrade if /var/lib/mysql is a symlink
- (thanks to Thomas Lamy). Closes: #286560
- * Added patch for FTBFS problem where no LinuxThreads can be found.
- I don't know if this still applies but it should not hurt.
- The patch is debian/patches/configure__AMD64-LinuxThreads-vs-NPTL.diff
-
- -- Christian Hammers <ch@debian.org> Sun, 26 Dec 2004 14:04:20 +0100
-
-mysql-dfsg-4.1 (4.1.8-2) unstable; urgency=low
-
- * If /var/lib/mysql is a symlink then it is kept as such.
- * Added the old-passwords option to the default my.cnf to stay
- compatible to clients that are still compiled to libmysqlclient10
- and libmysqlclient12 for licence reasons.
- * Adjusted tetex build-deps to ease backporting (thanks to Norbert
- Tretkowski from backports.org).
-
- -- Christian Hammers <ch@debian.org> Tue, 21 Dec 2004 01:00:27 +0100
-
-mysql-dfsg-4.1 (4.1.8-1) unstable; urgency=medium
-
- * New upstream version. Closes: #286175
- * Added conflict to libmysqlclient-dev (thanks to Adam Majer).
- Closes: #286538
- * Added debconf-updatepo to debian/rules:clean.
- * Updated Japanese Debconf translation (thanks to Hideki Yamane).
- Closes: #285107
- * Updated French Debconf translation (thanks to Christian Perrier).
- Closes: #285977
- * Renamed cz.po to cs.po (thanks to Miroslav Kure). Closes: #285438
- * Aplied patch for changed server notice to debian-start (thanks to
- Adam Majer). Closes: #286035
- * Changed nice value in default my.cnf as nohup changed its behaviour
- (thanks to Dariush Pietrzak). Closes: #285446
- * Increased verbosity of preinst script in cases where it cannot stop
- a running server (thanks to Jan Minar). Closes: #285982
- * Splitted the code parts of /etc/mysql/debian-start to
- /usr/share/mysql/debian-start.inc.sh (thanks to Jan Minar).
- Closes: #285988
-
- -- Christian Hammers <ch@debian.org> Mon, 20 Dec 2004 00:33:21 +0100
-
-mysql-dfsg-4.1 (4.1.7-4) unstable; urgency=medium
-
- * Removed OpenSSL support.
- After a short discussion with MySQL, I decided to drop OpenSSL support as
- 1. MySQL started shipping their binaries without it, too and do not
- seem to support it in favour of using a different library somewhen.
- 2. MySQL did not adjust their licence to grant permission to link
- against OpenSSL.
- 3. Even if they did, third parties who use libmysqlclient.so often
- do not realise licencing problems or even do not want OpenSSL.
- (thanks to Jordi Mallach and the responders to MySQL bug #6924)
- Closes: #283786
- * debian/control: Improved depends and conflicts to mysql-4.0.
-
- -- Christian Hammers <ch@debian.org> Thu, 2 Dec 2004 22:02:28 +0100
-
-mysql-dfsg-4.1 (4.1.7-3) unstable; urgency=low
-
- * Raised version to make it higher as the one in experimental.
-
- -- Christian Hammers <ch@debian.org> Wed, 1 Dec 2004 21:09:20 +0100
-
-mysql-dfsg-4.1 (4.1.7-2) unstable; urgency=low
-
- * Patched scripts/mysql_install_db so that it no longer creates a
- passwordless test database during installation (thanks to Patrick
- Schnorbus). Closes: #281158
- * Added Czech debconf translation (thanks to Miroslav Kure).
- Closes: #283222
-
- -- Christian Hammers <ch@debian.org> Wed, 1 Dec 2004 01:29:31 +0100
-
-mysql-dfsg-4.1 (4.1.7-1) unstable; urgency=low
-
- * New upstream branch!
- * Adjusted debian/control to make this package suitable to get parallel
- to version 4.0.x into unstable and sarge. The package names are
- different so that "mysql-server" still defaults to the rock-stable
- 4.0 instead to this announced-to-be-stable 4.1.
- * Added --with-mutex=i86/gcc-assemler to the Berkeley-DB configure
- to prevent the use of NPLT threads when compiling under kernel 2.6
- because the binaries are else not runable on kernel 2.4 hosts.
- Closes: #278638, #274598
-
- -- Christian Hammers <ch@debian.org> Sun, 31 Oct 2004 20:15:03 +0100
-
-mysql-dfsg (4.1.6-1) experimental; urgency=low
-
- * New upstream version.
- * Fixed symlinks in libmysqlclient-dev package. Closes: #277028
- * This time I did not update the libtool files as they were pretty
- up to date and I want to have a shorter diff file.
-
- -- Christian Hammers <ch@debian.org> Wed, 20 Oct 2004 00:07:58 +0200
-
-mysql-dfsg (4.1.5-3) experimental; urgency=low
-
- * debian/postinst: mysql_install_db changed parameter from --IN-RPM
- to --rpm which caused problems during installs. Closes: #276320
-
- -- Christian Hammers <ch@debian.org> Sat, 16 Oct 2004 20:36:46 +0200
-
-mysql-dfsg (4.1.5-2) experimental; urgency=low
-
- * Activated support for ndb clustering (thanks to Kevin M. Rosenberg).
- Closes: #275109
-
- -- Christian Hammers <ch@debian.org> Wed, 6 Oct 2004 01:58:00 +0200
-
-mysql-dfsg (4.1.5-1) experimental; urgency=low
-
- * WARNING:
- The upstream branch 4.1 is still considered BETA.
- The Debian packages for 4.1 were done without big testing. If you miss
- a new functionality or binary, contact me and I check add the relevant
- configure option or include the program.
- * New MAJOR upstream version.
- Thanks to the great demand here's now the first MySQL 4.1 experimental
- release. FEEDBACK IS WELCOME.
- * 4.0->4.1 notes:
- - debian/patches/alpha.diff could not be applied, I fix that later
- - debian/patches/scripts__mysql_install_db.sh.diff was obsolete
- - debian/patches/scripts__Makefile.in was neccessary due to a dependency
- to the removed non-free Docs/ directory. Upstream has been contacted.
- - Build-Deps: += automake1.7
- - debian/rules: embedded servers examples did not compile, removed
-
- -- Christian Hammers <ch@debian.org> Sun, 26 Sep 2004 19:46:47 +0200
-
-mysql-dfsg (4.0.21-3) unstable; urgency=low
-
- * Upstream tried to fix a security bug in mysqlhotcopy and broke it :-)
- Applied a patch (see debian/patches) from Martin Pitt. Closes: #271632
- * Between 4.0.20 and 4.0.21 the Debian specific changes in
- /usr/bin/mysqld_safe that piped the error log to syslog got lost
- and are now back again.
- * Fixed capitalization in debconf headings.
- * Changed wording of the initscript status message to make heartbeat
- happier. Closes: #271591
-
- -- Christian Hammers <ch@debian.org> Fri, 17 Sep 2004 18:42:25 +0200
-
-mysql-dfsg (4.0.21-2) unstable; urgency=medium
-
- * The dependencies between mysql-client and libmysqlclient12 were
- too loose, when upgrading only the client this can lead to non working
- binaries due to relocation errors (thanks to Dominic Cleal).
- Closes: #271803
- * Fixed typo in mysqldump.1 manpage (thanks to Nicolas Francois).
- Closes: #271334
-
- -- Christian Hammers <ch@debian.org> Wed, 15 Sep 2004 15:38:11 +0200
-
-mysql-dfsg (4.0.21-1) unstable; urgency=high
-
- * SECURITY:
- This upstream version fixes some security problems that might at least
- allow a DoS attack on the server.
- * Fixed an old bug in concurrent accesses to `MERGE' tables (even
- one `MERGE' table and `MyISAM' tables), that could've resulted in
- a crash or hang of the server. (Bug #2408)
- * Fixed bug in privilege checking where, under some conditions, one
- was able to grant privileges on the database, he has no privileges
- on. (Bug #3933)
- * Fixed crash in `MATCH ... AGAINST()' on a phrase search operator
- with a missing closing double quote. (Bug #3870)
- * Fixed potential memory overrun in `mysql_real_connect()' (which
- required a compromised DNS server and certain operating systems).
- (Bug #4017)
- * New upstream version.
- * Fixes bug that made x="foo" in WHERE sometimes the same as x="foo ".
- Closes: #211618
- * Updated Japanese Debconf translation (thanks to Hideki Yamane).
- Closes: #271097
-
- -- Christian Hammers <ch@debian.org> Sat, 11 Sep 2004 23:15:44 +0200
-
-mysql-dfsg (4.0.20-14) unstable; urgency=low
-
- * Dave Rolsky spottet that -DBIG_JOINS was not properly enabled.
- It allowes joining 64 instead of an 32 tables to join.
-
- -- Christian Hammers <ch@debian.org> Thu, 9 Sep 2004 20:24:02 +0200
-
-mysql-dfsg (4.0.20-13) unstable; urgency=medium
-
- * Fixed a bug in the initscript which caused the check for not properly
- closed i.e. corrupt tables that is executed when the server starts
- not to run in background as supposed.
- Although the check does not repair anything on servers with several
- thousand tables the script was reported to take some minutes which
- is quite annoying. (Thanks to Jakob Goldbach). Closes: #270800
-
- -- Christian Hammers <ch@debian.org> Thu, 9 Sep 2004 17:11:05 +0200
-
-mysql-dfsg (4.0.20-12) unstable; urgency=medium
-
- * Filter messages regarding table handles that do not support CHECK TABLE
- in the script that checks for corrupted tables on every start which lead
- to unnecessary mails (thanks to David Everly). Closes: #269811
- * Added a note to the corrupt-table-check mail which notes that a
- false-positive is reported in the case that immediately after starting
- the server a client starts using a table (thanks to Uwe Kappe).
- Closes: #269985
- * Added "quote-names" as default to the [mysqldump] section in
- /etc/mysql/my.cnf as too many users stumble over dump files that
- could not be read in again due to the valid use of reserved words
- as table names. This has also be done by upstream in 4.1.1 and has
- no known drawbacks. Closes: #269865
- * Binary logs can now be rotated as well. Defaults to off, though, for
- compatibilty reasons (thanks to Mark Ferlatte). Closes: #94230, #269110
- * The mysql user "debian-sys-maint" now gets all possible rights which
- makes binary logging possible and helps other package maintainer who
- wants to use it to create package specific databases and users.
- * Added example how to change daemon nice level via /etc/mysql/my.cnf
- * Updated French debconf translations (thanks to Christian Perrier).
- Closes: #265811
- * Renamed options in the default config file that still had old names
- (thanks to Yves Kreis). Closes: #266445
- * Fixed spelling in debconf note.
- * Added -l and -L to dh_shlibdeps.
-
- -- Christian Hammers <ch@debian.org> Fri, 3 Sep 2004 20:10:46 +0200
-
-mysql-dfsg (4.0.20-11) unstable; urgency=high
-
- * SECURITY
- This version fixes a security flaw in mysqlhotcopy which created
- temporary files in /tmp which had predictable filenames and such
- could be used for a tempfile run attack.
- The issue has been recorded as CAN-2004-0457.
-
- -- Christian Hammers <ch@debian.org> Sat, 14 Aug 2004 18:27:19 +0200
-
-mysql-dfsg (4.0.20-10) unstable; urgency=low
-
- * MySQL finally updated their copyright page and installed v1.5 of
- the "Free/Libre and Open Source Software License (FLOSS) - Exception"
- which will hopefully end the license hell they created by putting the
- client libraries under GPL instead of LGPL which conflicts with PHP and
- other software that used to link against MySQL.
- The license text is not yet in any release MySQL version but visible
- on their web site and copied into the debian/copyright file.
- Special thanks to Zak Greant <zak@mysql.com> and the debian-legal list
- for helping to solve this release critical problem.
- Closes: #242449
- * Updated Brazil debconf translation (thanks to Andre Luis Lopes).
- Closes: #264233
- * Updated Japanese debconf translation (thanks to Hideki Yamane).
- Closes: #264620
- * Fixed minor typo in debconf description (thanks to TROJETTE Mohammed
- Adnene). Closes: #264840
- * Improved init and preinst script which now detects stalled servers which
- do no longer communicate but are present in the process list (thanks to
- Henrik Johansson). Closes: #263215
-
- -- Christian Hammers <ch@debian.org> Mon, 9 Aug 2004 19:44:28 +0200
-
-mysql-dfsg (4.0.20-9) unstable; urgency=medium
-
- * Partly reverted the last patch which gave the mysql-user
- "debian-sys-maint" more rights as there are old versions of MySQL which
- have fewer privlige columns. Now only those are set (thanks to Alan Tam).
- Closes: #263111
-
- -- Christian Hammers <ch@debian.org> Tue, 3 Aug 2004 13:03:02 +0200
-
-mysql-dfsg (4.0.20-8) unstable; urgency=low
-
- * The mysqlcheck that is started from the initscript will now be
- backgrounded because it might else prevent the boot process to continue.
- It also now notifies root by mail and syslog if a table is corrupt.
- * The "debian-sys-maint" MySQL user now has almost full rights so that other
- packages might use this account to create databases and user (thanks to
- Andreas Barth). Closes: #262541
- * Added paranoid rules for logcheck.
-
- -- Christian Hammers <ch@debian.org> Sun, 1 Aug 2004 21:00:55 +0200
-
-mysql-dfsg (4.0.20-8) unstable; urgency=low
-
- * Upload stalled. Not released.
-
- -- Christian Hammers <ch@debian.org> Sun, 1 Aug 2004 20:27:55 +0200
-
-mysql-dfsg (4.0.20-7) unstable; urgency=medium
-
- * Solved the upstream bug that error messages of the server are written
- in a file that is then rotated away leaving mysqld logging effectively
- to /dev/null. It now logs to a /usr/bin/logger process which puts the
- messages into the syslog.
- Modified files: /etc/init.d/mysql, /usr/bin/mysqld_safe and the
- logchecker files. Closes: #254070
- * The initscript does no longer call mysqlcheck directly but via
- /etc/mysql/debian-start which is a user customizable config script.
- * Splitted the debconf "install and update notes" and only show them
- when it is appropriate (thanks to Steve Langasek). Closes: #240515
- * Added NEWS.Debian.
- * Added hint to -DBIG_ROWS, which is currently not used, to README.Debian.
- * Corrected typo in myisampack manpage (thanks to Marc Lehmann).
- Closes: #207090
- * Added Catalan debconf translation (thanks to Aleix Badia i Bosch).
- Closes: #236651
-
- -- Christian Hammers <ch@debian.org> Wed, 28 Jul 2004 01:41:51 +0200
-
-mysql-dfsg (4.0.20-6) unstable; urgency=low
-
- * The build arch detected by configure was "pc-linux-gnu (i686)"
- instead of "pc-linux-gnu (i386)". Was no problem AFAIK but
- Adam Majer asked me to explicitly change it to i386. Closes: #261382
- * Removed some unused shell scripts from /usr/share/mysql.
- * Added lintian overrides.
- * Removed rpath by using chrpath.
-
- -- Christian Hammers <ch@debian.org> Mon, 26 Jul 2004 00:17:12 +0200
-
-mysql-dfsg (4.0.20-5) unstable; urgency=medium
-
- * The mysqlcheck in the init script is only called when the server
- is really alive. Also, the mysql-user 'debian-sys-maint' now has
- global select rights (thanks to Nathan Poznick). Closes: #261130
- * Moved the debconf question whether to remove the databases or not
- from mysql-server.config to mysql-server.postrm so that it shows
- up on purge time and not months earlier (thanks to Wouter Verhelst).
- Closes: #251838
-
- -- Christian Hammers <ch@debian.org> Fri, 23 Jul 2004 22:41:13 +0200
-
-mysql-dfsg (4.0.20-4) unstable; urgency=low
-
- * Added a "mysqlcheck -A --fast" to the 'start' section of the
- init script to help admins detect corrupt tables after a server crash.
- Currently it exists with an error message but leaves the server
- running. Feedback appreciated!
- * Made postinst script more robust by calling db_stop earlier and
- so prevent pipe-deadlocks.
- * Fixed minor typos in initscript (thanks to "C.Y.M."). Closes: 259518
- * Added the undocumented "-DBIG_JOINS" that MySQL apparently uses in
- their MAX binaries. It enables 62 instead of 30 tables in a "join".
- (thanks to Dave Rolsky). Closes: #260843
- * Added a "df --portability /var/lib/mysql/." check to the preinst
- script as users experienced hard to kill hanging mysqlds in such
- a situation (thanks to Vaidas Pilkauskas). Closes: #260306
-
- -- Christian Hammers <ch@debian.org> Fri, 23 Jul 2004 00:51:32 +0200
-
-mysql-dfsg (4.0.20-3) unstable; urgency=low
-
- * Improved tolerance if the init script has been deleted (thanks to
- Leonid Shulov for spotting the problem).
- * Minor wording changes to README.Debian generalizing /root/ by $HOME
- (thanks to Santiago Vila). Closes: #257725
- * Added Japanese debconf translation (thanks to Hideki Yamane).
- Closes: #256485
- * Fixed commend in my.cnf regarding logfile directory (thanks to Jayen
- Ashar). Closes: #253434
- * Correted "ease to" by "ease of" in package description (thanks to
- Johannes Berg). Closes: #253510
-
- -- Christian Hammers <ch@debian.org> Fri, 9 Jul 2004 00:57:42 +0200
-
-mysql-dfsg (4.0.20-2) unstable; urgency=low
-
- * Removed RPM .spec file from the included documentation as it is pretty
- useless (thanks to Loic Minier).
- * Added turkish debconf translation (thanks to Recai Oktas). Closes: #252802
-
- -- Christian Hammers <ch@debian.org> Sun, 6 Jun 2004 14:48:26 +0200
-
-mysql-dfsg (4.0.20-1) unstable; urgency=low
-
- * New upstream version.
-
- -- Christian Hammers <ch@debian.org> Mon, 31 May 2004 23:36:39 +0200
-
-mysql-dfsg (4.0.18-8) unstable; urgency=low
-
- * Updated french translation (thanks to Christian Perrier). Closes: #246789
-
- -- Christian Hammers <ch@debian.org> Tue, 4 May 2004 23:26:54 +0200
-
-mysql-dfsg (4.0.18-7) unstable; urgency=low
-
- * Added CVE ids for the recent security fixes.
- 4.0.18-4 is CAN-2004-0381 (mysqlbug) and
- 4.0.18-6 is CAN-2004-0388 (mysql_multi)
-
- -- Christian Hammers <ch@debian.org> Mon, 19 Apr 2004 18:32:03 +0200
-
-mysql-dfsg (4.0.18-6) unstable; urgency=medium
-
- * SECURITY:
- Fixed minor tempfile-run security problem in mysqld_multi.
- Unprivileged users could create symlinks to files which were then
- unknowingly overwritten by run when this script gets executed.
- Upstream informed. Thanks to Martin Schulze for finding this.
-
- -- Christian Hammers <ch@debian.org> Wed, 7 Apr 2004 01:28:22 +0200
-
-mysql-dfsg (4.0.18-5) unstable; urgency=low
-
- * Little improvements in debian scripts for last upload.
- * Added check to logrotate script for the case that a mysql
- server is running but not be accessible with the username and
- password from /etc/mysql/debian.conf (thanks to Jeffrey W. Baker).
- Closes: 239421
-
- -- Christian Hammers <ch@debian.org> Sun, 4 Apr 2004 15:27:40 +0200
-
-mysql-dfsg (4.0.18-4) unstable; urgency=medium
-
- * SECURITY:
- Aplied fix for unprobable tempfile-symlink security problem in
- mysqlbug reported by Shaun Colley on bugtraq on 2004-03-24.
- * Updated french debconf translation (thanks to Christian Perrier).
- Closes: #236878
- * Updated portugesian debconf translation (thanks to Nuno Senica).
- Closes: #239168
- * Updated german debconf translation (thanks to Alwin Meschede).
- Closes: #241749
- * Improved debconf template regarding fix_privileges_tables (thanks
- to Matt Zimmermann for suggestions). Closes: #219400
- * Improved README.Debian regarding to password settings (thanks to
- Yann Dirson). Closes: #241328
-
- -- Christian Hammers <ch@debian.org> Sat, 3 Apr 2004 19:52:15 +0200
-
-mysql-dfsg (4.0.18-3) unstable; urgency=medium
-
- * Added Build-Depend to po-debconf to let it build everywhere.
-
- -- Christian Hammers <ch@debian.org> Wed, 31 Mar 2004 23:43:33 +0200
-
-mysql-dfsg (4.0.18-2) unstable; urgency=low
-
- * Added a "2>/dev/null" to a "which" command as there are two
- "which" versions in Debian of which one needs it. Closes: #235363
-
- -- Christian Hammers <ch@debian.org> Tue, 2 Mar 2004 23:31:28 +0100
-
-mysql-dfsg (4.0.18-1) unstable; urgency=low
-
- * New upstream version.
- * Should now compile and run on ia64 (thanks to Thorsten Werner and
- David Mosberger-Tang). Closes: #226863 #228834
- * Converted init scripts to invoce-rc.d (thanks to Erich Schubert).
- Closes: 232118
- * Secondlast upload changed logfile location. Closes: #182655
- * Updated Brasilian translation (thanks to Andre Luis Lopes). Closes:
- #219847
-
- -- Christian Hammers <ch@debian.org> Tue, 17 Feb 2004 23:44:58 +0100
-
-mysql-dfsg (4.0.17-2) unstable; urgency=low
-
- * Improved manpage for mysqldumpslow.1 (thanks to Anthony DeRobertis).
- Closes: #231039
- * Improved stopping of crashed daemons in init script (thanks to
- Matthias Urlichs). Closes: #230327
-
- -- Christian Hammers <ch@debian.org> Mon, 9 Feb 2004 21:54:29 +0100
-
-mysql-dfsg (4.0.17-1) unstable; urgency=low
-
- * Made logging into /var/log/mysql/ the default. Closes: #225206
-
- * New upstream version. Closes: #225028
- * Turned on a 25MB query cache by default (thanks to Cyril Bouthors).
- Closes: #226789
- * Updated russian translation (thanks to Ilgiz Kalmetev). Closes: #219263
- * Upstream fixes the problem that AND was not commutative (thanks for
- Iain D Broadfoot for mentioning). Closes: #227927
- * Fixed minor typo in my.cnf comments (thanks to James Renken).
- Closes: #221496
- * Better documents regex. Closes: #214952
- * Fixed minor germanism in debconf template (thanks to Marc Haber).
- Closes: #224148
- * Added explaining comment to my.cnf regarding quoted passwords
- (Thanks to Patrick von der Hagen). Closes: #224906
- * Changed "find -exec" to "find -print0 | xargs -0" in preinst to
- speed it up. Thanks to Cyril Bouthors. Closes: #220229
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Jan 2004 16:16:25 +0100
-
-mysql-dfsg (4.0.16-2) unstable; urgency=low
-
- * Tried to repair undefined weak symbols by adding a little Makefile
- patch. Closes: #215973
-
- -- Christian Hammers <ch@debian.org> Mon, 27 Oct 2003 22:52:10 +0100
-
-mysql-dfsg (4.0.16-1) unstable; urgency=low
-
- * New upstream release.
- (Mostly little memory problems and other bugfixes it seems)
- * Replaced "." by ":" in chown calls to comply with the env setting
- "_POSIX2_VERSION=2000112" (thanks to Robert Luberda). Closes: #217399
- * Adjusted syntax in my.cnf to 4.x standard (thanks to Guillaume Plessis).
- Closes: #217273
- * Improved README.Debian password instructions (thanks to Levi Waldron).
- Closes: #215046
- * Improved NIS warning debconf-template (thanks to Jeff Breidenbach).
- Closes: #215791
- * Explicitly added libssl-dev to the libmysqlclient-dev package as it
- is needed for mysql_config and the libmysqlclient package only depends
- on libssl which has no unnumbered .so version (thanks to Simon Peter
- and Davor Ocelic). Closes: #214436, #216162
- * Added "-lwrap" to "mysql_config --libmysqld-libs" and filed it as
- upstream bug #1650 (thanks to Noah Levitt). Closes: #214636
-
- -- Christian Hammers <ch@debian.org> Sat, 25 Oct 2003 01:09:27 +0200
-
-mysql-dfsg (4.0.15a-1) unstable; urgency=low
-
- * Same package as 4.0.15-2 but I could not convince the Debian
- installer to move the packages out of incoming.
-
- -- Christian Hammers <ch@debian.org> Tue, 7 Oct 2003 15:10:26 +0200
-
-mysql-dfsg (4.0.15-2) unstable; urgency=low
-
- * Updated package description (thanks to Adrian Bunk). Closes: #210988
- * Fixed small typos in manpages (thanks to Nicolas Francois).
- Closes: #211983
- * More updates to package description (thanks to Matthias Lutz/ddtp).
- Closes: #213456
- * Updated standards to 3.6.1.
- * Closes "new 4.0.15 available" bug. Closes: #213349
- * Updated README.Debian with notes regarding the MySQL manual section
- "2.4 Post-installation Setup and Testing" (thanks to Daniel B.).
- Closes: #210841
-
- -- Christian Hammers <ch@debian.org> Fri, 3 Oct 2003 15:59:39 +0200
-
-mysql-dfsg (4.0.15-1) unstable; urgency=high
-
- * SECURITY:
- Users who are able to use the "ALTER TABLE" command on the "mysql"
- database may be able to exploit this vulnerability to gain a shell with
- the privileges of the mysql server (usually running as the 'mysql' user).
- Closes: #210403
- * Fixes small description typos (thanks to Oscar Jarkvik).
- * Updated Brazilian Portuguese debconf translation. (thanks to Andre Luis
- Lopes). Closes: 208030
- * Replaced depricated '.' by ':' in chown (thanks to Matt Zimmerman).
- * Fixed manpage typo (thanks to Marc Lehmann). Closes: #207090
-
- -- Christian Hammers <ch@debian.org> Fri, 3 Oct 2003 15:59:35 +0200
-
-mysql-dfsg (4.0.14-1) unstable; urgency=low
-
- * New upstream version.
-
- -- Christian Hammers <ch@debian.org> Sun, 24 Aug 2003 16:40:36 +0200
-
-mysql-dfsg (4.0.13-3) unstable; urgency=low
-
- * Now start mysqld as default unless you choose not when configurig
- with debconf priority low. So packages depending on the server when
- installing can access it. Thanks Matt Zimmermann (Closes: #200277)
- * Made mysql-server de-installable if the config and database files were
- removed by hand before. Thanks to Ard van Breemen (Closes: #200304)
-
- -- Christian Hammers <ch@debian.org> Tue, 8 Jul 2003 22:30:40 +0200
-
-mysql-dfsg (4.0.13-2) unstable; urgency=low
-
- * Added "nice" option for mysqld_safe to give mysqld a different priority.
- Submitted to upstream as MySQL Bug #627. Closes: #192087
- * Fixed possible unbound variable in init script. Closes: #194621
- * Fixed french debconf translation (thx Christian Perrier) Closes: #194739
- * Get rid of automake1.5 (for Eric Dorland).
-
- -- Christian Hammers <ch@debian.org> Wed, 11 Jun 2003 18:58:32 +0200
-
-mysql-dfsg (4.0.13-1) unstable; urgency=medium
-
- * New upstream version.
- !!! Fixes a very bad natural join bug which justifies the urgency=medium.
- !!! http://bugs.mysql.com/bug.php?id=291
- * Fixed mysql_fix_privileges manpage (Frederic Briere) Closes: #191776
- * preinst: "which" is more chatty normal executable than as builtin.
- (Thanks to David B Harris). Closes: #188659
-
- -- Christian Hammers <ch@debian.org> Tue, 6 May 2003 22:03:45 +0200
-
-mysql-dfsg (4.0.12-3) unstable; urgency=medium
-
- * Reincluded new way of creating my debian-sys-maint user from
- an old release from experimental. Now works again with old
- and new privilege table format. (Thanks to Vincent Danjean
- for spotting the problem) Closes: #188201
- * Reincluded hurd build dependency fix from 3.23 branch.
- (Thanks to Robert Millan). Closes: #185929
- * Fixed soname in libmysqlclient-dev. Closes: #188160
- * Remove /var/log/mysql/ when purging the package. Closes: #188064
- * Removed /usr/share/doc/mysql/ from mysql-server. Closes: #188066
- * Let group "adm" be able to read logfiles. Closes: #188067
- * Do not call usermod on every upgrade. Closes: #188248
- (Thanks to Philippe Troin for the last three)
- * Fixed mysql-server.preinst so that it works on shells where
- which is a builtin, too. (Thanks to Erich Schubert) Closes: #181525
-
- -- Christian Hammers <ch@debian.org> Fri, 11 Apr 2003 11:32:45 +0200
-
-mysql-dfsg (4.0.12-2) unstable; urgency=low
-
- *
- * NEW MAJOR UPSTREAM RELEASE:
- *
- MySQL 4 has finally been declared as 'stable'. Hurray! Read changelogs.
- Thanks to all testers, esp. Jose Luis Tallon, of the versions
- that were in the "experimental" section before.
- * Modified postinst script to run mysql_fix_privileges on every update.
- IMPORTANT: Please report if this breaks anything, it is not supposed to.
- * Wrote a SSL-MINI-HOWTO.txt!
- * Added zlib1g-dev to libmysqlclient12-dev. Closes: 186656
- * Changed section of libmysqlclient12-dev to libdevel.
- * Added even more selfwritten manpages.
- * Fixed typos.
-
- -- Christian Hammers <ch@debian.org> Sun, 6 Apr 2003 13:47:32 +0200
-
-mysql-dfsg (4.0.10.gamma-1) experimental; urgency=low
-
- * New upstream version.
- * They merged some of my patches from debian/patches. Whoa!
- * This release should fix the error-logfile problem where mysqld
- keeps the error.log open while logrotate removes it.
-
- -- Christian Hammers <ch@debian.org> Wed, 12 Feb 2003 22:39:48 +0100
-
-mysql-dfsg (4.0.9.gamma-1) experimental; urgency=low
-
- * New upstream version.
- * Updated the GNU autoconf files to make building on MIPS work.
- See bug #176829.
-
- -- Christian Hammers <ch@debian.org> Wed, 29 Jan 2003 22:07:44 +0100
-
-mysql-dfsg (4.0.8.gamma-1) experimental; urgency=low
-
- * New upstream release.
- * Improved logging of init script. Closes: #174790
- * We have now libmysqlclient.so.12 instead of .11.
-
- -- Christian Hammers <ch@debian.org> Thu, 9 Jan 2003 20:14:11 +0100
-
-mysql-dfsg (4.0.7.gamma-1) experimental; urgency=high
-
- * SECURITY: This version fixes an upstream security release that is only
- present in the 4.x branch which is currently only in the
- experimental distribution and therefore will not get a DSA.
- * New upstream release.
-
- -- Christian Hammers <ch@debian.org> Sat, 28 Dec 2002 15:51:39 +0100
-
-mysql-dfsg (4.0.6.gamma-2) experimental; urgency=low
-
- * Added --system to addgroup. Closes: #173866
-
- -- Christian Hammers <ch@debian.org> Sat, 21 Dec 2002 15:28:26 +0100
-
-mysql-dfsg (4.0.6.gamma-1) experimental; urgency=low
-
- * New upstream version. Now Gamma!
- * There are no longer changes to the .orig.tar.gz neccessary to make diff
- happy. docs/ has still to be deleted, although, as it is non-free.
- * Incorporated patches from unstable.
- * Added mysqlmanager and a couple of other new scripts.
- * Enabled libmysqld embedded server library.
- * Enabled SSL and Virtual-IO support.
- (CORBA based MySQL-FS seems to be not existing..)
-
- -- Christian Hammers <ch@debian.org> Fri, 20 Dec 2002 22:30:51 +0100
-
-mysql-dfsg (4.0.5a.beta-3) experimental; urgency=low
-
- * Modified postinst to work with old and new mysql.user table format
- and fixed spelling typo in postinst. Thanks to Roger Aich.
- * Updated config.{guess,sub} to make the mipsel porters happy.
- Thanks to Ryan Murray. Closes: #173553
-
- -- Christian Hammers <ch@debian.org> Wed, 18 Dec 2002 15:56:34 +0100
-
-mysql-dfsg (4.0.5a.beta-2) experimental; urgency=low
-
- * Upstream removed option "--skip-gemini". So did I. Closes: 173142
-
- -- Christian Hammers <ch@debian.org> Tue, 17 Dec 2002 10:35:49 +0100
-
-mysql-dfsg (4.0.5a.beta-1) experimental; urgency=low
-
- * First 4.x experimental package due to continuous user requests :-)
- Please test and report!
- * upstream: safe_mysqld has been renamed to mysqld_safe
- * upstream: new library soname version libmysqlclient.so.11
- * Renamed libmysqlclientXX-dev to libmysqlclient-dev as I don't plan to
- support more than one development environment and this makes the
- dependencies easier.
- * FIXME: Skipped parts of the debian/patches/alpha patch as the global.h
- is not existing.
- * FIXME: How to get rid this? Old ltconfig patch already applied.
- "lintian: binary-or-shlib-defines-rpath ./usr/bin/mysql /usr/lib/mysql"
-
- -- Christian Hammers <ch@debian.org> Sun, 1 Dec 2002 18:32:32 +0100
-
-mysql-dfsg (3.23.53-4) unstable; urgency=medium
-
- * Fixed errno.h problem. Closes: #168533, #168535
-
- -- Christian Hammers <ch@debian.org> Sun, 10 Nov 2002 18:32:08 +0100
-
-mysql-dfsg (3.23.53-3) unstable; urgency=medium
-
- * Changed automake build-dep to unversioned automake1.4. Closes: #166391
- * Fixed description. Closes: #167270
- (Thanks to Soren Boll Overgaard)
-
- -- Christian Hammers <ch@debian.org> Tue, 5 Nov 2002 01:25:01 +0100
-
-mysql-dfsg (3.23.53-2) unstable; urgency=low
-
- * Reverted user creation in init scripts. Closes: #166432
- (Thanks to Birzan George Cristian)
-
- -- Christian Hammers <ch@debian.org> Thu, 31 Oct 2002 15:36:25 +0100
-
-mysql-dfsg (3.23.53-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Christian Hammers <ch@debian.org> Thu, 24 Oct 2002 23:04:16 +0200
-
-mysql-dfsg (3.23.52-3) unstable; urgency=low
-
- * Substituted the first-install 'debian-sys-maint' user creation by
- something ANSI SQL compliant. Closes: #163497
- (Thanks to Karl Hammar)
- * Tightend dependency to debhelper (>= 4.0.12) to be sure that
- debconf-utils gets installed, too, as I use dh_installdebconf.
- * Fixed upstream manpage bug in mysqldump.1. Closes: #159779
- (Thanks to Colin Watson)
- * Added comment about MIN_WORD_LEN to mysql-server.README.Debian
- (Thanks to Philipp Dreimann)
- * Added a dependency for zlib1g-dev to libmysqlclient10-dev.
- (Thanks to Jordi Mallach)
-
- -- Christian Hammers <ch@debian.org> Sun, 15 Sep 2002 17:14:44 +0200
-
-mysql-dfsg (3.23.52-2) unstable; urgency=low
-
- * Fixed typo in preinst scripts.
- * Removed bashism in init script.
- * Fixed ambiguous debconf example. Closes: #158884
-
- -- Christian Hammers <ch@debian.org> Fri, 30 Aug 2002 00:51:29 +0200
-
-mysql-dfsg (3.23.52-1) unstable; urgency=low
-
- * New upstream version. Closes: #157731
- * Clearified the meaning of the debian-sys-maint special user in the
- README.Debian file. Closes: #153702
- * Wrote some words regarding the skip-networking in README.Debian.
- Closes: #157038
- * Added dependency to passwd.
- * Fixes typo and unnecessarily complication in is_mysql_alive().
- * Added check for /etc/mysql/my.cnf in init script.
-
- -- Christian Hammers <ch@debian.org> Tue, 27 Aug 2002 01:53:32 +0200
-
-mysql-dfsg (3.23.51-4) unstable; urgency=low
-
- * Added a compressed "nm mysqld" output to allow people to trace
- core dumps with /usr/bin/resolve_stack_dump as suggested in the
- INSTALL-SOURCE file. Thanks to atudor@labs.agilent.com for the hint.
-
- -- Christian Hammers <ch@debian.org> Wed, 24 Jul 2002 20:44:55 +0200
-
-mysql-dfsg (3.23.51-3) unstable; urgency=low
-
- * Corrected copyright file: the MySQL client library is licenced under
- the LGPL-2 not the GPL. From version 4.x it actually will be GPL this
- is why parts of http://www.mysql.com/ already say so. Closes: #153591
- * Corrected german translation.
- Thanks to Roland Rosenfeld <roland@spinnaker.de>. Closes: #151903
-
- -- Christian Hammers <ch@debian.org> Thu, 11 Jul 2002 20:32:28 +0200
-
-mysql-dfsg (3.23.51-2) unstable; urgency=low
-
- * Improved NIS tolerance in preinst script.
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Jul 2002 04:43:28 +0200
-
-mysql-dfsg (3.23.51-1) unstable; urgency=medium
-
- * New upstream version.
- * I applied a patch that fixes a binary imcompatibility in
- the shared libary libmysqlclient.so.10 between 3.23.50 and
- some versions earlier. Upstream has been contacted and asked
- for clarification. Closes: #149952
- * Added support for NIS i.e. it shows a warning and fails if the
- needed 'mysql' user does not exists but works if it does.
- Closes: #143282, #147869
- * Substituted $0 in init scripts by something really weird so that
- "./S20mysql restart" works now, too. (BTW: S20? install file-rc!!!)
- Closes: #148658
- * Now postinst works even if /etc/init.d/mysql is removed. Closes: #151021
- * Decided to leave "set +x" in postinst but wrote comment. Closes: #151022
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Jul 2002 04:43:25 +0200
-
-mysql-dfsg (3.23.50-1) unstable; urgency=medium
-
- * New upstream version.
- Fixes a very annoying and important bug that lets all mysql programs
- including perl scripts etc. segfault when using the read_default_group()
- function. 3.23.50 is currently a pre-release and expected to be released
- next week. I plan to propose it for woody as soon as its stability has
- been proven. The following bug reports are all regarding this issue.
- Closes: #144960, #145322, #136798, #138143,
-
- -- Christian Hammers <ch@debian.org> Sat, 18 May 2002 21:14:01 +0200
-
-mysql-dfsg (3.23.49x-1) unstable; urgency=low
-
- * I had to split the package to seperate the manual as it is not GPL
- like the rest of the software and docs but under a license that
- e.g. forbids selling printed versions.
- .
- The upstream authors were contacted a while ago but did not like to
- change the situation.
- .
- The names of the resulting packages have not changed as the manual
- already was in a seperate mysql-doc package due to it's size.
- The source packages are now splitted from one "mysql" to
- "mysql-dfsg" in main and "mysql-nonfree" in non-free.
- * No code change!
- The "x" at the end of the version number ist just to be able to
- upload a new source package. ("a" was already taken by upstream
- for their binary upload correction)
-
- -- Christian Hammers <ch@debian.org> Wed, 8 May 2002 02:01:41 +0200
-
-mysql (3.23.49-8) unstable; urgency=low
-
- * Substituted $0 in init script to let e.g. "/etc# ./init.d/mysql restart"
- works, too. Closes: #141555
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Apr 2002 15:00:44 +0200
-
-mysql (3.23.49-7) unstable; urgency=low
-
- * The Makefiles are totally broken for the --enable-local-infile
- option. I now patched libmysql/libmysql.c#mysql_init() manually.
- Closes: #138347
-
- -- Christian Hammers <ch@debian.org> Fri, 29 Mar 2002 23:55:15 +0100
-
-mysql (3.23.49-6) unstable; urgency=low
-
- * Moved mysqlcheck from server to client package. Closes: #139799
- * Added manpage for mysqlhotcopy. Regarding: #87097
- * Added 'sharedscripts' directive to the logrotate script.
- * Replaced grep by /usr/bin/getent to let the group/user checking work
- on NIS/LDAP systems, too. Closes: #115677, #101529
-
- -- Christian Hammers <ch@debian.org> Fri, 22 Mar 2002 22:40:51 +0100
-
-mysql (3.23.49-5) unstable; urgency=low
-
- * Added skip-innodb to default my.cnf.
- * Enabled --enable-local-infile, it seems to be a new option that
- defaults to disable a formerly enabled feaure. Closes: #137115
-
- -- Christian Hammers <ch@debian.org> Sat, 16 Mar 2002 00:29:10 +0100
-
-mysql (3.23.49-4) unstable; urgency=medium
-
- * Recompiled against fixed libz.
-
- * Enabled --enable-local-infile, it seems to be a new option that
- defaults to disable a formerly enabled feaure. Closes: #137115
- * Fixed README.compile_on_potato. Closes: #136529
- * Now a ext3 .jounal file in /var/lib/mysql does not prevent the
- installation (happens when creating a jounal on an already mounted
- partition). Closes: #137146
-
- -- Christian Hammers <ch@debian.org> Wed, 13 Mar 2002 13:34:24 +0100
-
-mysql (3.23.49-3) unstable; urgency=low
-
- * Added Russian translation. Closes: #135846
- * Fixed installation of .info documents. Closes: #135030
-
- -- Christian Hammers <ch@debian.org> Wed, 27 Feb 2002 23:36:35 +0100
-
-mysql (3.23.49-2) unstable; urgency=low
-
- * Updated french translation and split template files. Closes: #134754
- * Fixed a small debian.cnf related bug in mysql-server.postinst.
-
- -- Christian Hammers <ch@debian.org> Tue, 19 Feb 2002 23:13:58 +0100
-
-mysql (3.23.49-1) unstable; urgency=low
-
- * New upstream release.
- (Mainly InnoDB related fixes)
- * Exported a $HOME variable in the scripts so that /root/.my.cnf
- is not read anymore. This will avoid problems when admins put
- only passwords but no usernames in this file. Closes: #132048
- * New debian-sys-maint password algorithm (now ~96bit :-)) Closes: #133863
- * Recreating debian-sys-main pwd on every install to help people who
- accidently delete user or password files...
- * Added /var/log/mysql so that user can put the binary logs in there as
- mysql cannot write the .001 etc files itself in /var/log which is
- owned by root.
-
- -- Christian Hammers <ch@debian.org> Thu, 14 Feb 2002 22:17:45 +0100
-
-mysql (3.23.47-6) unstable; urgency=low
-
- * Dropped a sentence about the new debian-sys-maint user in the
- debconf note and updated the README.Debian. Related: #132048
- * Added more french translation. Closes: #132390
-
- -- Christian Hammers <ch@debian.org> Wed, 6 Feb 2002 09:41:29 +0100
-
-mysql (3.23.47-5) unstable; urgency=low
-
- * Fixed grammar error in template. Closes: #132238
- * Really fixed typo in logrotate script. Closes: #131711
-
- -- Christian Hammers <ch@debian.org> Tue, 5 Feb 2002 14:20:08 +0100
-
-mysql (3.23.47-4) unstable; urgency=medium
-
- * Fixes typo in postinst that let init script fail. Closes: #131743
- * Fixed bashism bug that failed on ash. Closes: #131697
- * Fixed typo in logrotate script. Closes: #131711
-
- -- Christian Hammers <ch@debian.org> Thu, 31 Jan 2002 23:58:46 +0100
-
-mysql (3.23.47-3) unstable; urgency=low
-
- * Added new Debian specific mysql user called 'debian-sys-maint' which
- is used for pinging the server status, flushing the logs or shutting
- down the server in maintenance scripts. The credentials of this user
- are stored in the UID0-only readable file /etc/mysql/debian.cnf.
- Closes: #129887, #130326, #99274
- * Fixed unintended server startup at boottime. Closes: #122676, #130105
- * New upstream fixes command line parsing bug: Closes: #128473
- * Fixed manpage headers to let apropos work: Closes: #119122
- * Added "status" options for /etc/init.d/mysql. Closes: #129020
-
- -- Christian Hammers <ch@debian.org> Sun, 27 Jan 2002 19:46:11 +0100
-
-mysql (3.23.47-2) unstable; urgency=low
-
- * Enhanced init scripts by using mysqladmin instead of kill $pid.
- Thanks to Aaron Brick.
-
- -- Christian Hammers <ch@debian.org> Fri, 18 Jan 2002 01:42:23 +0100
-
-mysql (3.23.47-1) unstable; urgency=low
-
- * New upstream release.
- * Updated brazilian translation of debconf descriptions. Closes: #123332
-
- -- Christian Hammers <ch@debian.org> Sun, 6 Jan 2002 21:11:17 +0100
-
-mysql (3.23.46-3) unstable; urgency=low
-
- * Fixed bug in postinst where a script was accidently called with
- "bash -c <script> -IN_RPM" prevting the first argument to take effect
- and then leading to failures on hosts with unresolvable hostnames.
- Closes: #126147
- * Small changes and comments in postinst.
-
- -- Christian Hammers <ch@debian.org> Sat, 22 Dec 2001 14:03:02 +0100
-
-mysql (3.23.46-2) unstable; urgency=low
-
- * Start/stop behaviour now configurable via debconf. Closes: #112174
-
- -- Christian Hammers <ch@debian.org> Sun, 9 Dec 2001 21:38:54 +0100
-
-mysql (3.23.46-1) unstable; urgency=low
-
- * New upstream release.
- Only few fixes, mainly innodb related.
-
- -- Christian Hammers <ch@debian.org> Sun, 2 Dec 2001 03:08:48 +0100
-
-mysql (3.23.45-1) unstable; urgency=low
-
- * New upstream version.
- Only few fixes, mainly innodb related.
- * Added debconf note regarding the skip-networking option.
-
- -- Christian Hammers <ch@debian.org> Sun, 25 Nov 2001 16:50:37 +0100
-
-mysql (3.23.44-2) unstable; urgency=low
-
- * Finally removed debconf toggled "skip-networking" line add/remove
- code for /etc/mysql/my.cnf. I don't like editing a file that's tagged
- as configuration file.
- I disabled networking by default for security reasons. Better ideas?
-
- -- Christian Hammers <ch@debian.org> Fri, 16 Nov 2001 02:11:02 +0100
-
-mysql (3.23.44-1) unstable; urgency=low
-
- * New upstream release.
- - fixes replication bug (core dump)
- * Made description better english :) Thanks to D. Welton.
-
- -- Christian Hammers <ch@debian.org> Sun, 11 Nov 2001 15:44:07 +0100
-
-mysql (3.23.43-4) unstable; urgency=low
-
- * Disabled statically linking.
-
- -- Christian Hammers <ch@debian.org> Sat, 10 Nov 2001 03:15:56 +0100
-
-mysql (3.23.43-3) unstable; urgency=low
-
- * Changed compiler settings after one user reported instabilities.
- See #116631 for more information.
-
- -- Christian Hammers <ch@debian.org> Tue, 30 Oct 2001 21:39:17 +0100
-
-mysql (3.23.43-2) unstable; urgency=low
-
- * Patched sparc mutexes again. Closes: #113430
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Oct 2001 15:09:00 +0200
-
-mysql (3.23.43-1) unstable; urgency=low
-
- * New upstream version.
- - Fixed some unlikely(sic!) bugs and core dumps.
- - Fixed a bug with BDB tables and UNIQUE columns that are NULL.
- - [more minor bugs were fixed; see changelog]
- * Adjusted build depends on libwrap0 for IA-64. Closes: #114582
- * Added the mysqlcheck binary. Closes: #114490
- * Fixed rules for arm architecture. Closes: #88186
- * Renamed mysql_print_defaults to the original name my_print_defaults.
- Isn't as descriptive but else I'd have to patch too much. Closes: #114492
-
- -- Christian Hammers <ch@debian.org> Fri, 5 Oct 2001 22:24:40 +0200
-
-mysql (3.23.42-2) unstable; urgency=low
-
- * Applied patch for m68k compile. Closes: #112904
-
- -- Christian Hammers <ch@debian.org> Sun, 23 Sep 2001 21:32:57 +0200
-
-mysql (3.23.42-1) unstable; urgency=low
-
- * New upstream releae.
- Fixes critical bug with InnoDB and large BLOBs.
-
- -- Christian Hammers <ch@debian.org> Tue, 18 Sep 2001 22:25:47 +0200
-
-mysql (3.23.41-2) unstable; urgency=low
-
- * Fixed shlibs.local problem. Closes: #111573
- * Replaced emacs by sensible-editor in mysqlbug.sh. Thanks Hans Ginzel.
-
- -- Christian Hammers <ch@debian.org> Sun, 9 Sep 2001 17:16:42 +0200
-
-mysql (3.23.41-1) unstable; urgency=low
-
- * New upstream release
- * Fixed build problem on ia64. Closes: #110624
-
- -- Christian Hammers <ch@debian.org> Tue, 14 Aug 2001 23:20:35 +0200
-
-mysql (3.23.40-1) unstable; urgency=low
-
- * New upstream release
-
- -- Christian Hammers <ch@debian.org> Sun, 5 Aug 2001 19:46:18 +0200
-
-mysql (3.23.39-5) unstable; urgency=low
-
- * Added debconf template for brazil. Closes: #106934, #106752
- * Tightened dependencies on debconf.
- * Adjusted mysql.err permissions in logrotate script to 0600. Closes: #105672
-
- -- Christian Hammers <ch@debian.org> Mon, 30 Jul 2001 00:10:12 +0200
-
-mysql (3.23.39-4.1) unstable; urgency=low
-
- * Maintainer-requested NMU.
- * Fixing thread mutexes on Sparc and Alpha
- (closes: Bug#101783)
- * Added --enable-assembler for sparc. This should
- allow mysql on sparc to use assembler versions of
- some string functions (read: should speed up a bit).
-
- -- Christopher C. Chimelis <chris@debian.org> Fri, 13 Jul 2001 15:09:30 -0400
-
-mysql (3.23.39-4) unstable; urgency=low
-
- * Porting fixes.
-
- -- Christian Hammers <ch@debian.org> Mon, 9 Jul 2001 17:56:54 +0200
-
-mysql (3.23.39-3.1) unstable; urgency=low
-
- * NMU (for porting)
- * Update config.sub and config.guess for hppa, sh & s390.
- * Add --with-client-ldflags=-lstdc++ to configure line. Closes: #100884
-
- -- Matthew Wilcox <willy@debian.org> Sun, 8 Jul 2001 19:26:59 -0600
-
-mysql (3.23.39-3) unstable; urgency=low
-
- * Disabled berkeley-db on sparc again. Mutexes aren't working again :-(
-
- -- Christian Hammers <ch@debian.org> Sat, 7 Jul 2001 18:30:08 +0200
-
-mysql (3.23.39-2) unstable; urgency=low
-
- * Bugfixed the m68k mutex patch. Thanks to Michael Fedrowitz. Closes: #103145
- * Removed config.cache files in bdb/ and innobase/. Closes: #103143
-
- -- Christian Hammers <ch@debian.org> Wed, 4 Jul 2001 22:06:58 +0200
-
-mysql (3.23.39-1) unstable; urgency=low
-
- * New upstream release. Minor bugfixes only.
-
- -- Christian Hammers <ch@debian.org> Thu, 14 Jun 2001 13:53:03 +0200
-
-mysql (3.23.38-4) unstable; urgency=low
-
- * Added logcheck files. Closes: #99131
- (I can't let the usermod away since I don't know of an easy way to
- retrive "passwd" information in a shell script considering that
- people use different storage methods like LDAP/NIS instead of passwd.)
-
- -- Christian Hammers <ch@debian.org> Fri, 8 Jun 2001 21:04:25 +0200
-
-mysql (3.23.38-3) unstable; urgency=low
-
- * Explicit pointet to /root/.my.cnf to let /etc/init.d/mysql stop
- work in sudo environments with $HOME!=/root work, too. Closes: #98324
- * Removes empty /etc/mysql on purge. Closes: #98164
-
- -- Christian Hammers <ch@debian.org> Tue, 22 May 2001 10:13:06 +0200
-
-mysql (3.23.38-2) unstable; urgency=low
-
- * Added depends to libdbd-mysql-perl for mysql-server. Closes: #94306
-
- -- Christian Hammers <ch@debian.org> Sat, 19 May 2001 19:43:26 +0200
-
-mysql (3.23.38-1) unstable; urgency=low
-
- * New upstream release.
- * Added Build-Depends to procps. Closes: #96768
-
- -- Christian Hammers <ch@debian.org> Sun, 13 May 2001 17:30:15 +0200
-
-mysql (3.23.37-5) unstable; urgency=low
-
- * Applied mutex patch for bdb support on m68k.
- Thanks to Michael Fedrowitz for the patch.
-
- -- Christian Hammers <ch@debian.org> Mon, 7 May 2001 12:30:40 +0200
-
-mysql (3.23.37-4) unstable; urgency=low
-
- * Enable bdb support for m68k architecture.
-
- -- Christian Hammers <ch@debian.org> Sat, 5 May 2001 16:47:36 +0200
-
-mysql (3.23.37-3) unstable; urgency=low
-
- * Added thread-safe client library. Thanks to Shane Wegner. Closes: #95441
-
- -- Christian Hammers <ch@debian.org> Sat, 28 Apr 2001 09:45:00 -0400
-
-mysql (3.23.37-2) unstable; urgency=low
-
- * Added sparc to the list of BDB supporting architectures after some
- tests on vore.debian.org and mails with Ben Collons.
-
- -- Christian Hammers <ch@debian.org> Fri, 27 Apr 2001 09:30:09 -0400
-
-mysql (3.23.37-1) unstable; urgency=low
-
- * New upstream version.
- * Added gemini table support.
- * Does anybody know how to enable SSL?
- * Fixed ARM compilation problem. Closes: #88186
-
- -- Christian Hammers <ch@debian.org> Sat, 21 Apr 2001 11:48:46 -0400
-
-mysql (3.23.36-2) unstable; urgency=low
-
- * Added patch by Christopher C. Chimelis <chris@debian.org> to make
- Berkeley db3 work again on Alpha architecture. Closes: #92787
-
- -- Christian Hammers <ch@debian.org> Tue, 3 Apr 2001 23:41:46 +0200
-
-mysql (3.23.36-1) unstable; urgency=high
-
- * New upstream version.
- * SECURITY FIX: One could place database tables outside the database
- directory by using '..' in one of the mysql helper programs where the
- table name was not checked correctly. This could lead to root compromise
- if the server would be running as root else you could at least do bad
- things as user mysql.
- * upstream: Fixed bug when thread creation failed.
- * upstream: Fixed problem in Innobase with non-latin1 charsets
- * upstream: Fixed a core-dump bug when using very complex query with DISTINGT
- * upstream: many others so called minor bugs...
- * fixes bug in init script. Closes: #90257
- (this report was agains some older problem that has been fixed too in .33)
-
- -- Christian Hammers <ch@debian.org> Fri, 30 Mar 2001 02:55:12 +0200
-
-mysql (3.23.35-1) unstable; urgency=medium
-
- * New upstream relase.
- * Fixes problem in ORDER BY clause. People using 3.33.34 should upgrade!
- * Includes innobase support.
- (Hope this is not such a catastrophe like berkeley db...)
-
- -- Christian Hammers <ch@debian.org> Fri, 16 Mar 2001 23:30:30 +0100
-
-mysql (3.23.33-3) unstable; urgency=low
-
- * Forgot #!/bin/sh at top of mysql-doc.postinst. Closes: #89801
-
- -- Christian Hammers <ch@vore.debian.org> Thu, 15 Mar 2001 20:38:35 -0500
-
-mysql (3.23.33-2) unstable; urgency=low
-
- * Added some missing scripts and manpages. Closes: #84068
- * Added dependency to perl-5.6. Closes: #81942
- * Added french templates somewhen ago. Closes: #83790
- * Added patch to get db3 working on Alpha. Closes: #86033
- Thanks to Christopher C. Chimelis <chris@debian.org>. The patch
- itself is included as debian/patch.alpha, too.
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Feb 2001 06:40:40 +0100
-
-mysql (3.23.33-1) unstable; urgency=high
-
- * Fixes two security bugs that allowes crashing the server and maybe
- gaining the UID of the process that is linked against libmysqlclient!
-
- -- Christian Hammers <ch@debian.org> Tue, 13 Feb 2001 23:01:18 +0100
-
-mysql (3.23.32-1) unstable; urgency=low
-
- * New upstream releaes.
- (just minor fixes)
- * Added french and german debconf templates.
-
- -- Christian Hammers <ch@debian.org> Sun, 4 Feb 2001 17:27:07 +0100
-
-mysql (3.23.31-1) unstable; urgency=high
-
- * New upstream release.
- * Fixes security bug that was announced at BUGTRAQ mailing list.
- (Disappointingly not by mysql.com!). And allows a buffer overflow
- and therefore access to the mysql UID and all databases when already
- having a valid account. Closes: #82881
-
- -- Christian Hammers <ch@debian.org> Sat, 20 Jan 2001 11:14:36 +0100
-
-mysql (3.23.30-2) unstable; urgency=low
-
- * Recompiled with new dpkg-dev.
-
- -- Christian Hammers <ch@debian.org> Sun, 14 Jan 2001 22:20:55 +0100
-
-mysql (3.23.30-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Christian Hammers <ch@debian.org> Sun, 7 Jan 2001 22:10:18 +0100
-
-mysql (3.23.28-10) testing unstable; urgency=low
-
- * I must upload to "testing" to get it into woody, right?!
-
- -- Christian Hammers <ch@debian.org> Fri, 29 Dec 2000 14:43:57 +0100
-
-mysql (3.23.28-9) unstable; urgency=low
-
- * Made it a replacement for libmysqlclient9.
-
- -- Christian Hammers <ch@westend.com> Mon, 25 Dec 2000 19:15:04 +0100
-
-mysql (3.23.28-8) unstable; urgency=low
-
- * Applied patch from a user to get the skip-networking option working!
- Approved from a mysql employee but please test anyways.
- This finally: Closes: #79672, #78634, #79660, #79658
-
- -- Christian Hammers <ch@debian.org> Sat, 16 Dec 2000 14:01:36 +0100
-
-mysql (3.23.28-6) unstable; urgency=medium
-
- * Fixed error in postinst. Closes: #79392, #79400, #79451, #79550
- * Added .info files again on user request. Closes: #78988, #75737
-
- -- Christian Hammers <ch@debian.org> Wed, 13 Dec 2000 21:18:24 +0100
-
-mysql (3.23.28-5) unstable; urgency=low
-
- * Fixed a stupid bug in mysql-server.postinst regarding the
- configuration of skip-networking. Closes: #78639, 78634
- * Used patched bdb which hopefully enables mutexes on Alpha. Closes: #78197
- * Added dependency to adduser. Closes: #76798
-
- -- Christian Hammers <ch@debian.org> Sun, 10 Dec 2000 16:55:48 +0100
-
-mysql (3.23.28-4) unstable; urgency=low
-
- [never uploaded]
- * Fixed a stupid bug in mysql-server.postinst regarding the
- configuration of skip-networking. Closes: #78639, 78634
- * Used patched bdb which hopefully enables mutexes on Alpha. Closes: #78197
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Dec 2000 17:49:44 +0100
-
-mysql (3.23.28-3) unstable; urgency=low
-
- * This time really fixed m68k build error. Closes: #78235
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Dec 2000 15:02:55 +0100
-
-mysql (3.23.28-2) unstable; urgency=low
-
- * Adjusted rules file to make it buildable on m86k. Closes: #78235
-
- -- Christian Hammers <ch@debian.org> Fri, 1 Dec 2000 20:07:26 +0100
-
-mysql (3.23.28-1) unstable; urgency=low
-
- * New upstream vesrion. Now gamma!
- * Changed umask of mysql.log making it o-rw
- * Disabled listening on network reachable TCP ports by default due to
- security considerations.
-
- -- Christian Hammers <ch@debian.org> Thu, 23 Nov 2000 20:12:50 +0100
-
-mysql (3.23.27-1) unstable; urgency=low
-
- * New upstream version.
- * Closes: #75711
-
- -- Christian Hammers <ch@debian.org> Sun, 29 Oct 2000 14:29:51 +0100
-
-mysql (3.23.25-4) unstable; urgency=low
-
- * Recompiled to get rid of the dependency for zlib1 (libc5).
- Closes: #74952, #74939
-
- -- Christian Hammers <ch@debian.org> Tue, 17 Oct 2000 14:34:52 +0200
-
-mysql (3.23.25-3.1) unstable; urgency=low
-
- * Maintainer-approved NMU.
- * Includes patch to fix and enable db3 support on Alpha.
- * Enable support for thread mutexes in db3 on sparc
- (it works after all, according to Ben Collins)
- * Removed atomic_ functions for Alpha since they are no
- longer supported in the current glibc in woody.
- * Cleaned up rules file a bit.
-
- -- Christopher C. Chimelis <chris@debian.org> Sat, 14 Oct 2000 04:22:02 -0400
-
-mysql (3.23.25-3) unstable; urgency=low
-
- * Upstream decided not to include my_config.h,my_dir.h into the installed
- header files. As this file contains at least informative material
- and more important is checked by several autoconf scripts I
- included it by hand again.
- * Made building of berkeley db conditional to architecture until
- I get response whether it works on sparc/alpha now.
-
- -- Christian Hammers <ch@debian.org> Wed, 11 Oct 2000 23:58:38 +0200
-
-mysql (3.23.25-2) unstable; urgency=medium
-
- * Last build went terrible wrong.. Here's the changelog again:
- * New upstream release.
- * Shared library version was raised from 9 to 10.
- Maintainers of packets using libmysqlclient9 must recompile!
-
- -- Christian Hammers <ch@debian.org> Wed, 11 Oct 2000 01:16:34 +0200
-
-mysql (3.23.25-1) unstable; urgency=low
-
- * New upstream release.
- * Shared library version was raised from 9 to 10.
- Maintainers of packets using libmysqlclient9 must recompile!
-
- -- Christian Hammers <ch@debian.org> Sat, 7 Oct 2000 18:21:51 +0200
-
-mysql (3.23.24-2) unstable; urgency=low
-
- * Applied upstream patch regarding quoting of mysqldump.
- * Updated to db-3.1.17-patched (from www.mysql.com)
-
- -- Christian Hammers <ch@debian.org> Fri, 15 Sep 2000 18:58:14 +0200
-
-mysql (3.23.24-1) unstable; urgency=medium
-
- * New upstream version with some important fixes.
- * upstream: Last version corrupted CHAR/VARCHAR/BLOB columns with
- chararacters above ASCII 128! Check and repair all these tables.
- * upstream: fixed small memory leak
- * upstream: fixed problem with BDB tables and reading on unique
- (not primary) key.
- * Disabled BDB tables on all architectures except i386 due to many
- bug reports (see #71206). -> HELP APPRECIATED <-
-
- -- Christian Hammers <ch@debian.org> Tue, 12 Sep 2000 06:18:54 +0200
-
-mysql (3.23.23-2) unstable; urgency=low
-
- * Strange... "nohup nice" gives differnet results and let therefore
- crash safe_mysqld when starting up. Apparently it seems to be
- kernel dependand. Now fixed by another conditional. This
- more or less Closes: #71057
- * This bug was reported (accidently) in the following identical reports:
- Closes: #71253, #71254, #71257, #71258, #71259, #71262, #71266, #71267
- Closes: #71268, #71271, #71275, #71277, #71278, #71283, #71291
-
- -- Christian Hammers <ch@debian.org> Sat, 9 Sep 2000 20:13:50 +0200
-
-mysql (3.23.23-1) unstable; urgency=low
-
- * New upstream version. Feature freeze!
- * Fixed source build problem. Closes: #70707
-
- -- Christian Hammers <ch@debian.org> Thu, 31 Aug 2000 10:03:35 +0200
-
-mysql (3.23.22b-1) unstable; urgency=low
-
- * Reorganised docs. Now we have several small html files instead of
- one with almost 2M. Closes: 70431
- * Removed pdf,ps and html from source package shrinked it about 3M
- (therefore the .orig.tar.gz is called 3.23.22b!)
- * -> Last upload failed due to problems at the FTP site so here the
- -> changelog again:
- * Fixes memory leak, commit/rollback, reserved word "MASTER" ...
- * Added Berkeley DB3 source code to the Debian diff to be able to
- compile with bdb transaction support! (Great feature!!!)
- * Upstream correction of error message. Closes: #68939
- * Upstream correction of reserved word "source".
-
- -- Christian Hammers <ch@debian.org> Fri, 25 Aug 2000 19:21:24 +0200
-
-mysql (3.23.22-1) unstable; urgency=low
-
- * New upstream version.
- * Fixes memory leak, commit/rollback, reserved word "MASTER" ...
- * Added Berkeley DB3 source code to the Debian diff to be able to
- compile with bdb transaction support! (Great feature!!!)
- * Upstream correction of error message. Closes: #68939
- * Upstream correction of reserved word "source".
-
- -- Christian Hammers <ch@debian.org> Sun, 20 Aug 2000 09:05:48 +0200
-
-mysql (3.23.21-4) unstable; urgency=low
-
- * Added libmysqlclient9.shlibs and shlibs.local file. Closes: #68669
-
- -- Christian Hammers <ch@debian.org> Wed, 9 Aug 2000 14:22:49 +0200
-
-mysql (3.23.21-3) unstable; urgency=low
-
- * Let "/etc/init.d/mysql restart" wait until the pid has been
- removed before (but max 6 seconds) before restarting. Closes: 65070
- * Added build dependencies.
-
- -- Christian Hammers <ch@debian.org> Sun, 30 Jul 2000 16:16:48 +0200
-
-mysql (3.23.21-2) unstable; urgency=low
-
- * Typo in safe_mysqld prevents start.
-
- -- Christian Hammers <ch@debian.org> Sat, 29 Jul 2000 13:40:50 +0200
-
-mysql (3.23.21-1) unstable; urgency=low
-
- * New upstream version.
-
- -- Christian Hammers <ch@debian.org> Mon, 10 Jul 2000 22:54:17 +0200
-
-mysql (3.23.20-1) unstable; urgency=low
-
- * MySQL finally got fully GPL'ed! This means that there is only one
- souce package and only main/* binary packages from now on.
- * Fixed symlink in libmysqlclient9-dev. Closes: 66452
- * Apart from that the usual bug fixes for BETA software.
-
- -- Christian Hammers <ch@debian.org> Mon, 3 Jul 2000 20:05:38 +0200
-
-mysql-pd (3.23.16-1) unstable; urgency=low
-
- * New upstream release. (Actually a brand new upstream branch!)
- * Added mysql-common package as the configuration file can be used
- by all versions of the mysql client library.
- Did some more package reorganisations, too. See README.Debian file!
- * libmysqlclient.so raised major version from 6 to 9.
- * Minor beautifications in the debian/ directory.
-
- -- Christian Hammers <ch@debian.org> Sat, 27 May 2000 20:30:01 +0200
-
-mysql-gpl (3.22.30-2) frozen unstable; urgency=low
-
- * Fixed path in libmysqlclient.la. Closes: #58875
-
- -- Christian Hammers <ch@debian.org> Sat, 25 Jan 2000 20:27:29 -0700
-
-mysql-gpl (3.22.30-1) frozen unstable; urgency=low
-
- * A small change in the libmysqlclient6 causes mysqladmin to print an
- shared library error when displaying the defaults. Everything else
- works fine so this error wasn't detected untill now. Closes: #58033
- * TcX released a new MySQL version that includes another security patch,
- this time against mysqlaccess. The author told me that it would be
- fine if I just included the new .c in this source since I don't want
- go to 3.22.32 in frozen.
- * ->Release Manager: Although the version number increased there is
- no new coded except for the shared library. The rest is the same
- as in mysql-server and mysql-client.
-
- -- Christian Hammers <ch@debian.org> Tue, 15 Feb 2000 23:26:54 +0100
-
-mysql-gpl (3.22.29-1) unstable; urgency=low
-
- * New upstream version.
-
- -- Christian Hammers <ch@debian.org> Thu, 6 Jan 2000 20:37:23 +0100
-
-mysql-gpl (3.22.27a-3) unstable; urgency=low
-
- * Use system readline instead of bundled version. Closes: #50069
- Any objections ?
-
- -- Christian Hammers <ch@debian.org> Sun, 14 Nov 1999 18:09:48 +0100
-
-mysql-gpl (3.22.27a-2) unstable; urgency=low
-
- * Now building mysql-gpl-doc in binary-indep.
-
- -- Christian Hammers <ch@debian.org> Sat, 23 Oct 1999 04:22:36 +0200
-
-mysql-gpl (3.22.27a-1) unstable; urgency=low
-
- * Adjusted version number to allow new orig.tar.gz.
- The old seems broken :-( People reported compilation problems.
- * Changed mysql-gpl-doc to "Architecture: all".
-
- -- Christian Hammers <ch@debian.org> Sun, 17 Oct 1999 13:01:35 +0200
-
-mysql-gpl (3.22.27-1) unstable; urgency=low
-
- * New upstream release. Fixes charset problem.
-
- -- Christian Hammers <ch@debian.org> Mon, 11 Oct 1999 18:01:40 +0200
-
-mysql-gpl (3.22.26a-1) unstable; urgency=low
-
- * New upstream version. Just some small bug fixes.
- * FHS compliance.
-
- -- Christian Hammers <ch@debian.org> Sun, 3 Oct 1999 10:16:14 +0200
-
-mysql-gpl (3.22.25-2) unstable; urgency=low
-
- * Added conflict to all old mysql-dev packages. (fixes: #42966)
-
- -- Christian Hammers <ch@debian.org> Sun, 15 Aug 1999 11:35:46 +0200
-
-mysql-gpl (3.22.25-1) unstable; urgency=low
-
- * New upstream version. (We are waiting for 3.23.x !)
- * Fixes some upstream small bugs.
-
- -- Christian Hammers <ch@debian.org> Sun, 18 Jul 1999 22:02:06 +0200
-
-mysql-gpl (3.22.23b-4) unstable; urgency=low
-
- * Rebuild for new perl.
-
- -- Christian Hammers <ch@debian.org> Thu, 8 Jul 1999 01:09:57 +0200
-
-mysql-gpl (3.22.23b-3) unstable; urgency=low
-
- * libmysqlclient had the wrong socket path.
-
- -- Christian Hammers <ch@debian.org> Sun, 03 Jul 1999 23:13:30 +0200
-
-mysql-gpl (3.22.23b-2) unstable; urgency=low
-
- * Missed one replace tag to an very old version of mysql-devel.
-
- -- Christian Hammers <ch@debian.org> Sun, 27 Jun 1999 19:13:30 +0200
-
-mysql-gpl (3.22.23b-1) unstable; urgency=low
-
- * New upstream minor version.
- * Cleaned up the dependencies a bit.
-
- -- Christian Hammers <ch@debian.org> Sun, 27 Jun 1999 19:13:30 +0200
-
-mysql-gpl (3.22.22-1) unstable; urgency=low
-
- * New upstream version. (closes Bug#36493,37340)
- * New maintainer upload.
- * Package reorganisation: We prepare for the GPL'ed server which will
- * be released soon and make the structure more clear to the user.
-
- -- Christian Hammers <ch@debian.org> Mon, 3 May 1999 20:43:41 +0200
-
-mysql (3.22.21-1) unstable; urgency=low
-
- * Never released. TcX was too fast :-)
-
- -- Christian Hammers <ch@debian.org> Tue, 20 Apr 1999 17:22:04 +0200
-
-mysql-freebits (3.21.33b-3) unstable; urgency=low
-
- * Recompile with libncurses
-
- -- Scott Hanson <shanson@debian.org> Sat, 31 Oct 1998 15:04:39 +0100
-
-mysql-freebits (3.21.33b-2) unstable; urgency=low
-
- * Recompile with libstdc++2.9 (fixes #27792)
-
- -- Scott Hanson <shanson@debian.org> Mon, 12 Oct 1998 18:47:25 +0200
-
-mysql-freebits (3.21.33b-1) unstable; urgency=low
-
- * New upstream version (probably the last for 3.21)
-
- -- Scott Hanson <shanson@debian.org> Tue, 8 Sep 1998 18:59:37 +0200
-
-mysql-freebits (3.21.33-4) unstable; urgency=low
-
- * Separate out non-free source files, move mysql-base, mysql-dev, and
- * mysql-doc to main distribution
- * Locale files /usr/share/mysql/ now in server, not base; therefore...
- * Add conflict to mysql-server <=3.21.33-3
-
- -- Scott Hanson <shanson@debian.org> Fri, 31 Jul 1998 19:16:08 +0200
-
-mysql (3.21.33-3) unstable; urgency=low
-
- * Release to unstable with moved socket (fixes #24574)
- * Add conflict to old libdbd-mysql-perl package
-
- -- Scott Hanson <shanson@debian.org> Wed, 22 Jul 1998 22:17:43 +0200
-
-mysql (3.21.33-2) experimental; urgency=low
-
- * Move socket from /tmp to /var/run (see #24574)
- * Release to experimental, since this breaks everything statically
- * linked to libmysqlclient!
-
- -- Scott Hanson <shanson@debian.org> Wed, 15 Jul 1998 19:37:01 +0200
-
-mysql (3.21.33-1) unstable; urgency=low
-
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Sun, 12 Jul 1998 08:18:18 +0200
-
-mysql (3.21.32a-1) unstable; urgency=low
-
- * New upstream release
- * Lintian bugs: ldconfig, missing manpage, call to perl5
- * Lintian bug shlib-with-non-pic-code _not_ yet fixed
-
- -- Scott Hanson <shanson@debian.org> Sat, 4 Jul 1998 07:57:13 +0200
-
-mysql (3.21.31-1) unstable frozen; urgency=low
-
- * New upstream release for hamm and slink (bug fixes only)
- * Fix unsecure use of temp file in mysqlbug (fixes #23606)
- * Added brief licensing information to control file
-
- -- Scott Hanson <shanson@debian.org> Tue, 16 Jun 1998 10:52:44 +0200
-
-mysql (3.21.30-3) unstable; urgency=low
-
- * Restore missing shared library dependencies for mysql-server
-
- -- Scott Hanson <shanson@debian.org> Mon, 15 Jun 1998 07:51:58 +0200
-
-mysql (3.21.30-2) unstable; urgency=low
-
- * Simplify debian/rules (fixes #17662)
- * Edit manual.texi to add "Debian notes" to documentation
- * Add note about passwords on command line (fixes #16471)
- * Add note about getting privleges for users (fixes #22891)
- * Correct "Possible license changes" heading (fixes #22711)
- * Add uninstalled header files to /usr/doc/mysql-dev/examples (fixes #22627)
- * Add udf_example.cc to /usr/doc/mysql-dev/examples (fixes #22710)
-
- -- Scott Hanson <shanson@debian.org> Sun, 7 Jun 1998 13:05:37 +0200
-
-mysql (3.21.30-1) unstable; urgency=low
-
- * Stable upstream release
-
- -- Scott Hanson <shanson@debian.org> Tue, 12 May 1998 22:13:25 +0200
-
-mysql (3.21.29gamma-1) unstable; urgency=low
-
- * New upstream release
- * Do not create 'mysql' subdirectory for libs and headers (fixes #19020)
- * Remove 'CXX=gcc' flag from configure (g++ now standard)
-
- -- Scott Hanson <shanson@debian.org> Sun, 12 Apr 1998 18:38:03 +0200
-
-mysql (3.21.28gamma-1) unstable; urgency=low
-
- * New upstream release
- * Unstable-only release; hamm stays at 3.21.25 for now
-
- -- Scott Hanson <shanson@debian.org> Thu, 2 Apr 1998 21:33:51 +0200
-
-mysql (3.21.25gamma-3) unstable frozen; urgency=low
-
- * Have mysql-base suggest perl >= 5.004 for mysqlaccess (fixes #19593)
- * Fix shlibs to refer to mysql-base rather than the no-longer-existant mysql
-
- -- Scott Hanson <shanson@debian.org> Thu, 26 Mar 1998 18:22:59 +0100
-
-mysql (3.21.25gamma-2) unstable; urgency=low
-
- * Restore libmysqlclient.so symlink to mysql-dev (fixes #19036)
-
- -- Scott Hanson <shanson@debian.org> Sun, 8 Mar 1998 10:46:43 +0100
-
-mysql (3.21.25gamma-1) unstable; urgency=low
-
- * Check if running as root in init.d script (fixes #18577)
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Fri, 27 Feb 1998 20:01:30 +0100
-
-mysql (3.21.24gamma-1) unstable; urgency=low
-
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Mon, 23 Feb 1998 08:14:17 +0100
-
-mysql (3.21.23beta-3) unstable; urgency=low
-
- * Squashed errors found by lintian
-
- -- Scott Hanson <shanson@debian.org> Tue, 17 Feb 1998 20:19:01 +0100
-
-mysql (3.21.23beta-2) unstable; urgency=low
-
- * Fixed overlaps with old mysql package (fixes #17843)
-
- -- Scott Hanson <shanson@debian.org> Thu, 5 Feb 1998 22:55:00 +0100
-
-mysql (3.21.23beta-1) unstable; urgency=low
-
- * New upstream release
- * Fix include lines in mysql.h (fixes #17827)
- * Move /usr/include/mysql to mysql-dev
-
- -- Scott Hanson <shanson@debian.org> Wed, 4 Feb 1998 19:59:14 +0100
-
-mysql (3.21.22beta-3) unstable; urgency=low
-
- * Correct descriptions in control file (fixes #17698)
- * Clean up output of shutdown script
-
- -- Scott Hanson <shanson@debian.org> Sat, 31 Jan 1998 19:04:29 +0100
-
-mysql (3.21.22beta-2) unstable; urgency=low
-
- * Split out mysql-dev and mysql-bench subpackages
-
- -- Scott Hanson <shanson@debian.org> Wed, 28 Jan 1998 19:52:27 +0100
-
-mysql (3.21.22beta-1) unstable; urgency=low
-
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Wed, 28 Jan 1998 18:59:09 +0100
-
-mysql (3.21.21a.beta-2) unstable; urgency=low
-
- * Compile with libpthreads from libc6-dev_2.0.6-3 rather than statically
- linking to patched libpthreads (see changes to 3.20.29-2)
-
- -- Scott Hanson <shanson@debian.org> Sun, 25 Jan 1998 13:17:15 +0100
-
-mysql (3.21.21a.beta-1) unstable; urgency=low
-
- * Put initial database, mysql_install_db, safe_mysqld, isamlog and
- isamchk in mysql-server
- * Correct upstream release number so source packages are correctly built
-
- -- Scott Hanson <shanson@debian.org> Mon, 19 Jan 1998 07:52:48 +0100
-
-mysql (3.21.21.beta-1) unstable; urgency=low
-
- * Use debhelper where possible in rules
- * Split binary packages into mysql-base, mysql-client, mysql-doc
- * New upstream release
-
- -- Scott Hanson <shanson@debian.org> Thu, 15 Jan 1998 08:12:17 +0100
-
-mysql (3.21.19.beta-1) unstable; urgency=low
-
- * Offer to set root password in mysql_install_db
- * Kill `pidof mysqld` on shutdown rather than use mysqladmin
- * New upstream version
-
- -- Scott Hanson <shanson@debian.org> Fri, 9 Jan 1998 20:06:35 +0100
-
-mysql (3.21.17a.beta-2) unstable; urgency=low
-
- * Remove perl stuff (it's going back into libdbd-mysql-perl)
- * Remove conflict with libdbd-mysql-perl
- * Do not compress *html files (fixes #16314)
-
- -- Scott Hanson <shanson@debian.org> Tue, 30 Dec 1997 07:34:20 +0100
-
-mysql (3.21.17a.beta-1) unstable; urgency=low
-
- * Add conflict to libdbd-mysql-perl
- * Use --pid-file option to place pid file in /var/run rather than patching
- * Add install-info to postinst and postrm
- * Add filename to message shown by mysql_install_db (fixes #16621)
- * New upstream version
-
- -- Scott Hanson <shanson@debian.org> Sun, 21 Dec 1997 19:41:45 +0100
-
-mysql (3.20.32a-5) unstable; urgency=low
-
- * Move mysqld to /usr/lib/mysql, per policy discussion
- * Adjust makefiles so perl libs get installed
-
- -- Scott Hanson <shanson@debian.org> Wed, 3 Dec 1997 22:37:45 +0100
-
-mysql (3.20.32a-4) unstable; urgency=low
-
- * Move mysqld to /usr/sbin to comply with FSSTND
-
- -- Scott Hanson <shanson@debian.org> Mon, 3 Nov 1997 20:12:29 +0100
-
-mysql (3.20.32a-3) unstable; urgency=low
-
- * Comment out tests in mysql_install_db... for real this time!
-
- -- Scott Hanson <shanson@debian.org> Mon, 3 Nov 1997 07:32:53 +0100
-
-mysql (3.20.32a-2) unstable; urgency=low
-
- * Comment out tests in mysql_install_db (fixes #14304)
-
- -- Scott Hanson <shanson@debian.org> Sat, 1 Nov 1997 18:45:25 +0100
-
-mysql (3.20.32a-1) unstable; urgency=low
-
- * New upstream version
-
- -- Scott Hanson <shanson@debian.org> Wed, 29 Oct 1997 07:11:42 +0100
-
-mysql (3.20.29-2) unstable; urgency=low
-
- * New maintainer
- * Statically link mysqld to patched glibc-2.0.5 libpthread
- (works around #13586; see README.debian.glibc-2.0.5)
- * Conflict with libpthread0 (fixes #13448)
- * Don't link libg++, avoiding problems with glibc libpthread
-
- -- Scott Hanson <shanson@debian.org> Thu, 16 Oct 1997 19:25:23 +0200
-
-mysql (3.20.29-1) unstable; urgency=low
-
- * New upstream version
- * Recompiled with libc6
- * Include mysql-faq_toc.html (fixes #10885)
- * Reworked /etc/init.d/mysql script (thanks to Heiko)
- * Remove file /usr/lib/libmysqlclient.so.4 when package is removed.
- * Use absolute path specification for conffile
- * Use /usr/bin/perl instead of /bin/perl (fixes #10654)
- * Do not depend on mysql (fixes #12427)
- * Installed missing manpage for Mysql perl module
- * Don't use debstd anymore
- * Pristine source
- * Set section to `non-free/devel'
- * Upgraded to standards version 2.3.0.0
-
- -- Christian Schwarz <schwarz@debian.org> Fri, 12 Sep 1997 02:12:58 +0200
-
-mysql (3.20.16beta-2) unstable; urgency=low
-
- * Uses /usr/bin/perl instead of /bin/perl (fixes bug #9731)
- * Don't run mysqld with --log option
- * Don't install regex manual pages
- * Suggest package mysql-manual
- * Fixed typo in changelog
- * Upgrade to policy 2.1.3.2
-
- -- Christian Schwarz <schwarz@debian.org> Sun, 11 May 1997 14:19:26 +0200
-
-mysql (3.20.16beta-1) unstable; urgency=low
-
- * Initial Release.
-
- -- Christian Schwarz <schwarz@debian.org> Sat, 12 Apr 1997 13:51:28 +0200
+ * Bumped version numbers
+ * Added systemd service profile and script
+ * Standards version moved up to 3.9.6 in d/control
+ * Added dependencies to gawk as one script does not work with original-awk
+ * Dropped explicit dependency on multiarch-support, this is already managed
+ by ${misc:Pre-Depends).
+ * Added wsrep_sst_xtrabackup-v2 to d/mysql-wsrep-server-5.6.install
+ * Added "Provides: libmysqlclient-dev" to mysql-wsrep-libmysqlclient-dev
+ * Added "Replaces: libmysqlclient-dev" to mysql-wsrep-libmysqlclient-dev
+ * Moved mysql_plugin to server package as it controls the server plugins
+ * Removed langueage dublication from d/mysql-wsrep-server-5.6.install
+ * Make builds parallel Use MAKEFLAGS for parallel builds
+ * Added parallel build support via DEB_BUILD_OPTIONS
+ * d/rules: call dh_apparmor from override_dh_install so that it is run
+ before dh_installinit. This causes the AppArmor profile to be loaded
+ correctly before mysqld is started.
+ * Added innodb_stress tests to d/rules
+
+ -- Sergii Golovatiuk <sgolovatiuk@mirantis.com> Mon, 13 Jun 2016 11:16:00 +0200
+
+mysql-wsrep-5.6 (5.6.30-25.15-1) UNRELEASED; urgency=low
+
+ * Bump version numbers
+
+ -- Otto Kekäläinen <otto@seravo.fi> Wed, 22 Jun 2016 11:58:20 +0300
Source: mysql-wsrep-5.6
Section: database
Priority: optional
-Maintainer: MOS Linux team <mos-linux-team@mirantis.com>
-XSBC-Orig-Maintainer: Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>
-Build-Depends:
- bison,
- chrpath,
- cmake,
- debhelper (>= 8.1.3~),
- dh-apparmor,
- gawk,
- hardening-wrapper,
- libaio-dev[linux-any],
- libncurses5-dev (>= 5.0-6),
- libreadline-dev,
- libwrap0-dev (>= 7.6-8.3),
- lsb-release,
- perl,
- po-debconf,
- psmisc,
- zlib1g-dev (>= 1:1.1.3-5),
- libssl-dev,
- libedit-dev
-Standards-Version: 3.9.3
-Homepage: http://dev.mysql.com/
-Vcs-Git: git://git.debian.org/git/pkg-mysql/mysql-5.6.git
-Vcs-Browser: http://git.debian.org/?p=pkg-mysql/mysql-5.6.git
-XS-Testsuite: autopkgtest
+Maintainer: MOS Linux Team <mos-linux@mirantis.com>
+Build-Depends: bison,
+ chrpath,
+ cmake,
+ debhelper (>= 9),
+ dh-apparmor,
+ dh-systemd (>= 1.5),
+ dpkg-dev (>= 1.16.1~),
+ gawk,
+ libaio-dev[linux-any],
+ libedit-dev,
+ libncurses5-dev (>= 5.0-6),
+ libssl-dev,
+ libwrap0-dev (>= 7.6-8.3),
+ lsb-release,
+ perl,
+ po-debconf,
+ psmisc,
+ zlib1g-dev (>= 1:1.1.3-5)
+Standards-Version: 3.9.8
+Homepage: http://galeracluster.com/
+Vcs-Git: https://github.com/codership/mysql-wsrep.git
+Vcs-Browser: https://github.com/codership/mysql-wsrep
-Package: mysql-wsrep-common-5.6
-Architecture: all
-Depends: mysql-common, ${misc:Depends}, ${shlibs:Depends}
-Multi-Arch: foreign
-Description: MySQL 5.6 specific common files, e.g. /etc/mysql/conf.d/my-5.6.cnf
+Package: mysql-wsrep-libmysqlclient18
+Section: libs
+Architecture: any
+Depends: mysql-wsrep-common-5.6, ${misc:Depends}, ${shlibs:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Replaces: libmysqlclient18
+Provides: libmysqlclient18
+Multi-Arch: same
+Description: MySQL database client library
MySQL is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MySQL are speed, robustness and
ease of use.
+ .
+ This package includes the client library.
-Package: mysql-client-core-5.6
+Package: mysql-wsrep-libmysqlclient-dev
Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Provides: virtual-mysql-client-core, mysql-client-core
-Breaks: mysql-client-5.5, mysql-client-core-5.5, virtual-mysql-client-core
-Replaces: mysql-client-5.5, mysql-client-core-5.5, virtual-mysql-client-core
-Description: MySQL database core client binaries
+Section: libdevel
+Replaces: libmysqlclient-dev
+Provides: libmysqlclient-dev
+Depends: mysql-wsrep-libmysqlclient18 (>= ${binary:Version}),
+ zlib1g-dev,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Description: MySQL database development files
MySQL is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MySQL are speed, robustness and
ease of use.
.
- This package includes the core client files, as used by Akonadi.
+ This package includes development libraries and header files.
-Package: mysql-client-5.6
-Architecture: any
-Depends:
- debianutils (>=1.6),
- libdbd-mysql-perl (>= 1.2202),
- libdbi-perl,
- libterm-readkey-perl,
- mysql-client-core-5.6,
- mysql-common (>= 5.5),
- ${misc:Depends},
- ${perl:Depends},
- ${shlibs:Depends}
-Recommends: mysql-wsrep-common-5.6
-Provides: virtual-mysql-client, virtual-mysql-client-wsrep, mysql-client, mysql-client-wsrep
-Breaks: mysql-client-5.5, virtual-mysql-client, virtual-mysql-client-wsrep
-Replaces: mysql-client-5.5, virtual-mysql-client, virtual-mysql-client-wsrep
-Description: MySQL database client binaries
+Package: mysql-wsrep-common-5.6
+Architecture: all
+Depends: mysql-common, ${misc:Depends}, ${shlibs:Depends}
+Conflicts: mariadb-server-5.5,
+ mysql-server-5.5,
+ percona-xtradb-cluster-common-5.5
+Replaces: mariadb-server-5.5,
+ mysql-common,
+ mysql-common-5.5,
+ mysql-common-5.6,
+ mysql-server-5.5,
+ percona-xtradb-cluster-common-5.5
+Breaks: mariadb-common (<< 10.0.20-3~)
+Multi-Arch: foreign
+Description: MySQL database common files, e.g. /etc/mysql/conf.d/my-5.6.cnf
MySQL is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MySQL are speed, robustness and
ease of use.
.
- This package includes the client binaries and the additional tools
- innotop and mysqlreport.
+ This package includes files needed by all versions of the client library,
+ e.g. /etc/mysql/my.cnf.
-Package: mysql-server-wsrep-core-5.6
+Package: mysql-client-5.6
Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Provides: virtual-mysql-server-core, mysql-server-core, mysql-server-wsrep-core
-Breaks: mysql-server-core-5.5, virtual-mysql-server-core
-Replaces: mysql-server-core-5.5, virtual-mysql-server-core
-Description: MySQL database server binaries
+Depends: debianutils (>=1.6),
+ mysql-wsrep-common-5.6,
+ mysql-wsrep-libmysqlclient18,
+ ${misc:Depends},
+ ${perl:Depends},
+ ${shlibs:Depends}
+Provides: virtual-mysql-client,
+ mysql-client-5.6,
+ mysql-client-core-5.6,
+ mysql-wsrep-client-5.6
+Conflicts: mysql-client-5.5,
+Breaks: mysql-client-5.6,
+ mysql-client-5.5,
+ mysql-client-core-5.5,
+ mysql-client-core-5.6
+Replaces: mysql-client-5.6,
+ mysql-client-5.5,
+ mysql-client-core-5.5,
+ mysql-client-core-5.6,
+ virtual-mysql-client
+Recommends: libdbd-mysql-perl (>= 1.2202),
+ libdbi-perl,
+ libterm-readkey-perl
+Description: MySQL database client binaries
MySQL is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MySQL are speed, robustness and
ease of use.
.
- This package includes the server binaries but doesn't contain all the
- infrastructure needed to setup system databases.
+ This package includes the client binaries and the additional tools
+ innotop and mysqlreport.
Package: mysql-server-wsrep-5.6
Architecture: any
Recommends: libhtml-template-perl
Suggests: mailx, tinyca
Pre-Depends: adduser (>= 3.40), debconf, mysql-wsrep-common-5.6
-Depends:
- initscripts,
- libdbi-perl,
- lsb-base (>= 3.0-10),
- mysql-client-5.6 (>= ${binary:Version}),
- mysql-server-wsrep-core-5.6 (= ${binary:Version}),
- passwd,
- perl (>= 5.6),
- psmisc,
- ${misc:Depends},
- ${shlibs:Depends}
-Provides: virtual-mysql-server, virtual-mysql-server-wsrep, mysql-server, mysql-server-wsrep
-Breaks: mysql-server-5.5, virtual-mysql-server, virtual-mysql-server-wsrep
-Replaces: mysql-server-5.5, virtual-mysql-server, virtual-mysql-server-wsrep
-Description: MySQL database server binaries and system database setup
+Depends: initscripts,
+ libdbi-perl,
+ lsb-base (>= 3.0-10),
+ lsof,
+ mysql-wsrep-client-5.6 (>= ${binary:Version}) | mysql-client-5.6 (>= ${binary:Version}),
+ passwd,
+ perl (>= 5.6),
+ psmisc,
+ rsync,
+ socat,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Provides: virtual-mysql-server,
+ mysql-server-5.6,
+ mysql-wsrep-server-5.6,
+ mysql-wsrep-server-core-5.6,
+ mysql-server-wsrep-core-5.6
+Breaks: mysql-server-5.5,
+ mysql-server-5.6,
+ mysql-server-core-5.5,
+ mysql-server-core-5.6,
+ virtual-mysql-server
+Replaces: mysql-server-5.5, mysql-server-5.6, virtual-mysql-server, mysql-server-wsrep-core-5.6, mysql-wsrep-common-5.6
+Description: MySQL database wsrep server binaries and system database setup
MySQL is a fast, stable and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
language in the world. The main goals of MySQL are speed, robustness and
This package contains all the infrastructure needed to setup system
databases.
-Package: mysql-testsuite-5.6
+Package: mysql-wsrep-testsuite-5.6
Architecture: any
-Depends:
- mysql-client-5.6 (= ${binary:Version}),
- mysql-server-wsrep-5.6 (= ${binary:Version}),
- ${misc:Depends},
- ${shlibs:Depends}
-Provides: virtual-mysql-testsuite, mysql-testsuite
-Breaks: mysql-testsuite-5.5, virtual-mysql-testsuite
-Replaces: mysql-testsuite-5.5, virtual-mysql-testsuite
+Depends: mysql-wsrep-client-5.6 (= ${binary:Version}) | mysql-client-5.6 (= ${binary:Version}),
+ mysql-wsrep-server-5.6 (= ${binary:Version}) | mysql-server-wsrep-5.6 (= ${binary:Version}),
+ libjson-perl,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Provides: virtual-mysql-testsuite
+Breaks: mysql-testsuite-5.5, mysql-testsuite-5.6 (<< ${binary:Version}), virtual-mysql-testsuite
+Replaces: mysql-testsuite-5.5, mysql-testsuite-5.6, virtual-mysql-testsuite
Description: MySQL 5.6 testsuite
MySQL is a fast, stable, and true multi-user, multi-threaded SQL database
server. SQL (Structured Query Language) is the most popular database query
.
This package includes the MySQL testsuite.
-Package: mysql-source-5.6
+Package: mysql-testsuite-5.6
+Architecture: any
+Depends: mysql-wsrep-testsuite-5.6 (= ${binary:Version})
+Description: Metapackage for trick our repotest
+
+Package: mysql-wsrep-5.6
Architecture: any
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Description: MySQL source
- MySQL is a fast, stable, and true multi-user, multi-threaded SQL database
- server. SQL (Structured Query Language) is the most popular database query
- language in the world. The main goals of MySQL are speed, robustness and
- ease of use.
- .
- This package includes the MySQL source code as configured before building
- - but after the arch specific configuration. This is currently required for
- building plugins.
+Depends: mysql-wsrep-client-5.6 (= ${binary:Version}) | mysql-client-5.6 (= ${binary:Version}),
+ mysql-wsrep-server-5.6 (= ${binary:Version}) | mysql-server-wsrep-5.6 (= ${binary:Version}),
+ ${misc:Depends}
+Description: Metapackage that installs mysql-wsrep client and server packages.
[DEFAULT]
-debian-branch = 5.6-debian
-upstream-branch = 5.6-debian
+# 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
upstream-tree = branch
pristine-tar = False
--- /dev/null
+usr/lib/*/libmysqlservices.a
--- /dev/null
+This package was requested in http://bugs.debian.org/508406 because it
+is needed by programs want to include the embedded MySQL into their
+shared libraries.
+
+In order to get the full compile flags, use /bin/mysql_config_pic
--- /dev/null
+usr/bin/mysql_config_pic
+usr/lib/mysql/libmysqld_pic.a
--- /dev/null
+debian/tmp/usr/share/man/man1/mysql_config_pic.1
+# this executable reprsent the embedded mysql server client
debian/additions/innotop/innotop usr/bin/
debian/additions/mysqlreport usr/bin/
usr/bin/innochecksum
usr/bin/myisam_ftdump
+usr/bin/mysql
usr/bin/mysql_client_test
-#usr/bin/mysql_client_test_embedded
usr/bin/mysql_config_editor
usr/bin/mysql_find_rows
usr/bin/mysql_fix_extensions
-usr/bin/mysql_plugin
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
debian/additions/innotop/innotop.1
-debian/tmp/usr/share/man/man1/myisam_ftdump.1
-debian/tmp/usr/share/man/man1/mysqlaccess.1
-debian/tmp/usr/share/man/man1/mysqladmin.1
-debian/tmp/usr/share/man/man1/mysqlbug.1
-debian/tmp/usr/share/man/man1/mysql_client_test.1
-#debian/tmp/usr/share/man/man1/mysql_client_test_embedded.1
-debian/tmp/usr/share/man/man1/mysql_config_editor.1
-debian/tmp/usr/share/man/man1/mysqldump.1
-debian/tmp/usr/share/man/man1/mysqldumpslow.1
-debian/tmp/usr/share/man/man1/mysql_find_rows.1
-debian/tmp/usr/share/man/man1/mysql_fix_extensions.1
-debian/tmp/usr/share/man/man1/mysqlimport.1
debian/tmp/usr/share/man/man1/mysqlman.1
debian/additions/mysqlreport.1
-debian/tmp/usr/share/man/man1/mysqlshow.1
-debian/tmp/usr/share/man/man1/mysqlslap.1
-debian/tmp/usr/share/man/man1/mysql_waitpid.1
-debian/tmp/usr/share/man/man1/mysql_plugin.1
+debian/tmp/usr/share/man/man1/mysql_embedded.1
--- /dev/null
+#!/bin/bash
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+CNF=/etc/mysql/my.cnf
+
+# Beware that there are two ypwhich one of them needs the 2>/dev/null!
+if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
+ db_input high mysql-server-5.6/nis_warning || true
+ db_go
+fi
+
+# only ask this question on fresh installs, during "reconfiguration" and when
+# not upgrading from an existing 5.0 installation.
+# there is also an additional check for empty root passwords in the
+# postinst script when the tools are available for us to use.
+if [ "$1" = "configure" ] && ([ -z "$2" ] && [ ! -e "/var/lib/mysql/debian-5.0.flag" ] ) || [ "$1" = "reconfigure" ]; then
+ while :; do
+ RET=""
+ db_input high mysql-server/root_password || true
+ db_go
+ db_get mysql-server/root_password
+ # if password isn't empty we ask for password verification
+ if [ -z "$RET" ]; then
+ db_fset mysql-server/root_password seen false
+ db_fset mysql-server/root_password_again seen false
+ break
+ fi
+ ROOT_PW="$RET"
+ db_input high mysql-server/root_password_again || true
+ db_go
+ db_get mysql-server/root_password_again
+ if [ "$RET" == "$ROOT_PW" ]; then
+ ROOT_PW=''
+ break
+ fi
+ db_fset mysql-server/password_mismatch seen false
+ db_input critical mysql-server/password_mismatch
+ db_set mysql-server/root_password ""
+ db_set mysql-server/root_password_again ""
+ db_go
+ done
+fi
-etc/init.d
-etc/logrotate.d
etc/mysql/conf.d
-usr/bin
-usr/share/mysql
var/lib/mysql-upgrade
-debian/tmp/usr/share/mysql/*cnf
+debian/tmp/usr/share/mysql/wsrep.cnf
debian/tmp/usr/share/mysql/magic
debian/tmp/usr/lib/mysql/plugin/daemon_example.ini
#usr/share/mysql/config.medium.ini
#usr/share/mysql/config.small.ini
#usr/share/mysql/ndb-config-2-node.ini
-#debian/additions/mysqld_safe_syslog.cnf etc/mysql/conf.d/
+debian/additions/mysqld_safe_syslog.cnf etc/mysql/conf.d/
+etc/apparmor.d/usr.sbin.mysqld
+etc/init.d/mysql
etc/mysql/debian-start
usr/bin/msql2mysql
+usr/bin/my_print_defaults
usr/bin/myisamchk
usr/bin/myisamlog
usr/bin/myisampack
usr/bin/mysql_convert_table_format
+usr/bin/mysql_install_db
+usr/bin/mysql_plugin
usr/bin/mysql_secure_installation
usr/bin/mysql_setpermission
usr/bin/mysql_tzinfo_to_sql
+usr/bin/mysql_upgrade
usr/bin/mysql_zap
usr/bin/mysqlbinlog
usr/bin/mysqld_multi
usr/bin/mysqld_safe
usr/bin/mysqlhotcopy
usr/bin/mysqltest
-#usr/bin/mysqltest_embedded
usr/bin/perror
usr/bin/replace
usr/bin/resolve_stack_dump
usr/bin/resolveip
+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
usr/lib/mysql/plugin/*.so
+usr/sbin/mysqld
usr/share/doc/mysql-server-5.6/
+usr/share/mysql/bulgarian
+usr/share/mysql/charsets
+usr/share/mysql/czech
+usr/share/mysql/danish
usr/share/mysql/debian-start.inc.sh
usr/share/mysql/debian_create_root_user.sql
+usr/share/mysql/dictionary.txt
+usr/share/mysql/dutch
usr/share/mysql/echo_stderr
+usr/share/mysql/english
usr/share/mysql/errmsg-utf8.txt
+usr/share/mysql/mysql-systemd-start
+usr/share/mysql/estonian
+usr/share/mysql/fill_help_tables.sql
+usr/share/mysql/french
+usr/share/mysql/german
+usr/share/mysql/greek
+usr/share/mysql/hungarian
+usr/share/mysql/innodb_memcached_config.sql
+usr/share/mysql/italian
+usr/share/mysql/japanese
+usr/share/mysql/korean
+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/mysqld_multi.server
-#etc/apparmor.d/usr.sbin.mysqld
+usr/share/mysql/norwegian
+usr/share/mysql/norwegian-ny
+usr/share/mysql/polish
+usr/share/mysql/portuguese
+usr/share/mysql/romanian
+usr/share/mysql/russian
+usr/share/mysql/serbian
+usr/share/mysql/slovak
+usr/share/mysql/spanish
+usr/share/mysql/swedish
+usr/share/mysql/ukrainian
+usr/share/mysql/wsrep.cnf
+usr/share/mysql/my-default.cnf
# These long lines reproduce actual output and to reformat them
# would damage the integrity of the man page.
# mysql-server-5.6: manpage-has-errors-from-man usr/share/man/man1/mysqlbinlog.1.gz 1405: warning [p 9, 7.5i, div `3tbd3,2', 0.8i]: can't break line
+# These are random occurrences of a pseudo word in a binary.
+mysql-server-5.6: spelling-error-in-binary usr/sbin/mysqld yuR your
-debian/tmp/usr/share/man/man1/msql2mysql.1
-debian/tmp/usr/share/man/man1/myisamchk.1
-debian/tmp/usr/share/man/man1/myisamlog.1
-debian/tmp/usr/share/man/man1/myisampack.1
-debian/tmp/usr/share/man/man1/mysqlbinlog.1
-debian/tmp/usr/share/man/man1/mysql_convert_table_format.1
-debian/tmp/usr/share/man/man1/mysqld_multi.1
-debian/tmp/usr/share/man/man1/mysqld_safe.1
-debian/tmp/usr/share/man/man1/mysqlhotcopy.1
-debian/tmp/usr/share/man/man1/mysql_secure_installation.1
-debian/tmp/usr/share/man/man1/mysql_setpermission.1
-debian/tmp/usr/share/man/man1/mysqltest.1
-#debian/tmp/usr/share/man/man1/mysqltest_embedded.1
-debian/tmp/usr/share/man/man1/mysql_zap.1
-debian/tmp/usr/share/man/man1/perror.1
-debian/tmp/usr/share/man/man1/replace.1
-debian/tmp/usr/share/man/man1/resolveip.1
-debian/tmp/usr/share/man/man1/resolve_stack_dump.1
-debian/tmp/usr/share/man/man1/innochecksum.1
-debian/tmp/usr/share/man/man1/mysql_tzinfo_to_sql.1
--- /dev/null
+# MySQL systemd service file
+
+[Unit]
+Description=MySQL Community Server
+After=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+User=mysql
+Group=mysql
+PermissionsStartOnly=true
+ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
+ExecStart=/usr/bin/mysqld_safe
+ExecStartPost=/usr/share/mysql/mysql-systemd-start post
+TimeoutSec=600
+Restart=on-failure
+RuntimeDirectory=mysqld
+RuntimeDirectoryMode=755
--- /dev/null
+description "MySQL 5.6 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
-#!/bin/sh
+#!/bin/bash
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
+
+# This command can be used as pipe to syslog. With "-s" it also logs to stderr.
+ERR_LOGGER="logger -p daemon.err -t mysqld_safe -i"
+
+invoke() {
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ invoke-rc.d mysql $1
+ else
+ /etc/init.d/mysql $1
+ fi
+}
+
+MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables"
+
+test_mysql_access() {
+ mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1
+}
+
+# call with $1 = "online" to connect to the server, otherwise it bootstraps
+set_mysql_rootpw() {
+ # forget we ever saw the password. don't use reset to keep the seen status
+ db_set mysql-server/root_password ""
+ db_set mysql-server/root_password_again ""
+
+ tfile=`mktemp`
+ if [ ! -f "$tfile" ]; then
+ return 1
+ fi
+
+ # this avoids us having to call "test" or "[" on $rootpw
+ cat << EOF > $tfile
+USE mysql;
+UPDATE user SET password=PASSWORD("$rootpw") WHERE user='root';
+FLUSH PRIVILEGES;
+EOF
+ if grep -q 'PASSWORD("")' $tfile; then
+ retval=0
+ elif [ "$1" = "online" ]; then
+ mysql --no-defaults -u root -h localhost <$tfile >/dev/null
+ retval=$?
+ else
+ $MYSQL_BOOTSTRAP <$tfile
+ retval=$?
+ fi
+ rm -f $tfile
+ return $retval
+}
+
+# This is necessary because mysql_install_db removes the pid file in /var/run
+# and because changed configuration options should take effect immediately.
+# In case the server wasn't running at all it should be ok if the stop
+# script fails. I can't tell at this point because of the cleaned /var/run.
+set +e; invoke stop; set -e
case "$1" in
configure)
mysql_logdir=/var/log/mysql
mysql_cfgdir=/etc/mysql
mysql_upgradedir=/var/lib/mysql-upgrade
+ mysql_filesdir=/var/lib/mysql-files
# Ensure the existence and right permissions for the database and
# log files.
if [ ! -d "$mysql_statedir" -a ! -L "$mysql_statedir" ]; then mkdir "$mysql_statedir"; fi
if [ ! -d "$mysql_statedir/mysql" -a ! -L "$mysql_statedir/mysql" ]; then mkdir "$mysql_statedir/mysql"; fi
if [ ! -d "$mysql_logdir" -a ! -L "$mysql_logdir" ]; then mkdir "$mysql_logdir"; fi
+ if [ ! -d "$mysql_filesdir" -a ! -L "$mysql_filesdir" ]; then mkdir "$mysql_filesdir"; fi
# When creating an ext3 jounal on an already mounted filesystem like e.g.
# /var/lib/mysql, you get a .journal file that is not modifyable by chown.
# The mysql_datadir must not be writable by the mysql user under any
if [ ! -d "$mysql_rundir" ]; then mkdir "$mysql_rundir"; fi
chown -R mysql $mysql_rundir
touch $mysql_logdir/error.log
+ chown -R mysql:mysql $mysql_filesdir
+ chmod 700 $mysql_filesdir
chown -R mysql:adm $mysql_logdir
chmod 0750 $mysql_logdir
chmod 0640 $mysql_logdir/error.log
+ set -e
+
+ # This is important to avoid dataloss when there is a removed
+ # mysql-server version from Woody lying around which used the same
+ # data directory and then somewhen gets purged by the admin.
+ db_set mysql-server/postrm_remove_database false || true
+
+ # To avoid downgrades.
+ touch $mysql_statedir/debian-5.6.flag
+
+ # initiate databases. Output is not allowed by debconf :-(
+ # Debian: can safely run on upgrades with existing databases
+
+ set +e
+ tfile_select_db=`mktemp`
+ echo "USE mysql;" > $tfile_select_db
+ MYSQL_EXTRA_OPTS=" --default-storage-engine=myisam --lc-messages-dir=/usr/share/mysql/english/.."
+ MYSQL_CMDLINE=$MYSQL_BOOTSTRAP$MYSQL_EXTRA_OPTS
+ cat $tfile_select_db $mysql_datadir/mysql_system_tables.sql $mysql_datadir/debian_create_root_user.sql $mysql_datadir/fill_help_tables.sql | $MYSQL_CMDLINE 2>&1 | $ERR_LOGGER
+ rm $tfile_select_db
+ set -e
+
+ ## On every reconfiguration the maintenance user is recreated.
+ #
+ # - It is easier to regenerate the password every time but as people
+ # use fancy rsync scripts and file alteration monitors, the existing
+ # password is used and existing files not touched.
+ # - The mysqld statement is like that in mysql_install_db because the
+ # server is not already running. This has some implications:
+ # - The amount of newlines and semicolons in the query is important!
+ # - GRANT is not possible with --skip-grant-tables and "INSERT
+ # (user,host..) VALUES" is not --ansi compliant
+ # - The echo is just for readability. ash's buildin has no "-e" so use /bin/echo.
+ # - The Super_priv, Show_db_priv, Create_tmp_table_priv and Lock_tables_priv
+ # may not be present as old Woody 3.23 databases did not have it and the
+ # admin might not already have run mysql_upgrade which adds them.
+ # As the binlog cron scripts to need at least the Super_priv, I do first
+ # the old query which always succeeds and then the new which may or may not.
+
+ # recreate the credentials file if not present or without mysql_upgrade stanza
+ dc=$mysql_cfgdir/debian.cnf;
+ if [ -e "$dc" -a -n "`fgrep mysql_upgrade $dc 2>/dev/null`" ]; then
+ pass="`sed -n 's/^[ ]*password *= *// p' $dc | head -n 1`"
+ else
+ pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`;
+ if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir; fi
+ umask 066
+ cat /dev/null > $dc
+ umask 022
+ echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc
+ echo "[client]" >>$dc
+ echo "host = localhost" >>$dc
+ echo "user = debian-sys-maint" >>$dc
+ echo "password = $pass" >>$dc
+ echo "socket = $mysql_rundir/mysqld.sock" >>$dc
+ echo "[mysql_upgrade]" >>$dc
+ echo "host = localhost" >>$dc
+ echo "user = debian-sys-maint" >>$dc
+ echo "password = $pass" >>$dc
+ echo "socket = $mysql_rundir/mysqld.sock" >>$dc
+ echo "basedir = /usr" >>$dc
+ fi
+ # If this dir chmod go+w then the admin did it. But this file should not.
+ chown 0:0 $dc
+ chmod 0600 $dc
+
+ replace_query=`echo -e \
+ "USE mysql;\n" \
+ "REPLACE INTO user SET " \
+ " host='localhost', user='debian-sys-maint', password=password('$pass'), " \
+ " Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', " \
+ " Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', " \
+ " Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y', " \
+ " Index_priv='Y', Alter_priv='Y', Super_priv='Y', Show_db_priv='Y', "\
+ " Create_tmp_table_priv='Y', Lock_tables_priv='Y', Execute_priv='Y', "\
+ " Repl_slave_priv='Y', Repl_client_priv='Y', Create_view_priv='Y', "\
+ " Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y', "\
+ " Create_user_priv='Y', Event_priv='Y', Trigger_priv='Y'; "`;
+ # Engines supported by etch should be installed per default. The query sequence is supposed
+ # to be aborted if the CREATE TABLE fails due to an already existent table in which case the
+ # admin might already have chosen to remove one or more plugins. Newlines are necessary.
+ install_plugins=`echo -e \
+ "USE mysql;\n" \
+ "CREATE TABLE IF NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT '', " \
+ " dl char(128) COLLATE utf8_bin NOT NULL DEFAULT '', " \
+ " PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MySQL plugins';\n" \
+ "INSERT INTO plugin VALUES ('innodb', 'ha_innodb.so');\n" \
+ "INSERT INTO plugin VALUES ('federated', 'ha_federated.so');\n" \
+ "INSERT INTO plugin VALUES ('blackhole', 'ha_blackhole.so');\n" \
+ "INSERT INTO plugin VALUES ('archive', 'ha_archive.so');" `
+
+ db_get mysql-server/root_password && rootpw="$RET"
+ if ! set_mysql_rootpw; then
+ password_error="yes"
+ fi
+
+ echo "$replace_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
+ set +e
+ echo "$install_plugins" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
+ set -e
;;
abort-upgrade|abort-remove|abort-configure)
;;
esac
-# ESP Package Manager v4.2
-update-rc.d -f mysql remove >/dev/null || exit
-ldconfig -n /usr/lib/mysql
-#test -d /var/lib/mysql || (mysql_install_db --user=mysql --datadir=/var/lib/mysql)
-# Run mysql_install_db only if postinst was called during install, not upgrade
-if [ -z "$2" ]; then
- # it seems that we can run mysql_install_db regardless of existing tables.
- mysql_install_db --wsrep-on=0 --user=mysql --datadir=/var/lib/mysql --basedir=/usr
+# here we check to see if we can connect as root without a password
+# this should catch upgrades from previous versions where the root
+# password wasn't set. if there is a password, or if the connection
+# fails for any other reason, nothing happens.
+if [ "$1" = "configure" ]; then
+ if test_mysql_access; then
+ db_input medium mysql-server/root_password || true
+ db_go
+ db_get mysql-server/root_password && rootpw="$RET"
+
+ if ! set_mysql_rootpw "online"; then
+ password_error="yes"
+ fi
+ fi
+
+ if [ "$password_error" = "yes" ]; then
+ db_input high mysql-server/error_setting_password || true
+ db_go
+ fi
+
fi
-# This is a fix/workaround for AppArmor profile provided with mysql-server deb
-[ ! -d /etc/apparmor.d/disable ] || \
-( cd /etc/apparmor.d/disable && ln -sf ../usr.sbin.mysqld ./ )
-[ ! -x /etc/init.d/apparmor ] || /etc/init.d/apparmor restart
+
+db_stop # in case invoke failes
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+set -e
+
+# It is possible that Debconf has already been removed, too.
+if [ -f /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+fi
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+
+# Try to stop the server in a sane way. If it does not success let the admin
+# do it himself. No database directories should be removed while the server
+# is running!
+stop_server() {
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ invoke-rc.d mysql stop
+ else
+ /etc/init.d/mysql stop
+ fi
+ errno=$?
+ set -e
+
+ if [ "$?" != 0 ]; then
+ echo "Trying to stop the MySQL server resulted in exitcode $?." 1>&2
+ echo "Stop it yourself and try again!" 1>&2
+ exit 1
+ fi
+}
+
+case "$1" in
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ if [ -n "`$MYADMIN ping 2>/dev/null`" ]; then
+ stop_server
+ sleep 2
+ fi
+ ;;
+ *)
+ echo "postrm called with unknown argument '$1'" 1>&2
+ exit 1
+ ;;
+esac
+
+#
+# - Do NOT purge logs or data if another mysql-sever* package is installed (#307473)
+# - Remove the mysql user only after all his owned files are purged.
+#
+if [ "$1" = "purge" -a ! \( -x /usr/sbin/mysqld -o -L /usr/sbin/mysqld \) ]; then
+ # we remove the mysql user only after all his owned files are purged
+ rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz}
+ rm -rf /var/log/mysql
+
+ db_input high mysql-server-5.6/postrm_remove_databases || true
+ db_go || true
+ db_get mysql-server-5.6/postrm_remove_databases || true
+ if [ "$RET" = "true" ]; then
+ # never remove the debian.cnf when the databases are still existing
+ # else we ran into big trouble on the next install!
+ rm -f /etc/mysql/debian.cnf
+ rm -rf /var/lib/mysql
+ rm -rf /var/run/mysqld
+ userdel mysql || true
+ fi
+fi
+
+# (normally) Automatically added by dh_installdebconf
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+ db_purge
+fi
+# (normally) End automatically added section
+
+#DEBHELPER#
+
+exit 0
-#!/bin/sh
-# ESP Package Manager v4.2
-getent group mysql >/dev/null || addgroup --system mysql >/dev/null
-getent passwd mysql >/dev/null || \
-adduser --system --disabled-login --ingroup mysql --home /var/lib/mysql \
- --gecos "MySQL Server" --shell /bin/false mysql >/dev/null
-[ -e "/usr/bin/my_print_defaults" ] || \
-( cd /usr/bin && ln -sf my_print_defaults_wsrep my_print_defaults )
+#!/bin/bash
+#
+# summary of how this script can be called:
+# * <new-preinst> install
+# * <new-preinst> install <old-version>
+# * <new-preinst> upgrade <old-version>
+# * <old-preinst> abort-upgrade <new-version>
+#
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+DATADIR=/var/lib/mysql
+LOGDIR=/var/log/mysql
+UPGRADEDIR=/var/lib/mysql-upgrade
+
+# Try to stop the server in a sane way. If it does not success let the admin
+# do it himself. No database directories should be removed while the server
+# is running! Another mysqld in e.g. a different chroot is fine for us.
+stop_server() {
+ if [ ! -x /etc/init.d/mysql ]; then return; fi
+
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ cmd="invoke-rc.d mysql stop"
+ else
+ cmd="/etc/init.d/mysql stop"
+ fi
+ $cmd
+ errno=$?
+ set -e
+
+ # 0=ok, 100=no init script (fresh install)
+ if [ "$errno" != 0 -a "$errno" != 100 ]; then
+ echo "${cmd/ */} returned $errno" 1>&2
+ echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
+ echo "Stop it yourself and try again!" 1>&2
+ db_stop
+ exit 1
+ fi
+}
+
+################################ main() ##########################
+
+this_version=5.6
+
+# Abort if an NDB cluster is in use.
+if egrep -qi -r '^[^#]*ndb.connectstring|^[[:space:]]*\[[[:space:]]*ndb_mgmd' /etc/mysql/; then
+ db_fset mysql-server/no_upgrade_when_using_ndb seen false || true
+ db_input high mysql-server/no_upgrade_when_using_ndb || true
+ db_go
+ db_stop
+ exit 1
+fi
+
+# Abort if skip-bdb option is enabled, required for 5.0 -> 5.1 upgrades.
+#TODO
+
+# Safe the user from stupidities.
+show_downgrade_warning=0
+for i in `ls $DATADIR/debian-*.flag 2>/dev/null`; do
+ found_version=`echo $i | sed 's/.*debian-\([0-9\.]\+\).flag/\1/'`
+ if dpkg --compare-versions "$this_version" '<<' "$found_version"; then
+ show_downgrade_warning=1
+ break;
+ fi
+done
+if [ "$show_downgrade_warning" = 1 ]; then
+ db_fset mysql-server-$this_version/really_downgrade seen false || true
+ db_input medium mysql-server-$this_version/really_downgrade || true
+ db_go
+ db_get mysql-server-$this_version/really_downgrade || true
+ if [ "$RET" = "true" ]; then
+ rm -f $DATADIR/debian-*.flag
+ touch $DATADIR/debian-$this_version.flag
+ else
+ echo "Aborting downgrade from (at least) $found_version to $this_version." 1>&2
+ echo "If are sure you want to downgrade to $this_version, remove the file" 1>&2
+ echo "$DATADIR/debian-*.flag and try installing again." 1>&2
+ db_stop
+ exit 1
+ fi
+fi
+
+# to be sure
+stop_server
+
+# If we use NIS then errors should be tolerated. It's up to the
+# user to ensure that the mysql user is correctly setup.
+# Beware that there are two ypwhich one of them needs the 2>/dev/null!
+if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
+ set +e
+fi
+
+#
+# Now we have to ensure the following state:
+# /etc/passwd: mysql:x:100:101:MySQL Server:/nonexistent:/bin/false
+# /etc/group: mysql:x:101:
+#
+# Sadly there could any state be present on the system so we have to
+# modify everything carefully i.e. not doing a chown before creating
+# the user etc...
+#
+
+# creating mysql group if he isn't already there
+if ! getent group mysql >/dev/null; then
+ # Adding system group: mysql.
+ addgroup --system mysql >/dev/null
+fi
+
+# creating mysql user if he isn't already there
+if ! getent passwd mysql >/dev/null; then
+ # Adding system user: mysql.
+ adduser \
+ --system \
+ --disabled-login \
+ --ingroup mysql \
+ --no-create-home \
+ --home /nonexistent \
+ --gecos "MySQL Server" \
+ --shell /bin/false \
+ mysql >/dev/null
+fi
+
+# end of NIS tolerance zone
+set -e
+
+# if there's a symlink, let's store where it's pointing, because otherwise
+# it's going to be lost in some situations
+for dir in DATADIR LOGDIR; do
+ checkdir=`eval echo "$"$dir`
+ if [ -L "$checkdir" ]; then
+ mkdir -p "$UPGRADEDIR"
+ cp -d "$checkdir" "$UPGRADEDIR/$dir.link"
+ fi
+done
+
+# creating mysql home directory
+if [ ! -d $DATADIR -a ! -L $DATADIR ]; then
+ mkdir $DATADIR
+fi
+
+# checking disc space
+if LC_ALL=C BLOCKSIZE= df --portability $DATADIR/. | tail -n 1 | awk '{ exit ($4>1000) }'; then
+ echo "ERROR: There's not enough space in $DATADIR/" 1>&2
+ db_stop
+ exit 1
+fi
+
+# Since the home directory was created before putting the user into
+# the mysql group and moreover we cannot guarantee that the
+# permissions were correctly *before* calling this script, we fix them now.
+# In case we use NIS and no mysql user is present then this script should
+# better fail now than later..
+# The "set +e" is necessary as e.g. a ".journal" of a ext3 partition is
+# not chgrp'able (#318435).
+set +e
+chown mysql:mysql $DATADIR
+find $DATADIR -follow -not -group mysql -print0 2>/dev/null \
+ | xargs -0 --no-run-if-empty chgrp mysql
+set -e
+
+# Some files below /etc/ were possibly in the mysql-server-5.0/etch package
+# before. They get overwritten by current ones to avoid unnecessary dpkg questions.
+while read md5 file; do
+ if [ "`md5sum $file 2>/dev/null`" = "$md5 $file" ]; then
+ cp /usr/share/mysql-common/internal-use-only/`echo $file | sed 's°/°_°g'` $file
+ fi
+done <<EOT
+6691f2fdc5c6d27ff0260eb79813e1bc /etc/init.d/mysql
+b53b9552d44661361d39157c3c7c51d3 /etc/logrotate.d/mysql-server
+57f3e58f72582ca55100dc1ba0f1a8ae /etc/mysql/debian-start
+EOT
+
+db_stop
+
+#DEBHELPER#
+
+exit 0
-#!/bin/sh
-# ESP Package Manager v4.2
-if [ -x /usr/sbin/invoke-rc.d ]; then
- invoke-rc.d mysql stop
-else
- /etc/init.d/mysql stop
-fi
-update-rc.d -f mysql remove >/dev/null || exit
-[ ! -L /usr/bin/my_print_defaults ] || rm -rf /usr/bin/my_print_defaults
-[ ! -L /etc/apparmor.d/disable/usr.sbin.mysqld ] || rm -rf /etc/apparmor.d/disable/usr.sbin.mysqld
-[ ! -x /etc/init.d/apparmor ] || /etc/init.d/apparmor restart
+#!/bin/bash
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+#DEBHELPER#
--- /dev/null
+# These templates have been reviewed by the debian-l10n-english
+# team
+#
+# If modifications/additions/rewording are needed, please ask
+# for an advice to debian-l10n-english@lists.debian.org
+#
+# Even minor modifications require translation updates and such
+# changes should be coordinated with translators and reviewers.
+
+Template: mysql-server-5.6/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-server-5.6/nis_warning
+Type: note
+#flag:translate!:3,5
+_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-server-5.6/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.
+ .
+ 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-server-5.6/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-server/root_password
+Type: password
+_Description: New password for the MySQL "root" user:
+ While not mandatory, it is highly recommended that you set a password
+ for the MySQL administrative "root" user.
+ .
+ If this field is left blank, the password will not be changed.
+
+Template: mysql-server/root_password_again
+Type: password
+_Description: Repeat password for the MySQL "root" user:
+
+Template: mysql-server/error_setting_password
+Type: error
+_Description: Unable to set password for the MySQL "root" user
+ 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.
+ .
+ You should check the account's password after the package installation.
+ .
+ Please read the /usr/share/doc/mysql-server-5.6/README.Debian file
+ for more information.
+
+Template: mysql-server/password_mismatch
+Type: error
+_Description: Password input error
+ The two passwords you entered were not the same. Please try again.
+
+Template: mysql-server/no_upgrade_when_using_ndb
+Type: error
+_Description: NDB Cluster seems to be in use
+ 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/.
-#debian/additions/my5.6.cnf etc/mysql/conf.d/
-builddir/support-files/wsrep.cnf etc/mysql/conf.d/
-builddir/support-files/wsrep.cnf usr/share/mysql/
-builddir/support-files/my-default.cnf usr/share/mysql/
-
+debian/additions/my.cnf etc/mysql/
+debian/additions/my5.6.cnf etc/mysql/conf.d/
--- /dev/null
+The examples directory includes files that might be needed by some
+developers:
+- header files not installed by default
+- the example file udf_example.c
--- /dev/null
+usr/include/
+usr/lib/
--- /dev/null
+sql/udf_example.cc
--- /dev/null
+usr/bin/mysql_config
+usr/include/mysql/*
+usr/lib/*/libmysqlclient.a
+usr/lib/*/libmysqlclient.so
+usr/lib/*/libmysqlclient_r.a
+usr/lib/*/libmysqlclient_r.so
+usr/share/aclocal/mysql.m4
--- /dev/null
+usr/lib/*/libmysqlclient.so.18*
+usr/lib/*/libmysqlclient_r.so.18*
--- /dev/null
+# I take this issue seriously but as per bug #590905
+# it will need playing with in experimental. - periapt
+libmysqlclient18: no-symbols-control-file usr/lib/i386-linux-gnu/libmysqlclient.so.18.1.0
--- /dev/null
+/usr/lib/mysql-testsuite
+usr/share/mysql/mysql-test/suite/wsrep
+usr/share/mysql/mysql-test/suite/wsrep/t
+usr/share/mysql/mysql-test/suite/wsrep/r
--- /dev/null
+usr/share/mysql-test/* usr/lib/mysql-testsuite/
--- /dev/null
+# These are random occurrences of a pseudo word in a binary.
+mysql-testsuite-5.6: spelling-error-in-binary usr/bin/mysql_client_test_embedded yuR your
+mysql-testsuite-5.6: spelling-error-in-binary usr/bin/mysql_embedded yuR your
+mysql-testsuite-5.6: spelling-error-in-binary usr/bin/mysqltest_embedded yuR your
scripts__mysqld_safe.sh__signals.patch
fix_standalone_tests.patch
kfreebsd_tests.patch
-fix-mysqlhotcopy-test-failure.patch
-debian_patches_CVE-2016-6662.patch
-[type: gettext/rfc822deb] mysql-server-5.6.templates
+[type: gettext/rfc822deb] mysql-server-wsrep-5.6.templates
msgid ""
msgstr ""
"Project-Id-Version: templates\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "هل فعلاً تريد التثبيط؟"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
#, fuzzy
#| msgid ""
#| "Such file is an indication that a mysql-server package with a higher "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid "Important note for NIS/YP users"
msgstr "ملاحظة هامة لمستخدمي NIS/YP"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
#, fuzzy
#| msgid ""
#| "You should also check the permissions and the owner of the /var/lib/mysql "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "إزالة جميع قواعد بيانات MySQL؟"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
msgid "Start the MySQL server on boot?"
msgstr "تشغيل خادم MySQL عند الإقلاع؟"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-wsrep-server-5.6.templates:6001
msgid "New password for the MySQL \"root\" user:"
msgstr "كلمة المرور الجديدة لمستخد \"root\" الخاص بـMySQL:"
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
#, fuzzy
#| msgid "New password for the MySQL \"root\" user:"
msgid "Repeat password for the MySQL \"root\" user:"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "Unable to set password for the MySQL \"root\" user"
msgstr "تعذر تعيين كلمة مرور للمستخدم \"root\" الخاص بـMySQL."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "You should check the account's password after tha package installation."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-4.1\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
#, fuzzy
#| msgid "Important note for NIS/YP users!"
msgid "Important note for NIS/YP users"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
#, fuzzy
#| msgid "Should MySQL start on boot?"
msgid "Start the MySQL server on boot?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
#, fuzzy
msgid ""
"The MySQL server can be launched automatically at boot time or manually with "
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-wsrep-server-5.6.templates:6001
msgid "New password for the MySQL \"root\" user:"
msgstr ""
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
msgid "Repeat password for the MySQL \"root\" user:"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "Unable to set password for the MySQL \"root\" user"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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ó "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.6\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "Opravdu pokračovat v degradaci?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
#, fuzzy
#| msgid ""
#| "Such file is an indication that a mysql-server package with a higher "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
#, fuzzy
#| msgid ""
#| "You should also check the permissions and the owner of the /var/lib/mysql "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Odstranit všechny MySQL databáze?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
#, fuzzy
#| msgid "New password for the MySQL \"root\" user:"
msgid "Repeat password for the MySQL \"root\" user:"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "You should check the account's password after tha package installation."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-5.1\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "Ønsker du virkelig at fortsætte nedgraderingen?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Fjern alle MySQL-databaser?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
msgid "Start the MySQL server on boot?"
msgstr "Start MySQL-serveren under systemopstart?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Inddatafejl for adgangskode"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
#, fuzzy
#| msgid ""
#| "MySQL-5.1 no longer provides NDB Cluster support. Please migrate to the "
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg 5.6.23-2\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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-*."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Alle MySQL-Datenbanken entfernen?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Passwort-Eingabefehler"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../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/."
+"Ihr System zum neuen »mysql-cluster-server«-Paket und entfernen Sie alle "
+"Zeilen, die mit »ndb« beginnen aus allen Konfigurationsdateien im "
+"Verzeichnis /etc/mysql/."
msgid ""
msgstr ""
"Project-Id-Version: mysql-5.6\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "¿Desea realmente continuar con la desactualización?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../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/."
+"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 "
msgid ""
msgstr ""
"Project-Id-Version: eu\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "Benetan bertsio zaharragora itzuli nahi duzu?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
#, fuzzy
#| msgid ""
#| "Such file is an indication that a mysql-server package with a higher "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid "Important note for NIS/YP users"
msgstr "NIS/YP erabiltzaileentzat ohar garrantzitsua"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
#, fuzzy
#| msgid ""
#| "You should also check the permissions and the owner of the /var/lib/mysql "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Ezabatu MySQL datubase guztiak?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
msgid "Start the MySQL server on boot?"
msgstr "Abioan MySQL zerbitzaria abiarazi?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Pasahitz sarrera errorea"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
#, fuzzy
#| msgid ""
#| "MySQL-5.6 has orphaned NDB Cluster support. Please migrate to the new "
msgid ""
msgstr ""
"Project-Id-Version: fr\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Erreur de saisie du mot de passe"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.6\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "¿Quere pasar a unha versión anterior?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
#, fuzzy
#| msgid ""
#| "Such file is an indication that a mysql-server package with a higher "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
#, fuzzy
#| msgid ""
#| "You should also check the permissions and the owner of the /var/lib/mysql "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
#, fuzzy
#| msgid "New password for the MySQL \"root\" user:"
msgid "Repeat password for the MySQL \"root\" user:"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "You should check the account's password after tha package installation."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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 "
-# Italian (it) translation of debconf templates for mysql-dfsg-5.6
-# Copyright (C) 2009 Software in the Public Interest
-# This file is distributed under the same license as the mysql-dfsg-5.6 package.
-# Luca Monducci <luca.mo@tiscali.it>, 2006 - 2009.
-#
+# 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-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "Procedere realmente con l'abbassamento di versione?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Eliminare tutti i database MySQL?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Errore di inserimento della password"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
#, fuzzy
#| msgid ""
#| "MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the "
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.6 5.6.8-1\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "本当にダウングレードを実行しますか?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid "Important note for NIS/YP users"
msgstr "NIS/YP ユーザへの重要な注意"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "すべての MySQL データベースを削除しますか?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
msgid "Start the MySQL server on boot?"
msgstr "MySQL をシステム起動時に開始しますか?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-wsrep-server-5.6.templates:6001
msgid "New password for the MySQL \"root\" user:"
msgstr "MySQL の \"root\" ユーザに対する新しいパスワード:"
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
msgid "Repeat password for the MySQL \"root\" user:"
msgstr "MySQL の \"root\" ユーザに対する新しいパスワード:"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "Unable to set password for the MySQL \"root\" user"
msgstr "MySQL の \"root\" ユーザのパスワードを設定できません"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "You should check the account's password after the package installation."
msgstr ""
"パッケージのインストール後、アカウントのパスワードを確認する必要があります。"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "パスワード入力エラー"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr "NDB クラスタが利用されているようです"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
#, fuzzy
#| msgid ""
#| "MySQL-5.6 no longer provides NDB Cluster support. Please migrate to the "
msgid ""
msgstr ""
"Project-Id-Version: mysql_nb\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
#, fuzzy
#| msgid "Do you really want to downgrade?"
msgid "Really proceed with downgrade?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
#, fuzzy
#| msgid ""
#| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
#, fuzzy
#| msgid "Important note for NIS/YP users!"
msgid "Important note for NIS/YP users"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
#, fuzzy
#| msgid ""
#| "The script is about to remove the data directory /var/lib/mysql. If it is "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
#, fuzzy
#| msgid "Should MySQL start on boot?"
msgid "Start the MySQL server on boot?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
#, fuzzy
#| msgid ""
#| "The MySQL can start automatically on boot time or only if you manually "
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-wsrep-server-5.6.templates:6001
#, fuzzy
#| msgid "New password for MySQL \"root\" user:"
msgid "New password for the MySQL \"root\" user:"
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-wsrep-server-5.6.templates:6001
#, fuzzy
#| msgid ""
#| "It is highly recommended that you set a password for the MySQL "
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
#, fuzzy
#| msgid "New password for MySQL \"root\" user:"
msgid "Repeat password for the MySQL \"root\" user:"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "It seems an error occurred while setting the password for the MySQL "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "You should check the account's password after the package installation."
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-5.6 5.6.6-1\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "Wilt u echt een oude versie herstellen?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Wilt u alle MySQL-databases verwijderen?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Fout bij invoer wachtwoord"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.6\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "Deseja mesmo fazer downgrade?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Remover todas as bases de dados MySQL?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Erro de entrada da palavra-passe"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.6\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
#, fuzzy
#| msgid ""
#| "Such file is an indication that a mysql-server package with a higher "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
#, fuzzy
#| msgid ""
#| "You should also check the permissions and the owner of the /var/lib/mysql "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
#, fuzzy
#| msgid "New password for the MySQL \"root\" user:"
msgid "Repeat password for the MySQL \"root\" user:"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "You should check the account's password after tha package installation."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: po-debconf://mysql-dfsg\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
#, fuzzy
#| msgid "Do you really want to downgrade?"
msgid "Really proceed with downgrade?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
#, fuzzy
#| msgid ""
#| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
#, fuzzy
#| msgid "Important note for NIS/YP users!"
msgid "Important note for NIS/YP users"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
#, fuzzy
#| msgid ""
#| "The script is about to remove the data directory /var/lib/mysql. If it is "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
#, fuzzy
#| msgid "Should MySQL start on boot?"
msgid "Start the MySQL server on boot?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
#, fuzzy
#| msgid ""
#| "The MySQL can start automatically on boot time or only if you manually "
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-wsrep-server-5.6.templates:6001
#, fuzzy
#| msgid "New password for MySQL \"root\" user:"
msgid "New password for the MySQL \"root\" user:"
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-wsrep-server-5.6.templates:6001
#, fuzzy
#| msgid ""
#| "It is highly recommended that you set a password for the MySQL "
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
#, fuzzy
#| msgid "New password for MySQL \"root\" user:"
msgid "Repeat password for the MySQL \"root\" user:"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "It seems an error occurred while setting the password for the MySQL "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "You should check the account's password after the package installation."
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.6 5.6.8-1\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "Действительно установить более старую версию?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid "Important note for NIS/YP users"
msgstr "Важное замечание для пользователей NIS/YP"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Удалить все базы данных MySQL?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
msgid "Start the MySQL server on boot?"
msgstr "Запускать MySQL при загрузке системы?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-wsrep-server-5.6.templates:6001
msgid "New password for the MySQL \"root\" user:"
msgstr "Новый пароль для MySQL пользователя «root»:"
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
msgid "Repeat password for the MySQL \"root\" user:"
msgstr "Повторите ввод пароля для MySQL пользователя «root»:"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "Unable to set password for the MySQL \"root\" user"
msgstr "Невозможно задать пароль MySQL пользователю «root»"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "You should check the account's password after the package installation."
msgstr "Проверьте пароль учётной записи после установки пакета."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Ошибка ввода пароля"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr "NDB Cluster уже используется"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-5.1 5.1.49-3\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "Naozaj pokračovať v znížení verzie?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Odstrániť všetky databázy MySQL?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
#, fuzzy
#| msgid ""
#| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Chyba pri zadávaní hesla"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
#, fuzzy
#| msgid ""
#| "MySQL-5.1 no longer provides NDB Cluster support. Please migrate to the "
-# Translation of mysql-5.6 debconf template to Swedish
-# Copyright (C) 2009, 2012 Martin Bagge <brother@bsnet.se>
-# This file is distributed under the same license as the mysql-5.6 package.
-#
-# Andreas Henriksson <andreas@fatal.se>, 2007
-# Martin Bagge <brother@bsnet.se>, 2009, 2012
+# 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-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr "Vill du verkligen genomföra nedgraderingen?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr "Ta bort alla MySQL-databaser?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../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-server-5.6.templates:5001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../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-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr "Fel vid inmatning av lösenord"
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../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-server-5.6.templates:10001
+#: ../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 "
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\n"
+"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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-server-wsrep-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-server-wsrep-5.6.templates:2001
msgid "A file named /var/lib/mysql/debian-*.flag exists on this system."
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-server-wsrep-5.6.templates:2001
msgid ""
"Such a file is an indication that a mysql-server package with a higher "
"version has been installed previously."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-server-wsrep-5.6.templates:2001
msgid ""
"There is no guarantee that the version you're currently installing will be "
"able to use the current databases."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-server-wsrep-5.6.templates:3001
msgid "Important note for NIS/YP users"
msgstr ""
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-server-wsrep-5.6.templates:3001
msgid ""
"Using MySQL under NIS/YP requires a mysql user account to be added on the "
"local system with:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-server-wsrep-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-server-wsrep-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-server-wsrep-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-server-wsrep-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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-server-wsrep-5.6.templates:5001
msgid "Start the MySQL server on boot?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-server-wsrep-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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-server-wsrep-5.6.templates:6001
msgid "New password for the MySQL \"root\" user:"
msgstr ""
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-server-wsrep-5.6.templates:6001
msgid ""
"While not mandatory, it is highly recommended that you set a password for "
"the MySQL administrative \"root\" user."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-server-wsrep-5.6.templates:6001
msgid "If this field is left blank, the password will not be changed."
msgstr ""
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:7001
+#: ../mysql-server-wsrep-5.6.templates:7001
msgid "Repeat password for the MySQL \"root\" user:"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-server-wsrep-5.6.templates:8001
msgid "Unable to set password for the MySQL \"root\" user"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-server-wsrep-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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-server-wsrep-5.6.templates:8001
msgid "You should check the account's password after the package installation."
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-server-wsrep-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-server-wsrep-5.6.templates:9001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-server-wsrep-5.6.templates:9001
msgid "The two passwords you entered were not the same. Please try again."
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../mysql-server-wsrep-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../mysql-server-wsrep-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 "
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-4.1\n"
-"Report-Msgid-Bugs-To: mysql-5.6@packages.debian.org\n"
-"POT-Creation-Date: 2011-11-08 11:42-0800\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"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../mysql-wsrep-server-5.6.templates:2001
msgid "Really proceed with downgrade?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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-server-5.6.templates:2001
+#: ../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."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:2001
+#: ../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."
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
#, fuzzy
#| msgid "Important note for NIS/YP users!"
msgid "Important note for NIS/YP users"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../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:"
#. Type: note
#. Description
-#: ../mysql-server-5.6.templates:3001
+#: ../mysql-wsrep-server-5.6.templates:3001
msgid ""
"You should also check the permissions and ownership of the /var/lib/mysql "
"directory:"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid "Remove all MySQL databases?"
msgstr ""
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../mysql-wsrep-server-5.6.templates:4001
msgid ""
"The /var/lib/mysql directory which contains the MySQL databases is about to "
"be removed."
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:4001
+#: ../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 "
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
#, fuzzy
#| msgid "Should MySQL start on boot?"
msgid "Start the MySQL server on boot?"
#. Type: boolean
#. Description
-#: ../mysql-server-5.6.templates:5001
+#: ../mysql-wsrep-server-5.6.templates:5001
#, fuzzy
msgid ""
"The MySQL server can be launched automatically at boot time or manually with "
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../mysql-wsrep-server-5.6.templates:6001
msgid "New password for the MySQL \"root\" user:"
msgstr ""
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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."
#. Type: password
#. Description
-#: ../mysql-server-5.6.templates:6001
+#: ../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-server-5.6.templates:7001
+#: ../mysql-wsrep-server-5.6.templates:7001
msgid "Repeat password for the MySQL \"root\" user:"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "Unable to set password for the MySQL \"root\" user"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../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 "
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid "You should check the account's password after the package installation."
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:8001
+#: ../mysql-wsrep-server-5.6.templates:8001
msgid ""
"Please read the /usr/share/doc/mysql-server-5.6/README.Debian file for more "
"information."
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../mysql-wsrep-server-5.6.templates:9001
msgid "Password input error"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:9001
+#: ../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-server-5.6.templates:10001
+#: ../mysql-wsrep-server-5.6.templates:10001
msgid "NDB Cluster seems to be in use"
msgstr ""
#. Type: error
#. Description
-#: ../mysql-server-5.6.templates:10001
+#: ../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 "
TESTSUITE_FAIL_CMD:=true
TMP := $(CURDIR)/debian/tmp/
USE_ASSEMBLER:=--enable-assembler
+NUMJOBS=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ifeq (,$(NUMJOBS))
+ NUMJOBS=1
+endif
+
+MAKEFLAGS += -j $(NUMJOBS)
export MYSQL_BUILD_CC=$(DEB_HOST_GNU_TYPE)-gcc
export MYSQL_BUILD_CXX=$(DEB_HOST_GNU_TYPE)-g++
+# The full upstream test suite takes a very long time to run, so we run
+# only the main test suite unless fulltest is specified.
+ifeq ($(findstring fulltest,$(DEB_BUILD_OPTIONS)),)
+ MTR_SUITE=--suite=main
+endif
ifneq (,$(filter $(ARCH), i386 kfreebsd-i386 hurd-i386))
TAOCRYPT_OPT="-DTAOCRYPT_DISABLE_X86ASM"
override_dh_auto_build: build-stamp
-build-stamp:
+# $(EXPORTED_SOURCE_TARBALL) must be built before the builds commence, since
+# the builds change some of the files picked up by this tar invocation, and
+# this can race against tar with an error like "tar:
+# ./builddir-pic/strings/CMakeFiles/strings.dir: file changed as we read it".
+# So define the rule for building it here, and have the build rules depend on
+# it.
+$(EXPORTED_SOURCE_TARBALL):
+ GZIP=-n tar -zcf $(EXPORTED_SOURCE_TARBALL) \
+ --exclude=debian . \
+ --transform="s,^\./,mysql-5.6/,"
+
+build-stamp: $(EXPORTED_SOURCE_TARBALL)
@echo "RULES.$@"
- [ -f $(EXPORTED_SOURCE_TARBALL) ] || tar -zcf $(EXPORTED_SOURCE_TARBALL) \
- --exclude=debian . \
- --transform="s,^\./,mysql-5.6/,"
cd $(builddir) && $(MAKE)
touch $@
-build-pic-stamp:
+build-pic-stamp: $(EXPORTED_SOURCE_TARBALL)
# Don't call this section from dh_auto_build as
# linmysqld does not exsist in mysql-wsrep
@echo "RULES.$@"
+ cd $(builddir) && $(MAKE) -C sql
cd $(builddir) && $(MAKE) -C scripts
cd $(builddir) && $(MAKE) -C libmysqld
touch $@
override_dh_auto_test:
@echo "RULES.$@"
ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),)
- cp unittest/unit.pl $(builddir)/unittest/
cp -r mysql-test/* $(builddir)/mysql-test/
cp -r sql/share/* $(builddir)/sql/share/
cp -r scripts/*sql $(builddir)/scripts/
- cd $(builddir) && $(MAKE) $(MAKE_TEST_TARGET) || $(TESTSUITE_FAIL_CMD) ;
+ifeq ($(ARCH_OS),hurd)
+ # Tests not fully working under Hurd, see
+ # http://bugs.mysql.com/bug.php?id=64685. Run unit tests only.
+ cd $(builddir) && $(MAKE) test || $(TESTSUITE_FAIL_CMD) ;
+else
+ # Skip replication tests since they are timing sensitive and may
+ # result in false positives.
+ cd $(builddir)/mysql-test && ./mtr --parallel=$(NUMJOBS) --skip-rpl $(MTR_SUITE) || $(TESTSUITE_FAIL_CMD) ;
+endif
endif
override_dh_auto_install: auto_install-stamp
dh_testroot
# make install (trailing slash needed for innobase)
cd $(builddir) && $(MAKE) install DESTDIR=$(TMP)/
+ # After installing, remove rpath to make lintian happy.
+ set +e; \
+ find ./debian/tmp/ -type f -print0 \
+ | xargs -0 --no-run-if-empty chrpath -k 2>/dev/null \
+ | fgrep RPATH= \
+ | cut -d: -f 1 \
+ | xargs --no-run-if-empty chrpath -d; \
+ set -e
# install libmysqld built with -FPIC
install -d -m 0755 -o root -g root $(TMP)/usr/lib/mysql
# linmysqld does not exsist in mysql-wsrep
nm -n $(BUILDDIR)/sql/mysqld |gzip -9 > $(TMP)/usr/share/doc/mysql-server-5.6/mysqld.sym.gz
install -m 0644 support-files/wsrep.cnf $(TMP)/usr/share/mysql
# This seems to be the only safe place to fix permissions issues
- # not handled by dh_fixperms.
+ # not handled by dh_fixperms.
mkdir -p $(TMP)/etc/mysql/conf.d/
touch $(TMP)/etc/mysql/conf.d/.keepme
install -D -m 0755 $(builddir)/support-files/mysql.server $(TMP)/etc/init.d/mysql
install -m 0644 debian/additions/mysql_config_pic.1 $(TMP)/usr/share/man/man1
install -m 0644 debian/additions/mysql_embedded.1 $(TMP)/usr/share/man/man1
install -m 0644 debian/additions/debian_create_root_user.sql $(TMP)/usr/share/mysql/
+ install -m 0755 debian/additions/mysql-systemd-start $(TMP)/usr/share/mysql/
# install AppArmor profile
install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mysqld
chmod 0755 $(TMP)/usr/share/mysql-test/std_data/checkDBI_DBD-mysql.pl
install -D -m 644 debian/mysql-server-5.6.py $(TMP)/usr/share/apport/package-hooks/source_mysql-5.6.py
# chmod 0644 $(TMP)/usr/share/mysql/*.ini
chmod 0644 $(TMP)/usr/bin/mysqlaccess.conf
+ chmod 0644 $(TMP)/usr/share/mysql-test/suite/innodb_stress/include/innodb_stress.inc
+ chmod 0644 $(TMP)/usr/share/mysql-test/suite/innodb_stress/t/load_generator.py
+ chmod 0644 $(TMP)/usr/share/mysql-test/suite/innodb_stress/t/*.test
+ chmod 0644 $(TMP)/usr/share/mysql-test/suite/innodb_stress/t/*.opt
touch $@
# Use the --fail-missing to check for stuff that we should be installing
override_dh_installlogrotate-arch:
dh_installlogrotate --name mysql-server
+
+override_dh_install:
+ dh_install
dh_apparmor -pmysql-server-5.6 --profile-name=usr.sbin.mysqld
+override_dh_installchangelogs:
+ dh_installchangelogs Docs/ChangeLog
+
+override_dh_systemd_enable:
+ dh_systemd_enable --name=mysql --no-enable
+
# Start mysql in runlevel 19 before 20 where apache, proftpd etc gets
# started which might depend on a running database server.
override_dh_installinit-arch:
dh_installinit --name=mysql -- defaults 19 21
+ #dh_systemd_start --restart-after-upgrade
override_dh_installcron-arch:
dh_installcron --name mysql-server
uscan --force-download --verbose
%:
- dh $@ --parallel
+ dh $@ --parallel --with systemd
ENABLE_TESTING()
ENDIF()
+OPTION(WITH_SYMVER16
+ "Export libmysqlclient_16 and libmysqlclient_18 symbol versions" OFF)
+
+IF(WITH_SYMVER16)
+ ADD_DEFINITIONS(-DEXPORT_SYMVER16)
+ENDIF()
+
IF(NOT WITHOUT_SERVER)
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
# Add storage engines and plugins.
ENDIF()
IF(WITH_UNIT_TESTS)
- ADD_SUBDIRECTORY(unittest)
- ADD_SUBDIRECTORY(unittest/examples)
- ADD_SUBDIRECTORY(unittest/mytap)
- ADD_SUBDIRECTORY(unittest/mytap/t)
# Visual Studio 11 needs this extra flag in order to compile gmock.
IF(WIN32)
ADD_DEFINITIONS( /D _VARIADIC_MAX=10 )
IF(HAVE_LLVM_LIBCPP)
ADD_DEFINITIONS(-DGTEST_USE_OWN_TR1_TUPLE=1)
ENDIF()
- ADD_SUBDIRECTORY(unittest/gunit)
+ ADD_SUBDIRECTORY(unittest)
+ ADD_SUBDIRECTORY(unittest/examples)
+ ADD_SUBDIRECTORY(unittest/mytap)
+ ADD_SUBDIRECTORY(unittest/mytap/t)
ENDIF()
ADD_SUBDIRECTORY(extra)
--- /dev/null
+All contributors are required to add their name and [Github username/email]
+to this file in connection with their first contribution. If you are making
+a contribution on behalf of a company, you should add the said company name.
+
+By adding your name and [Github username/email] to this file you agree that
+your contribution is a contribution under a contributior agreement between
+you and Codership Oy. To the extent that you are an employee of a company and
+contribute in that role, you confirm that your contribution is a contribution
+under the contribution license agreement between your employer and Codership
+Oy; and that you have the authorization to give such confirmation. You confirm
+that you have read, understood and signed the contributor license agreement
+applicable to you.
+
+For the individual contributor agreement see file CONTRIBUTOR_AGREEMENT.txt
+in the same directory as this file.
+
+Authors from Codership Oy:
+
+ *
+ [Codership employees, add name and email/username above this line, but leave this line intact]
+
+Other contributors:
+
+ *
+ [add name and email/username above this line, but leave this line intact]
--- /dev/null
+Codership Individual Contributor License Agreement
+
+Thank you for your interest in contributing to Galera Cluster, a project
+managed by Codership Oy, a legal entity established under Finnish laws, with
+its principal address at Pohjolankatu 64 A, 00600 Helsinki Finland (“We”, “Us”
+or “Our”).
+
+This contributor agreement (“Agreement”) documents the rights granted by
+contributors to Us. To make this document effective, please either accept it
+in an electronic service such as clahub.com or sign and scan it and send it
+to Us by email. This is a legally binding document, so please read it
+carefully before agreeing to it. This Agreement covers the Galera Cluster
+project: the Galera library, the Wsrep patch for MySQL and other eventual
+patches to MySQL or other technologies.
+
+(1) Definitions
+
+“You” means the individual who Submits a Contribution to Us.
+
+“Contribution” means any work of authorship that is Submitted by You to Us in
+which You own or assert ownership of the Copyright. If You do not own the
+Copyright in the entire work of authorship, you need to have a separate
+permission from Us.
+
+“Copyright” means all rights protecting works of authorship owned or
+controlled by You, including copyright, moral and neighboring rights,
+as appropriate, for the full term of their existence including any extensions
+by You.
+
+“Material” means the work of authorship which is made available by Us to third
+parties, i.e. the Galera library, the Wsrep patch for MySQL; other eventual
+patches to MySQL; other eventual patches to other database technologies; all
+these together with a database technology, such as MySQL, or its derivatives.
+After You Submit the Contribution, it may be included in the Material.
+
+“Submit” means any form of electronic, verbal, or written communication sent
+to Us or our representatives, including but not limited to electronic mailing
+lists, source code control systems, and issue tracking systems that are
+managed by, or on behalf of, Us for the purpose of discussing and improving
+the Material, provided that such communication is (i) conspicuously marked or
+otherwise designated in writing by You or Your employee as a “Contribution” or
+(ii) submitted in source code control system pursuant to Section 3 (e).
+
+“Submission Date” means the date on which You Submit a Contribution to Us.
+
+“Effective Date” means the date You execute this Agreement or the date You
+first Submit a Contribution to Us, whichever is earlier.
+
+“Media” means any portion of a Contribution which is not software.
+
+(2) Grant of Rights
+
+2.1 Copyright License
+
+(a) You retain ownership of the Copyright in Your Contribution and have the
+same rights to use or license the Contribution which You would have had
+without entering into the Agreement. In case we have in writing permitted
+submitting a sublicense to licensed rights, You will not transfer the original
+license, but grant us a sublicense in accordance with this Agreement.
+
+(b) To the maximum extent permitted by the relevant law, You grant to Us
+a perpetual, worldwide, non-exclusive, transferable, royalty-free, irrevocable
+license under the Copyright covering the Contribution, with the right
+to sublicense such rights through multiple tiers of sublicensees, to reproduce,
+modify, display, perform and distribute the Contribution as part
+of the Material; provided that this license is conditioned upon compliance
+with Section 2.3.
+
+2.2 Patent License
+
+For patent claims including, without limitation, method, process, and
+apparatus claims which You own, control or have the right to grant, now or
+in the future, You grant to Us a perpetual, worldwide, non-exclusive,
+transferable, royalty-free, irrevocable patent license, with the right
+to sublicense these rights to multiple tiers of sublicensees, to make, have
+made, use, sell, offer for sale, import and otherwise transfer
+the Contribution and the Contribution in combination with the Material
+(and portions of such combination). This license is granted only to the extent
+ that the exercise of the licensed rights infringes such patent claims;
+and provided that this license is conditioned upon compliance with Section 2.3.
+
+2.3 Outbound License
+
+As a condition on the grant of rights in Sections 2.1 and 2.2, to the extent
+we include Your Contribution or a part of it in a Material, we agree to
+license the Contribution only under the terms of the license or licenses which
+We are using on the Submission Date for the Material or any licenses which are
+approved by the Open Source Initiative (“OSI”) on or after the Effective Date,
+including both permissive and copyleft licenses, whether or not such licenses
+are subsequently disapproved (including any right to adopt any future version
+of a license if approved by the OSI). In addition to above defined licenses,
+We may use the following licenses for Media in the Contribution: Creative
+Commons BY 3.0 or Creative Commons BY-SA 3.0 (including the right to adopt any
+future version of a license).
+
+2.4 Moral Rights.
+
+If moral rights apply to the Contribution, to the maximum extent permitted by
+law, You waive and agree not to assert such moral rights against Us or our
+successors in interest, or any of our licensees, either direct or indirect.
+
+2.5 Enforcement.
+
+You, as a copyright holder to Your Contribution, hereby authorize us
+to enforce the OSI approved license applied by Us to a Material, but only
+to the extent Your Contribution has been included in a Material and always
+subject to Our free discretion on whether such enforcement is necessary or not.
+
+2.6 Our Rights.
+
+You acknowledge that We are not obligated to use Your Contribution as part of
+the Material and may decide to include any Contribution We consider
+appropriate.
+
+2.7 Reservation of Rights.
+
+Any rights not expressly licensed under this section are expressly reserved
+by You.
+
+(3) Agreement
+
+You confirm that:
+
+(a) You have the legal authority to enter into this Agreement.
+
+(b) You own the Copyright and patent claims covering the Contribution which
+ are required to grant the rights under Section 2.
+
+(c) The grant of rights under Section 2 does not violate any grant of rights
+ which You have made to third parties, including Your employer. If You are
+ an employee, You have had Your employer approve this Agreement or sign the
+ Entity version of this document. If You are less than eighteen years old,
+ please have Your parents or guardian sign the Agreement.
+
+(d) You have not Submitted any Code You do not own without written permission
+ from US.
+
+(e) All pull or merge requests issued under usernames confirmed by You
+ in writing are issued by You; and all such pull or merge requests contain
+ Your Contributions under this Agreement. You will notify Us in writing
+ in the event of You no longer control such usernames.
+
+(4) Disclaimer
+
+EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED
+“AS IS”. MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING,
+WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW.
+
+(5) Consequential Damage Waiver
+
+TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU BE
+LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA,
+INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING
+OUT OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT,
+TORT OR OTHERWISE) UPON WHICH THE CLAIM IS BASED. THIS WAIVER DOES NOT APPLY
+TO GROSS NEGLIGENT OR MALICIOUS ACTS OR FRAUD.
+
+(6) Miscellaneous
+
+6.1 This Agreement will be governed by and construed in accordance with the
+laws of Finland excluding its conflicts of law provisions. Under certain
+circumstances, the governing law in this section might be superseded by the
+United Nations Convention on Contracts for the International Sale of Goods
+(“UN Convention”) and the parties intend to avoid the application of the
+UN Convention to this Agreement and, thus, exclude the application of the
+UN Convention in its entirety to this Agreement.
+
+6.2 Any and all Submissions done by You prior to execution of this Agreement
+shall be nonetheless covered by this Agreement.
+
+6.3 This Agreement sets out the entire agreement between You and Us for Your
+Contributions to Us and overrides all other agreements or understandings.
+
+6.4 If You or We assign the rights or obligations received through this
+Agreement to a third party, as a condition of the assignment, that third party
+must agree in writing to abide by all the rights and obligations in the
+Agreement.
+
+6.5 The failure of either party to require performance by the other party of
+any provision of this Agreement in one situation shall not affect the right
+of a party to require such performance at any time in the future. A waiver of
+performance under a provision in one situation shall not be considered a
+waiver of the performance of the provision in the future or a waiver of the
+provision in its entirety.
+
+6.6 If any provision of this Agreement is found void and unenforceable, such
+provision will be replaced to the extent possible with a provision that comes
+closest to the meaning of the original provision and which is enforceable.
+The terms and conditions set forth in this Agreement shall apply
+notwithstanding any failure of essential purpose of this Agreement or any
+limited remedy to the maximum extent possible under law.
+
+This document has been drafted based on Harmony Inividual Contributor License
+Agreement (HA-CLA-I) Version 1.0 July 4, 2011. HA- CLA-I is available from
+harmonyagreements.org and is licensed by under Creative Commons Attribution
+3.0 Unported License.
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=6
-MYSQL_VERSION_PATCH=30
+MYSQL_VERSION_PATCH=35
MYSQL_VERSION_EXTRA=
const char *user, const char *passwd,
const char *db, uint port,
const char *unix_socket, ulong client_flag,
- my_bool ssl_required __attribute__((unused)))
+ my_bool ssl_required MY_ATTRIBUTE((unused)))
{
MYSQL *mysql= mysql_real_connect(mysql_arg, host, user, passwd, db, port,
unix_socket, client_flag);
my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
*/
static char **new_mysql_completion(const char *text,
- int start __attribute__((unused)),
- int end __attribute__((unused)))
+ int start MY_ATTRIBUTE((unused)),
+ int end MY_ATTRIBUTE((unused)))
{
if (!status.batch && !quick)
#if defined(USE_NEW_READLINE_INTERFACE)
}
-static int com_server_help(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)), char *help_arg)
+static int com_server_help(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)), char *help_arg)
{
MYSQL_ROW cur;
const char *server_cmd;
}
static int
-com_help(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_help(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
reg1 int i, j;
char * help_arg= strchr(line,' '), buff[32], *end;
/* ARGSUSED */
static int
-com_clear(String *buffer,char *line __attribute__((unused)))
+com_clear(String *buffer,char *line MY_ATTRIBUTE((unused)))
{
#ifdef HAVE_READLINE
if (status.add_to_history)
/* ARGSUSED */
static int
-com_charset(String *buffer __attribute__((unused)), char *line)
+com_charset(String *buffer MY_ATTRIBUTE((unused)), char *line)
{
char buff[256], *param;
const CHARSET_INFO *new_cs;
static int
-com_go(String *buffer,char *line __attribute__((unused)))
+com_go(String *buffer,char *line MY_ATTRIBUTE((unused)))
{
char buff[200]; /* about 110 chars used so far */
char time_buff[52+3+1]; /* time max + space&parens + NUL */
}
static int
-com_tee(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_tee(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
char file_name[FN_REFLEN], *end, *param;
static int
-com_notee(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_notee(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
if (opt_outfile)
end_tee();
#ifdef USE_POPEN
static int
-com_pager(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_pager(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
char pager_name[FN_REFLEN], *end, *param;
static int
-com_nopager(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_nopager(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
strmov(pager, "stdout");
opt_nopager=1;
#ifdef USE_POPEN
static int
-com_edit(String *buffer,char *line __attribute__((unused)))
+com_edit(String *buffer,char *line MY_ATTRIBUTE((unused)))
{
char filename[FN_REFLEN],buff[160];
int fd,tmp;
/* If arg is given, exit without errors. This happens on command 'quit' */
static int
-com_quit(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_quit(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
status.exit_status=0;
return 1;
}
static int
-com_rehash(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_rehash(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
#ifdef HAVE_READLINE
build_completion_hash(1, 0);
#ifdef USE_POPEN
static int
-com_shell(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_shell(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
char *shell_cmd;
static int
-com_print(String *buffer,char *line __attribute__((unused)))
+com_print(String *buffer,char *line MY_ATTRIBUTE((unused)))
{
tee_puts("--------------", stdout);
(void) tee_fputs(buffer->c_ptr(), stdout);
}
-static int com_source(String *buffer __attribute__((unused)),
+static int com_source(String *buffer MY_ATTRIBUTE((unused)),
char *line)
{
char source_name[FN_REFLEN], *end, *param;
/* ARGSUSED */
static int
-com_delimiter(String *buffer __attribute__((unused)), char *line)
+com_delimiter(String *buffer MY_ATTRIBUTE((unused)), char *line)
{
char buff[256], *tmp;
/* ARGSUSED */
static int
-com_use(String *buffer __attribute__((unused)), char *line)
+com_use(String *buffer MY_ATTRIBUTE((unused)), char *line)
{
char *tmp, buff[FN_REFLEN + 1];
int select_db;
}
static int
-com_warnings(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_warnings(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
show_warnings = 1;
put_info("Show warnings enabled.",INFO_INFO);
}
static int
-com_nowarnings(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_nowarnings(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
show_warnings = 0;
put_info("Show warnings disabled.",INFO_INFO);
static int
-com_status(String *buffer __attribute__((unused)),
- char *line __attribute__((unused)))
+com_status(String *buffer MY_ATTRIBUTE((unused)),
+ char *line MY_ATTRIBUTE((unused)))
{
const char *status_str;
char buff[40];
}
}
-static int com_prompt(String *buffer __attribute__((unused)),
+static int com_prompt(String *buffer MY_ATTRIBUTE((unused)),
char *line)
{
char *ptr=strchr(line, ' ');
/*
- Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2012, 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
my_bool
my_program_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
my_bool
my_set_command_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
my_bool
my_remove_command_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
my_bool
my_print_command_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
my_bool
my_reset_command_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
/*
- Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static void usage(void)
{
PRINT_VERSION;
- puts("Copyright (c) 2011, 2015, Oracle and/or its affiliates. "
+ puts("Copyright (c) 2011, 2016, Oracle and/or its affiliates. "
"All rights reserved.\n");
puts("Enable or disable plugins.");
printf("\nUsage: %s [options] <plugin> ENABLE|DISABLE\n\nOptions:\n",
static my_bool
get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
static const char *load_default_groups[]= { "mysqladmin","client",0 };
my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
int error = 0;
}
-sig_handler endprog(int signal_number __attribute__((unused)))
+sig_handler endprog(int signal_number MY_ATTRIBUTE((unused)))
{
interrupted=1;
}
int offset= sprintf(buffer, "ALTER USER USER() IDENTIFIED BY '");
int length= (int)mysql_real_escape_string(mysql, buffer + offset,
- typed_password,
+ typed_password, (ulong)
strlen(typed_password));
if (length == -1)
{
/* 3.rd argument, uint row, is not in use. Don't remove! */
static void print_row(MYSQL_RES *result, MYSQL_ROW cur,
- uint row __attribute__((unused)))
+ uint row MY_ATTRIBUTE((unused)))
{
uint i,length;
MYSQL_FIELD *field;
}
-static void print_relative_row_vert(MYSQL_RES *result __attribute__((unused)),
+static void print_relative_row_vert(MYSQL_RES *result MY_ATTRIBUTE((unused)),
MYSQL_ROW cur,
- uint row __attribute__((unused)))
+ uint row MY_ATTRIBUTE((unused)))
{
uint length;
ulonglong tmp;
if (mysql_query(mysql, "SHOW VARIABLES LIKE 'pid_file'"))
{
- my_printf_error(0, "query failed; error: '%s'", error_flags,
- mysql_error(mysql));
+ my_printf_error(mysql_errno(mysql),
+ "The query to get the server's pid file failed,"
+ " error: '%s'. Continuing.", error_flags,
+ mysql_error(mysql));
}
result = mysql_store_result(mysql);
if (result)
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern "C" my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
bool tty_password=0;
*/
static Exit_status safe_connect()
{
+ /*
+ A possible old connection's resources are reclaimed now
+ at new connect attempt. The final safe_connect resources
+ are mysql_closed at the end of program, explicitly.
+ */
+ mysql_close(mysql);
mysql= mysql_init(NULL);
if (!mysql)
static int process_all_tables_in_db(char *database);
static int process_one_db(char *database);
static int use_db(char *database);
-static int handle_request_for_tables(char *tables, uint length);
+static int handle_request_for_tables(char *tables, size_t length);
static int dbConnect(char *host, char *user,char *passwd);
static void dbDisconnect(char *host);
static void DBerror(MYSQL *mysql, const char *when);
static void safe_exit(int error);
static void print_result();
-static uint fixed_name_length(const char *name);
+static size_t fixed_name_length(const char *name);
static char *fix_table_name(char *dest, char *src);
int what_to_do = 0;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
int orig_what_to_do= what_to_do;
*end++= ',';
}
*--end = 0;
- handle_request_for_tables(table_names_comma_sep + 1, (uint) (tot_length - 1));
+ handle_request_for_tables(table_names_comma_sep + 1, tot_length - 1);
my_free(table_names_comma_sep);
}
else
} /* process_selected_tables */
-static uint fixed_name_length(const char *name)
+static size_t fixed_name_length(const char *name)
{
const char *p;
- uint extra_length= 2; /* count the first/last backticks */
+ size_t extra_length= 2; /* count the first/last backticks */
for (p= name; *p; p++)
{
else if (*p == '.')
extra_length+= 2;
}
- return (uint) ((p - name) + extra_length);
+ return (size_t) ((p - name) + extra_length);
}
*/
char *tables, *end;
- uint tot_length = 0;
+ size_t tot_length = 0;
while ((row = mysql_fetch_row(res)))
tot_length+= fixed_name_length(row[0]) + 2;
int rc= 0;
if (strncmp(name, "#mysql50#", 9))
return 1;
- sprintf(qbuf, "RENAME TABLE `%s` TO `%s`", name, name + 9);
+ my_snprintf(qbuf, sizeof(qbuf), "RENAME TABLE `%s` TO `%s`",
+ name, name + 9);
+
rc= run_query(qbuf);
if (verbose)
printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
int rc= 0;
if (strncmp(name, "#mysql50#", 9))
return 1;
- sprintf(qbuf, "ALTER DATABASE `%s` UPGRADE DATA DIRECTORY NAME", name);
+ my_snprintf(qbuf, sizeof(qbuf), "ALTER DATABASE `%s` UPGRADE DATA DIRECTORY "
+ "NAME", name);
rc= run_query(qbuf);
if (verbose)
printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
ptr= strmov(query, "ALTER TABLE ");
ptr= fix_table_name(ptr, name);
ptr= strxmov(ptr, " FORCE", NullS);
- if (mysql_real_query(sock, query, (uint)(ptr - query)))
+ if (mysql_real_query(sock, query, (ulong)(ptr - query)))
{
fprintf(stderr, "Failed to %s\n", query);
fprintf(stderr, "Error: %s\n", mysql_error(sock));
return run_query(stmt);
}
-static int handle_request_for_tables(char *tables, uint length)
+static int handle_request_for_tables(char *tables, size_t length)
{
char *query, *end, options[100], message[100];
- uint query_length= 0;
+ size_t query_length= 0, query_size= sizeof(char)*(length+110);
const char *op = 0;
options[0] = 0;
return fix_table_storage_name(tables);
}
- if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME))))
+ if (!(query =(char *) my_malloc(query_size, MYF(MY_WME))))
+ {
return 1;
+ }
if (opt_all_in_1)
{
+ DBUG_ASSERT(strlen(op)+strlen(tables)+strlen(options)+8+1 <= query_size);
+
/* No backticks here as we added them before */
query_length= sprintf(query, "%s TABLE %s %s", op, tables, options);
}
ptr= strmov(strmov(query, op), " TABLE ");
ptr= fix_table_name(ptr, tables);
ptr= strxmov(ptr, " ", options, NullS);
- query_length= (uint) (ptr - query);
+ query_length= (size_t) (ptr - query);
}
if (mysql_real_query(sock, query, query_length))
{
prev_alter[0]= 0;
}
else
- strcpy(prev_alter, alter_txt);
+ {
+ strncpy(prev_alter, alter_txt, MAX_ALTER_STR_SIZE-1);
+ prev_alter[MAX_ALTER_STR_SIZE-1]= 0;
+ }
}
}
}
process_databases(argv);
if (opt_auto_repair)
{
- uint i;
+ size_t i;
if (!opt_silent && (tables4repair.elements || tables4rebuild.elements))
puts("\nRepairing tables");
static void add_load_option(DYNAMIC_STRING *str, const char *option,
const char *option_value);
-static ulong find_set(TYPELIB *lib, const char *x, uint length,
+static ulong find_set(TYPELIB *lib, const char *x, size_t length,
char **err_pos, uint *err_len);
static char *alloc_query_str(ulong size);
uchar* get_table_key(const char *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= strlen(entry);
return (uchar*) entry;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
opt_set_charset= 0;
opt_compatible_mode_str= argument;
opt_compatible_mode= find_set(&compatible_mode_typelib,
- argument, (uint) strlen(argument),
+ argument, strlen(argument),
&err_ptr, &err_len);
if (err_len)
{
}
#if !defined(DBUG_OFF)
{
- uint size_for_sql_mode= 0;
+ size_t size_for_sql_mode= 0;
const char **ptr;
for (ptr= compatible_mode_names; *ptr; ptr++)
size_for_sql_mode+= strlen(*ptr);
break;
}
- strncpy(db_cl_name, db_cl_row[0], db_cl_size);
- db_cl_name[db_cl_size - 1]= 0; /* just in case. */
+ strncpy(db_cl_name, db_cl_row[0], db_cl_size-1);
+ db_cl_name[db_cl_size - 1]= 0;
} while (FALSE);
static char *my_case_str(const char *str,
- uint str_len,
+ size_t str_len,
const char *token,
uint token_len)
{
*/
static char *cover_definer_clause(const char *stmt_str,
- uint stmt_length,
+ size_t stmt_length,
const char *definer_version_str,
uint definer_version_length,
const char *stmt_version_str,
} /* dbDisconnect */
-static void unescape(FILE *file,char *pos,uint length)
+static void unescape(FILE *file,char *pos, size_t length)
{
char *tmp;
DBUG_ENTER("unescape");
if (!(tmp=(char*) my_malloc(length*2+1, MYF(MY_WME))))
die(EX_MYSQLERR, "Couldn't allocate memory");
- mysql_real_escape_string(&mysql_connection, tmp, pos, length);
+ mysql_real_escape_string(&mysql_connection, tmp, pos, (ulong)length);
fputc('\'', file);
fputs(tmp, file);
fputc('\'', file);
Quote '<' '>' '&' '\"' chars and print a string to the xml_file.
*/
-static void print_quoted_xml(FILE *xml_file, const char *str, ulong len,
+static void print_quoted_xml(FILE *xml_file, const char *str, size_t len,
my_bool is_attribute_name)
{
const char *end;
const char *str_create)
{
uint i;
- my_bool body_found __attribute__((unused)) = 0;
+ my_bool body_found MY_ATTRIBUTE((unused)) = 0;
char *create_stmt_ptr= NULL;
ulong create_stmt_len= 0;
MYSQL_FIELD *field;
squeezed to a single hyphen.
*/
-static void print_xml_comment(FILE *xml_file, ulong len,
+static void print_xml_comment(FILE *xml_file, size_t len,
const char *comment_string)
{
const char* end;
DBUG_ENTER("dump_events_for_db");
DBUG_PRINT("enter", ("db: '%s'", db));
- mysql_real_escape_string(mysql, db_name_buff, db, strlen(db));
+ mysql_real_escape_string(mysql, db_name_buff, db, (ulong)strlen(db));
/* nice comments */
print_comment(sql_file, 0,
(const char *) (query_str != NULL ? query_str : row[3]),
(const char *) delimiter);
+ if(query_str)
+ {
+ my_free(query_str);
+ query_str= NULL;
+ }
restore_time_zone(sql_file, delimiter);
restore_sql_mode(sql_file, delimiter);
DBUG_ENTER("dump_routines_for_db");
DBUG_PRINT("enter", ("db: '%s'", db));
- mysql_real_escape_string(mysql, db_name_buff, db, strlen(db));
+ mysql_real_escape_string(mysql, db_name_buff, db, (ulong)strlen(db));
/* nice comments */
print_comment(sql_file, 0,
if the user has EXECUTE privilege he see routine names, but NOT the
routine body of other routines that are not the creator of!
*/
- DBUG_PRINT("info",("length of body for %s row[2] '%s' is %d",
+ DBUG_PRINT("info",("length of body for %s row[2] '%s' is %zu",
routine_name, row[2] ? row[2] : "(null)",
- row[2] ? (int) strlen(row[2]) : 0));
+ row[2] ? strlen(row[2]) : 0));
if (row[2] == NULL)
{
print_comment(sql_file, 1, "\n-- insufficient privileges to %s\n",
int i;
char name_buff[NAME_LEN*2+3];
- mysql_real_escape_string(mysql, name_buff, db, strlen(db));
+ mysql_real_escape_string(mysql, name_buff, db, (ulong)strlen(db));
init_dynamic_string_checked(&where, " AND TABLESPACE_NAME IN ("
"SELECT DISTINCT TABLESPACE_NAME FROM"
for (i=0 ; i<tables ; i++)
{
mysql_real_escape_string(mysql, name_buff,
- table_names[i], strlen(table_names[i]));
+ table_names[i], (ulong)strlen(table_names[i]));
dynstr_append_checked(&where, "'");
dynstr_append_checked(&where, name_buff);
{
char db_name_buff[NAME_LEN*2+3];
mysql_real_escape_string(mysql, db_name_buff,
- databases[i], strlen(databases[i]));
+ databases[i], (ulong)strlen(databases[i]));
dynstr_append_checked(&where, "'");
dynstr_append_checked(&where, db_name_buff);
dynstr_append_checked(&where, "',");
0 Success.
1 Failure.
*/
-int init_dumping_views(char *qdatabase __attribute__((unused)))
+int init_dumping_views(char *qdatabase MY_ATTRIBUTE((unused)))
{
return 0;
} /* init_dumping_views */
}
-static ulong find_set(TYPELIB *lib, const char *x, uint length,
+static ulong find_set(TYPELIB *lib, const char *x, size_t length,
char **err_pos, uint *err_len)
{
const char *end= x + length;
fputc(' ',file);
fputs(prefix, file);
if (string_value)
- unescape(file,row[0],(uint) strlen(row[0]));
+ unescape(file,row[0], strlen(row[0]));
else
fputs(row[0], file);
check_io(file);
verbose_msg("-- Retrieving view structure for table %s...\n", table);
#ifdef NOT_REALLY_USED_YET
- sprintf(insert_pat,"SET SQL_QUOTE_SHOW_CREATE=%d",
- (opt_quoted || opt_keywords));
+ dynstr_append_checked(&insert_pat, "SET SQL_QUOTE_SHOW_CREATE=");
+ dynstr_append_checked(&insert_pat, (opt_quoted || opt_keywords)? "1":"0");
#endif
result_table= quote_name(table, table_buff, 1);
if (flush_logs || opt_delete_master_logs)
{
if (mysql_refresh(mysql, REFRESH_LOG))
+ {
+ DB_error(mysql, "when doing refresh");
goto err;
+ }
verbose_msg("-- main : logs flushed successfully!\n");
}
/* Global Thread counter */
uint counter;
+pthread_mutex_t init_mutex;
pthread_mutex_t counter_mutex;
pthread_cond_t count_threshhold;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
MYSQL *mysql;
if (verbose)
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
- if (!(mysql= mysql_init(NULL)))
- return 0;
+ if (opt_use_threads && !lock_tables)
+ {
+ pthread_mutex_lock(&init_mutex);
+ if (!(mysql= mysql_init(NULL)))
+ {
+ pthread_mutex_unlock(&init_mutex);
+ return 0;
+ }
+ pthread_mutex_unlock(&init_mutex);
+ }
+ else
+ if (!(mysql= mysql_init(NULL)))
+ return 0;
if (opt_compress)
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
if (opt_local_file)
pthread_cond_signal(&count_threshhold);
pthread_mutex_unlock(&counter_mutex);
mysql_thread_end();
-
+ pthread_exit(0);
return 0;
}
if (opt_use_threads && !lock_tables)
{
- pthread_t mainthread; /* Thread descriptor */
- pthread_attr_t attr; /* Thread attributes */
+ char **save_argv;
+ uint worker_thread_count= 0, table_count= 0, i= 0;
+ pthread_t *worker_threads; /* Thread descriptor */
+ pthread_attr_t attr; /* Thread attributes */
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr,
- PTHREAD_CREATE_DETACHED);
+ PTHREAD_CREATE_JOINABLE);
+ pthread_mutex_init(&init_mutex, NULL);
pthread_mutex_init(&counter_mutex, NULL);
pthread_cond_init(&count_threshhold, NULL);
+ /* Count the number of tables. This number denotes the total number
+ of threads spawn.
+ */
+ save_argv= argv;
+ for (table_count= 0; *argv != NULL; argv++)
+ table_count++;
+ argv= save_argv;
+
+ if (!(worker_threads= (pthread_t*) my_malloc(table_count *
+ sizeof(*worker_threads),
+ MYF(0))))
+ return -2;
+
for (counter= 0; *argv != NULL; argv++) /* Loop through tables */
{
pthread_mutex_lock(&counter_mutex);
counter++;
pthread_mutex_unlock(&counter_mutex);
/* now create the thread */
- if (pthread_create(&mainthread, &attr, worker_thread,
- (void *)*argv) != 0)
+ if (pthread_create(&worker_threads[worker_thread_count], &attr,
+ worker_thread, (void *)*argv) != 0)
{
pthread_mutex_lock(&counter_mutex);
counter--;
pthread_mutex_unlock(&counter_mutex);
- fprintf(stderr,"%s: Could not create thread\n",
- my_progname);
+ fprintf(stderr,"%s: Could not create thread\n", my_progname);
+ continue;
}
+ worker_thread_count++;
}
/*
pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime);
}
pthread_mutex_unlock(&counter_mutex);
+ pthread_mutex_destroy(&init_mutex);
pthread_mutex_destroy(&counter_mutex);
pthread_cond_destroy(&count_threshhold);
pthread_attr_destroy(&attr);
+
+ for(i= 0; i < worker_thread_count; i++)
+ {
+ if (pthread_join(worker_threads[i], NULL))
+ fprintf(stderr,"%s: Could not join worker thread.\n", my_progname);
+ }
+
+ my_free(worker_threads);
}
else
{
static int list_table_status(MYSQL *mysql,const char *db,const char *table);
static int list_fields(MYSQL *mysql,const char *db,const char *table,
const char *field);
-static void print_header(const char *header,uint head_length,...);
-static void print_row(const char *header,uint head_length,...);
-static void print_trailer(uint length,...);
+static void print_header(const char *header,size_t head_length,...);
+static void print_row(const char *header,size_t head_length,...);
+static void print_trailer(size_t length,...);
static void print_res_header(MYSQL_RES *result);
static void print_res_top(MYSQL_RES *result);
static void print_res_row(MYSQL_RES *result,MYSQL_ROW cur);
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
list_dbs(MYSQL *mysql,const char *wild)
{
const char *header;
- uint length, counter = 0;
+ size_t length = 0;
+ uint counter = 0;
ulong rowcount = 0L;
char tables[NAME_LEN+1], rows[NAME_LEN+1];
char query[NAME_LEN + 100];
printf("Wildcard: %s\n",wild);
header="Databases";
- length=(uint) strlen(header);
+ length= strlen(header);
field=mysql_fetch_field(result);
if (length < field->max_length)
length=field->max_length;
list_tables(MYSQL *mysql,const char *db,const char *table)
{
const char *header;
- uint head_length, counter = 0;
+ size_t head_length;
+ uint counter = 0;
char query[NAME_LEN + 100], rows[NAME_LEN], fields[16];
MYSQL_FIELD *field;
MYSQL_RES *result;
putchar('\n');
header="Tables";
- head_length=(uint) strlen(header);
+ head_length= strlen(header);
field=mysql_fetch_field(result);
if (head_length < field->max_length)
head_length=field->max_length;
len= sizeof(query);
len-= my_snprintf(query, len, "show table status from `%s`", db);
if (wild && wild[0] && len)
- strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
+ strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{
fprintf(stderr,"%s: Cannot get status for db: %s, table: %s: %s\n",
const char *wild)
{
char query[NAME_LEN + 100];
- int len;
+ size_t len;
MYSQL_RES *result;
MYSQL_ROW row;
ulong UNINIT_VAR(rows);
len-= my_snprintf(query, len, "show /*!32332 FULL */ columns from `%s`",
table);
if (wild && wild[0] && len)
- strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
+ strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS);
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
{
fprintf(stderr,"%s: Cannot list columns in db: %s, table: %s: %s\n",
*****************************************************************************/
static void
-print_header(const char *header,uint head_length,...)
+print_header(const char *header,size_t head_length,...)
{
va_list args;
- uint length,i,str_length,pre_space;
+ size_t length,i,str_length,pre_space;
const char *field;
va_start(args,head_length);
putchar('|');
for (;;)
{
- str_length=(uint) strlen(field);
+ str_length= strlen(field);
if (str_length > length)
str_length=length+1;
- pre_space=(uint) (((int) length-(int) str_length)/2)+1;
+ pre_space= ((length- str_length)/2)+1;
for (i=0 ; i < pre_space ; i++)
putchar(' ');
for (i = 0 ; i < str_length ; i++)
static void
-print_row(const char *header,uint head_length,...)
+print_row(const char *header,size_t head_length,...)
{
va_list args;
const char *field;
- uint i,length,field_length;
+ size_t i,length,field_length;
va_start(args,head_length);
field=header; length=head_length;
putchar('|');
putchar(' ');
fputs(field,stdout);
- field_length=(uint) strlen(field);
+ field_length= strlen(field);
for (i=field_length ; i <= length ; i++)
putchar(' ');
if (!(field=va_arg(args,char *)))
static void
-print_trailer(uint head_length,...)
+print_trailer(size_t head_length,...)
{
va_list args;
- uint length,i;
+ size_t length,i;
va_start(args,head_length);
length=head_length;
mysql_field_seek(result,0);
while((field = mysql_fetch_field(result)))
{
- if ((length=(uint) strlen(field->name)) > field->max_length)
+ if ((length= strlen(field->name)) > field->max_length)
field->max_length=length;
else
length=field->max_length;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
DBUG_ENTER("get_one_option");
void replace_strings_append(struct st_replace *rep, DYNAMIC_STRING* ds,
const char *from, int len);
-static void cleanup_and_exit(int exit_code) __attribute__((noreturn));
+static void cleanup_and_exit(int exit_code) MY_ATTRIBUTE((noreturn));
void die(const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
+ ATTRIBUTE_FORMAT(printf, 1, 2) MY_ATTRIBUTE((noreturn));
void abort_not_supported_test(const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
+ ATTRIBUTE_FORMAT(printf, 1, 2) MY_ATTRIBUTE((noreturn));
void verbose_msg(const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 1, 2);
void log_msg(const char *fmt, ...)
C_MODE_START
static uchar *get_var_key(const uchar* var, size_t *len,
- my_bool __attribute__((unused)) t)
+ my_bool MY_ATTRIBUTE((unused)) t)
{
register char* key;
key = ((VAR*)var)->name;
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
do_eval(&ds_query, query, end, FALSE);
- if (mysql_real_query(mysql, ds_query.str, ds_query.length))
+ if (mysql_real_query(mysql, ds_query.str, ds_query.length) || !(res= mysql_store_result(mysql)))
{
handle_error (curr_command, mysql_errno(mysql), mysql_error(mysql),
mysql_sqlstate(mysql), &ds_res);
DBUG_VOID_RETURN;
}
- if (!(res= mysql_store_result(mysql)))
- die("Query '%s' didn't return a result set", ds_query.str);
dynstr_free(&ds_query);
if ((row= mysql_fetch_row(res)) && row[0])
}
-void do_wait_for_slave_to_stop(struct st_command *c __attribute__((unused)))
+void do_wait_for_slave_to_stop(struct st_command *c MY_ATTRIBUTE((unused)))
{
static int SLAVE_POLL_INTERVAL= 300000;
MYSQL* mysql = &cur_con->mysql;
*/
-void mark_progress(struct st_command* command __attribute__((unused)),
+void mark_progress(struct st_command* command MY_ATTRIBUTE((unused)),
int line)
{
static ulonglong progress_start= 0; // < Beware
void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
const char *str,
- int len __attribute__((unused)))
+ int len MY_ATTRIBUTE((unused)))
{
reg1 REPLACE *rep_pos;
reg2 REPLACE_STRING *rep_str;
-# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
SET(SUNPRO_CXX_LIBRARY "stlport4" CACHE STRING
"What C++ library to use. The server needs stlport4. It is possible to build the client libraries with -DWITHOUT_SERVER=1 -DSUNPRO_CXX_LIBRARY=Cstd")
- MESSAGE(STATUS "SUNPRO_CXX_LIBRARY ${SUNPRO_CXX_LIBRARY}")
-
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
SET(COMMON_C_FLAGS "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
- SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic -library=${SUNPRO_CXX_LIBRARY}")
+ SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
# We have to specify "-xO1" for DEBUG flags here,
# see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6879978
SET(CMAKE_C_FLAGS_DEBUG "-xO1 ${COMMON_C_FLAGS}")
ENDIF()
ELSE()
# Assume !x86 is SPARC
- SET(COMMON_C_FLAGS "-g -Xa -xstrconst -mt")
- SET(COMMON_CXX_FLAGS "-g0 -mt -library=${SUNPRO_CXX_LIBRARY}")
+ SET(COMMON_C_FLAGS "-g -xstrconst -mt")
+ SET(COMMON_CXX_FLAGS "-g0 -mt")
IF(32BIT)
SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -xarch=sparc")
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -xarch=sparc")
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# and relative links. Windows zip uses the same tarball layout but without
# the build prefix.
#
-# RPM
+# RPM, SLES
# Build as per default RPM layout, with prefix=/usr
# Note: The layout for ULN RPMs differs, see the "RPM" section.
#
# SVR4
# Solaris package layout suitable for pkg* tools, prefix=/opt/mysql/mysql
#
+# FREEBSD, GLIBC, OSX, TARGZ
+# Build with prefix=/usr/local/mysql, create tarball with install prefix="."
+# and relative links.
+#
+# WIN
+# Windows zip : same as tarball layout but without the build prefix
+#
# To force a directory layout, use -DINSTALL_LAYOUT=<layout>.
#
# The default is STANDALONE.
#
+# Note : At present, RPM and SLES layouts are similar. This is also true
+# for layouts like FREEBSD, GLIBC, OSX, TARGZ. However, they provide
+# opportunity to fine-tune deployment for each platform without
+# affecting all other types of deployment.
+#
# There is the possibility to further fine-tune installation directories.
# Several variables can be overwritten:
#
# - INSTALL_SUPPORTFILESDIR (various extra support files)
#
# - INSTALL_MYSQLDATADIR (data directory)
+# - INSTALL_SECURE_FILE_PRIVDIR (--secure-file-priv directory)
#
# When changing this page, _please_ do not forget to update public Wiki
# http://forge.mysql.com/wiki/CMake#Fine-tuning_installation_paths
ENDIF()
SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}"
-CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer), RPM, DEB, SVR4")
+CACHE STRING "Installation directory layout. Options are: TARGZ (as in tar.gz installer), WIN (as in zip installer), STANDALONE, RPM, DEB, SVR4, FREEBSD, GLIBC, OSX, SLES")
IF(UNIX)
- IF(INSTALL_LAYOUT MATCHES "RPM")
+ IF(INSTALL_LAYOUT MATCHES "RPM" OR
+ INSTALL_LAYOUT MATCHES "SLES")
SET(default_prefix "/usr")
ELSEIF(INSTALL_LAYOUT MATCHES "DEB")
SET(default_prefix "/opt/mysql/server-${MYSQL_BASE_VERSION}")
SET(CMAKE_INSTALL_PREFIX ${default_prefix}
CACHE PATH "install prefix" FORCE)
ENDIF()
- SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR4")
+ SET(VALID_INSTALL_LAYOUTS "RPM" "DEB" "SVR4" "FREEBSD" "GLIBC" "OSX" "TARGZ" "SLES" "STANDALONE")
LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
IF(ind EQUAL -1)
MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."
MARK_AS_ADVANCED(SYSCONFDIR)
ENDIF()
+IF(WIN32)
+ SET(VALID_INSTALL_LAYOUTS "TARGZ" "STANDALONE" "WIN")
+ LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
+ IF(ind EQUAL -1)
+ MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."
+ " Choose between ${VALID_INSTALL_LAYOUTS}" )
+ ENDIF()
+ENDIF()
+
#
# plugin_tests's value should not be used by imported plugins,
# just use if(INSTALL_PLUGINTESTDIR).
${CMAKE_SOURCE_DIR}/internal/plugin/*/tests
)
+#
+# DEFAULT_SECURE_FILE_PRIV_DIR/DEFAULT_SECURE_FILE_PRIV_EMBEDDED_DIR
+#
+IF(INSTALL_LAYOUT MATCHES "STANDALONE" OR
+ INSTALL_LAYOUT MATCHES "WIN")
+ SET(secure_file_priv_path "NULL")
+ELSEIF(INSTALL_LAYOUT MATCHES "RPM" OR
+ INSTALL_LAYOUT MATCHES "SLES" OR
+ INSTALL_LAYOUT MATCHES "SVR4" OR
+ INSTALL_LAYOUT MATCHES "DEB")
+ SET(secure_file_priv_path "/var/lib/mysql-files")
+ELSE()
+ SET(secure_file_priv_path "${default_prefix}/mysql-files")
+ENDIF()
+SET(secure_file_priv_embedded_path "NULL")
+
#
# STANDALONE layout
#
#
SET(INSTALL_MYSQLDATADIR_STANDALONE "data")
SET(INSTALL_PLUGINTESTDIR_STANDALONE ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_STANDALONE ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_STANDALONE ${secure_file_priv_embedded_path})
+
+#
+# WIN layout
+#
+SET(INSTALL_BINDIR_WIN "bin")
+SET(INSTALL_SBINDIR_WIN "bin")
+SET(INSTALL_SCRIPTDIR_WIN "scripts")
+#
+SET(INSTALL_LIBDIR_WIN "lib")
+SET(INSTALL_PLUGINDIR_WIN "lib/plugin")
+#
+SET(INSTALL_INCLUDEDIR_WIN "include")
+#
+SET(INSTALL_DOCDIR_WIN "docs")
+SET(INSTALL_DOCREADMEDIR_WIN ".")
+SET(INSTALL_MANDIR_WIN "man")
+SET(INSTALL_INFODIR_WIN "docs")
+#
+SET(INSTALL_SHAREDIR_WIN "share")
+SET(INSTALL_MYSQLSHAREDIR_WIN "share")
+SET(INSTALL_MYSQLTESTDIR_WIN "mysql-test")
+SET(INSTALL_SQLBENCHDIR_WIN ".")
+SET(INSTALL_SUPPORTFILESDIR_WIN "support-files")
+#
+SET(INSTALL_MYSQLDATADIR_WIN "data")
+SET(INSTALL_PLUGINTESTDIR_WIN ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_WIN ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_WIN ${secure_file_priv_embedded_path})
+
+#
+# FREEBSD layout
+#
+SET(INSTALL_BINDIR_FREEBSD "bin")
+SET(INSTALL_SBINDIR_FREEBSD "bin")
+SET(INSTALL_SCRIPTDIR_FREEBSD "scripts")
+#
+SET(INSTALL_LIBDIR_FREEBSD "lib")
+SET(INSTALL_PLUGINDIR_FREEBSD "lib/plugin")
+#
+SET(INSTALL_INCLUDEDIR_FREEBSD "include")
+#
+SET(INSTALL_DOCDIR_FREEBSD "docs")
+SET(INSTALL_DOCREADMEDIR_FREEBSD ".")
+SET(INSTALL_MANDIR_FREEBSD "man")
+SET(INSTALL_INFODIR_FREEBSD "docs")
+#
+SET(INSTALL_SHAREDIR_FREEBSD "share")
+SET(INSTALL_MYSQLSHAREDIR_FREEBSD "share")
+SET(INSTALL_MYSQLTESTDIR_FREEBSD "mysql-test")
+SET(INSTALL_SQLBENCHDIR_FREEBSD ".")
+SET(INSTALL_SUPPORTFILESDIR_FREEBSD "support-files")
+#
+SET(INSTALL_MYSQLDATADIR_FREEBSD "data")
+SET(INSTALL_PLUGINTESTDIR_FREEBSD ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_FREEBSD ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_FREEBSD ${secure_file_priv_embedded_path})
+
+#
+# GLIBC layout
+#
+SET(INSTALL_BINDIR_GLIBC "bin")
+SET(INSTALL_SBINDIR_GLIBC "bin")
+SET(INSTALL_SCRIPTDIR_GLIBC "scripts")
+#
+SET(INSTALL_LIBDIR_GLIBC "lib")
+SET(INSTALL_PLUGINDIR_GLIBC "lib/plugin")
+#
+SET(INSTALL_INCLUDEDIR_GLIBC "include")
+#
+SET(INSTALL_DOCDIR_GLIBC "docs")
+SET(INSTALL_DOCREADMEDIR_GLIBC ".")
+SET(INSTALL_MANDIR_GLIBC "man")
+SET(INSTALL_INFODIR_GLIBC "docs")
+#
+SET(INSTALL_SHAREDIR_GLIBC "share")
+SET(INSTALL_MYSQLSHAREDIR_GLIBC "share")
+SET(INSTALL_MYSQLTESTDIR_GLIBC "mysql-test")
+SET(INSTALL_SQLBENCHDIR_GLIBC ".")
+SET(INSTALL_SUPPORTFILESDIR_GLIBC "support-files")
+#
+SET(INSTALL_MYSQLDATADIR_GLIBC "data")
+SET(INSTALL_PLUGINTESTDIR_GLIBC ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_GLIBC ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_GLIBC ${secure_file_priv_embedded_path})
+
+#
+# OSX layout
+#
+SET(INSTALL_BINDIR_OSX "bin")
+SET(INSTALL_SBINDIR_OSX "bin")
+SET(INSTALL_SCRIPTDIR_OSX "scripts")
+#
+SET(INSTALL_LIBDIR_OSX "lib")
+SET(INSTALL_PLUGINDIR_OSX "lib/plugin")
+#
+SET(INSTALL_INCLUDEDIR_OSX "include")
+#
+SET(INSTALL_DOCDIR_OSX "docs")
+SET(INSTALL_DOCREADMEDIR_OSX ".")
+SET(INSTALL_MANDIR_OSX "man")
+SET(INSTALL_INFODIR_OSX "docs")
+#
+SET(INSTALL_SHAREDIR_OSX "share")
+SET(INSTALL_MYSQLSHAREDIR_OSX "share")
+SET(INSTALL_MYSQLTESTDIR_OSX "mysql-test")
+SET(INSTALL_SQLBENCHDIR_OSX ".")
+SET(INSTALL_SUPPORTFILESDIR_OSX "support-files")
+#
+SET(INSTALL_MYSQLDATADIR_OSX "data")
+SET(INSTALL_PLUGINTESTDIR_OSX ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_OSX ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_OSX ${secure_file_priv_embedded_path})
+
+#
+# TARGZ layout
+#
+SET(INSTALL_BINDIR_TARGZ "bin")
+SET(INSTALL_SBINDIR_TARGZ "bin")
+SET(INSTALL_SCRIPTDIR_TARGZ "scripts")
+#
+SET(INSTALL_LIBDIR_TARGZ "lib")
+SET(INSTALL_PLUGINDIR_TARGZ "lib/plugin")
+#
+SET(INSTALL_INCLUDEDIR_TARGZ "include")
+#
+SET(INSTALL_DOCDIR_TARGZ "docs")
+SET(INSTALL_DOCREADMEDIR_TARGZ ".")
+SET(INSTALL_MANDIR_TARGZ "man")
+SET(INSTALL_INFODIR_TARGZ "docs")
+#
+SET(INSTALL_SHAREDIR_TARGZ "share")
+SET(INSTALL_MYSQLSHAREDIR_TARGZ "share")
+SET(INSTALL_MYSQLTESTDIR_TARGZ "mysql-test")
+SET(INSTALL_SQLBENCHDIR_TARGZ ".")
+SET(INSTALL_SUPPORTFILESDIR_TARGZ "support-files")
+#
+SET(INSTALL_MYSQLDATADIR_TARGZ "data")
+SET(INSTALL_PLUGINTESTDIR_TARGZ ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_TARGZ ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_TARGZ ${secure_file_priv_embedded_path})
#
# RPM layout
#
SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
SET(INSTALL_PLUGINTESTDIR_RPM ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_RPM ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_RPM ${secure_file_priv_embedded_path})
+
+#
+# SLES layout
+#
+SET(INSTALL_BINDIR_SLES "bin")
+SET(INSTALL_SBINDIR_SLES "sbin")
+SET(INSTALL_SCRIPTDIR_SLES "bin")
+#
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
+ SET(INSTALL_LIBDIR_SLES "lib64")
+ SET(INSTALL_PLUGINDIR_SLES "lib64/mysql/plugin")
+ELSE()
+ SET(INSTALL_LIBDIR_SLES "lib")
+ SET(INSTALL_PLUGINDIR_SLES "lib/mysql/plugin")
+ENDIF()
+#
+SET(INSTALL_INCLUDEDIR_SLES "include/mysql")
+#
+#SET(INSTALL_DOCDIR_SLES unset - installed directly by SLES)
+#SET(INSTALL_DOCREADMEDIR_SLES unset - installed directly by SLES)
+SET(INSTALL_INFODIR_SLES "share/info")
+SET(INSTALL_MANDIR_SLES "share/man")
+#
+SET(INSTALL_SHAREDIR_SLES "share")
+SET(INSTALL_MYSQLSHAREDIR_SLES "share/mysql")
+SET(INSTALL_MYSQLTESTDIR_SLES "share/mysql-test")
+SET(INSTALL_SQLBENCHDIR_SLES "")
+SET(INSTALL_SUPPORTFILESDIR_SLES "share/mysql")
+#
+SET(INSTALL_MYSQLDATADIR_SLES "/var/lib/mysql")
+SET(INSTALL_PLUGINTESTDIR_SLES ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_SLES ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_SLES ${secure_file_priv_embedded_path})
#
# DEB layout
#
SET(INSTALL_MYSQLDATADIR_DEB "data")
SET(INSTALL_PLUGINTESTDIR_DEB ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_DEB ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_DEB ${secure_file_priv_embedded_path})
#
# SVR4 layout
#
SET(INSTALL_MYSQLDATADIR_SVR4 "/var/lib/mysql")
SET(INSTALL_PLUGINTESTDIR_SVR4 ${plugin_tests})
+SET(INSTALL_SECURE_FILE_PRIVDIR_SVR4 ${secure_file_priv_path})
+SET(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR_SVR4 ${secure_file_priv_embedded_path})
# Clear cached variables if install layout was changed
# will be defined as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE
# layout is chosen)
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN
- INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA PLUGINTEST)
+ INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA PLUGINTEST
+ SECURE_FILE_PRIV SECURE_FILE_PRIV_EMBEDDED)
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
CACHE STRING "${var} installation directory" ${FORCE})
MARK_AS_ADVANCED(INSTALL_${var}DIR)
ENDFOREACH()
+
+#
+# Set DEFAULT_SECURE_FILE_PRIV_DIR
+# This is used as default value for --secure-file-priv
+#
+IF(INSTALL_SECURE_FILE_PRIVDIR)
+ SET(DEFAULT_SECURE_FILE_PRIV_DIR "\"${INSTALL_SECURE_FILE_PRIVDIR}\""
+ CACHE INTERNAL "default --secure-file-priv directory" FORCE)
+ELSE()
+ SET(DEFAULT_SECURE_FILE_PRIV_DIR \"\"
+ CACHE INTERNAL "default --secure-file-priv directory" FORCE)
+ENDIF()
+
+IF(INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR)
+ SET(DEFAULT_SECURE_FILE_PRIV_EMBEDDED_DIR "\"${INSTALL_SECURE_FILE_PRIV_EMBEDDEDDIR}\""
+ CACHE INTERNAL "default --secure-file-priv directory (for embedded library)" FORCE)
+ELSE()
+ SET(DEFAULT_SECURE_FILE_PRIV_EMBEDDED_DIR "NULL"
+ CACHE INTERNAL "default --secure-file-priv directory (for embedded library)" FORCE)
+ENDIF()
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
INCLUDE(CheckCSourceRuns)
INCLUDE(CheckCSourceCompiles)
+# We require SunStudio 12u2 (CC 5.11)
+IF(NOT FORCE_UNSUPPORTED_COMPILER)
+ IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
+ # CC -V yields
+ # CC: Studio 12.5 Sun C++ 5.14 SunOS_sparc Dodona 2016/04/04
+ # CC: Sun C++ 5.13 SunOS_sparc Beta 2014/03/11
+ # CC: Sun C++ 5.11 SunOS_sparc 2010/08/13
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_CXX_COMPILER} "-V"
+ OUTPUT_VARIABLE stdout
+ ERROR_VARIABLE stderr
+ RESULT_VARIABLE result
+ )
+ STRING(REGEX MATCH "CC: Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr})
+ IF (NOT CMAKE_MATCH_1 OR CMAKE_MATCH_1 STREQUAL "")
+ STRING(REGEX MATCH "CC: Studio 12\\.5 Sun C\\+\\+ 5\\.([0-9]+)"
+ VERSION_STRING ${stderr})
+ ENDIF()
+ SET(CC_MINOR_VERSION ${CMAKE_MATCH_1})
+ IF(${CC_MINOR_VERSION} LESS 11)
+ MESSAGE(FATAL_ERROR "SunStudio 12u2 or newer is required!")
+ ENDIF()
+ ELSE()
+ MESSAGE(FATAL_ERROR "Unsupported compiler!")
+ ENDIF()
+ENDIF()
+
# Enable 64 bit file offsets
SET(_FILE_OFFSET_BITS 64)
# CMake defined -lthread as thread flag. This crashes in dlopen
# when trying to load plugins workaround with -lpthread
-SET(CMAKE_THREADS_LIBS_INIT -lpthread CACHE INTERNAL "" FORCE)
+SET(CMAKE_THREAD_LIBS_INIT -lpthread CACHE INTERNAL "" FORCE)
# Solaris specific large page support
CHECK_SYMBOL_EXISTS(MHA_MAPSIZE_VA sys/mman.h HAVE_DECL_MHA_MAPSIZE_VA)
SET(HAVE_BMOVE CACHE INTERNAL "")
SET(HAVE_BSD_SIGNALS CACHE INTERNAL "")
SET(HAVE_BSEARCH 1 CACHE INTERNAL "")
-SET(HAVE_BSS_START CACHE INTERNAL "")
SET(HAVE_CHOWN CACHE INTERNAL "")
SET(HAVE_CLOCK_GETTIME CACHE INTERNAL "")
SET(HAVE_COMPRESS CACHE INTERNAL "")
SET(HAVE_CXXABI_H CACHE INTERNAL "")
SET(HAVE_DECL_MADVISE CACHE INTERNAL "")
SET(HAVE_DIRECTIO CACHE INTERNAL "")
-SET(HAVE_DIRENT_H CACHE INTERNAL "")
SET(HAVE_DLERROR CACHE INTERNAL "")
SET(HAVE_DLFCN_H CACHE INTERNAL "")
SET(HAVE_DLOPEN CACHE INTERNAL "")
SET(HAVE_PUTENV 1 CACHE INTERNAL "")
SET(HAVE_PWD_H CACHE INTERNAL "")
SET(HAVE_RDTSCLL CACHE INTERNAL "")
-SET(HAVE_READDIR_R CACHE INTERNAL "")
SET(HAVE_READLINK CACHE INTERNAL "")
SET(HAVE_READ_REAL_TIME CACHE INTERNAL "")
SET(HAVE_REALPATH CACHE INTERNAL "")
# so WSREP_VERSION is produced regardless
# Set the patch version
-SET(WSREP_PATCH_VERSION "15")
+SET(WSREP_PATCH_VERSION "19")
# Obtain patch revision number
SET(WSREP_REVISION $ENV{WSREP_REV})
#cmakedefine HAVE_CXXABI_H 1
#cmakedefine HAVE_NCURSES_H 1
#cmakedefine HAVE_NDIR_H 1
-#cmakedefine HAVE_DIRENT_H 1
#cmakedefine HAVE_DLFCN_H 1
#cmakedefine HAVE_EXECINFO_H 1
#cmakedefine HAVE_FCNTL_H 1
#cmakedefine HAVE_PUTENV 1
#cmakedefine HAVE_RE_COMP 1
#cmakedefine HAVE_REGCOMP 1
-#cmakedefine HAVE_READDIR_R 1
#cmakedefine HAVE_READLINK 1
#cmakedefine HAVE_REALPATH 1
#cmakedefine HAVE_RENAME 1
#cmakedefine HAVE_AIO_READ 1
/* Symbols we may use */
/* used by stacktrace functions */
-#cmakedefine HAVE_BSS_START 1
#cmakedefine HAVE_BACKTRACE 1
#cmakedefine HAVE_BACKTRACE_SYMBOLS 1
#cmakedefine HAVE_BACKTRACE_SYMBOLS_FD 1
#cmakedefine CPU_LEVEL1_DCACHE_LINESIZE @CPU_LEVEL1_DCACHE_LINESIZE@
#cmakedefine HAVE_LIBNUMA 1
+/* For --secure-file-priv */
+#cmakedefine DEFAULT_SECURE_FILE_PRIV_DIR @DEFAULT_SECURE_FILE_PRIV_DIR@
+#cmakedefine DEFAULT_SECURE_FILE_PRIV_EMBEDDED_DIR @DEFAULT_SECURE_FILE_PRIV_EMBEDDED_DIR@
+
#endif
# The default C++ library for SunPro is really old, and not standards compliant.
# http://www.oracle.com/technetwork/server-storage/solaris10/cmp-stlport-libcstd-142559.html
-# Use stlport rather than Rogue Wave.
+# Use stlport rather than Rogue Wave,
+# unless otherwise specified on command line.
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
- IF(SUNPRO_CXX_LIBRARY)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=${SUNPRO_CXX_LIBRARY}")
- IF(SUNPRO_CXX_LIBRARY STREQUAL "stdcxx4")
- ADD_DEFINITIONS(-D__MATHERR_RENAME_EXCEPTION)
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -template=extdef")
- ENDIF()
+ IF(CMAKE_CXX_FLAGS MATCHES "-std=")
+ ADD_DEFINITIONS(-D__MATHERR_RENAME_EXCEPTION)
+ SET(CMAKE_SHARED_LIBRARY_C_FLAGS
+ "${CMAKE_SHARED_LIBRARY_C_FLAGS} -lc")
+ SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS
+ "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -lstdc++ -lgcc_s -lCrunG3 -lc")
+ SET(QUOTED_CMAKE_CXX_LINK_FLAGS "-lstdc++ -lgcc_s -lCrunG3 -lc")
ELSE()
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
+ IF(SUNPRO_CXX_LIBRARY)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=${SUNPRO_CXX_LIBRARY}")
+ IF(SUNPRO_CXX_LIBRARY STREQUAL "stdcxx4")
+ ADD_DEFINITIONS(-D__MATHERR_RENAME_EXCEPTION)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -template=extdef")
+ ENDIF()
+ ELSE()
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
+ ENDIF()
ENDIF()
ENDIF()
ENDIF()
GET_FILENAME_COMPONENT(CXX_REALPATH ${CMAKE_CXX_COMPILER} REALPATH)
# CC -V yields
+ # CC: Studio 12.5 Sun C++ 5.14 SunOS_sparc Dodona 2016/04/04
# CC: Sun C++ 5.13 SunOS_sparc Beta 2014/03/11
# CC: Sun C++ 5.11 SunOS_sparc 2010/08/13
ENDIF()
STRING(REGEX MATCH "CC: Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr})
+ IF (NOT CMAKE_MATCH_1 OR CMAKE_MATCH_1 STREQUAL "")
+ STRING(REGEX MATCH "CC: Studio 12\\.5 Sun C\\+\\+ 5\\.([0-9]+)"
+ VERSION_STRING ${stderr})
+ ENDIF()
SET(CC_MINOR_VERSION ${CMAKE_MATCH_1})
- IF(${CC_MINOR_VERSION} EQUAL 13)
+ IF(${CC_MINOR_VERSION} GREATER 12)
SET(STLPORT_SUFFIX "lib/compilers/stlport4")
IF(SIZEOF_VOIDP EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
SET(STLPORT_SUFFIX "lib/compilers/stlport4/sparcv9")
IF(NOT LIBRT)
MY_SEARCH_LIBS(clock_gettime rt LIBRT)
ENDIF()
+ MY_SEARCH_LIBS(backtrace execinfo LIBEXECINFO)
+
FIND_PACKAGE(Threads)
SET(CMAKE_REQUIRED_LIBRARIES
- ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})
+ ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL}
+ ${CMAKE_THREAD_LIBS_INIT} ${LIBRT} ${LIBEXECINFO}
+ )
# Need explicit pthread for gcc -fsanitize=address
IF(CMAKE_USE_PTHREADS_INIT AND CMAKE_C_FLAGS MATCHES "-fsanitize=")
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} pthread)
CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H)
CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H)
CHECK_INCLUDE_FILES (cxxabi.h HAVE_CXXABI_H)
-CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H)
CHECK_INCLUDE_FILES (fcntl.h HAVE_FCNTL_H)
CHECK_FUNCTION_EXISTS (pthread_threadmask HAVE_PTHREAD_THREADMASK)
CHECK_FUNCTION_EXISTS (pthread_yield_np HAVE_PTHREAD_YIELD_NP)
CHECK_FUNCTION_EXISTS (putenv HAVE_PUTENV)
-CHECK_FUNCTION_EXISTS (readdir_r HAVE_READDIR_R)
CHECK_FUNCTION_EXISTS (readlink HAVE_READLINK)
CHECK_FUNCTION_EXISTS (re_comp HAVE_RE_COMP)
CHECK_FUNCTION_EXISTS (regcomp HAVE_REGCOMP)
HAVE_ABI_CXA_DEMANGLE)
ENDIF()
-CHECK_C_SOURCE_COMPILES("
- int main(int argc, char **argv)
- {
- extern char *__bss_start;
- return __bss_start ? 1 : 0;
- }"
-HAVE_BSS_START)
-
CHECK_C_SOURCE_COMPILES("
int main()
{
DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF"));
DBUG_EXECUTE_IF("pop", DBUG_POP(); );
{
- char s[1000] __attribute__((unused));
+ char s[1000] MY_ATTRIBUTE((unused));
DBUG_EXPLAIN(s, sizeof(s)-1);
DBUG_PRINT("explain", ("dbug explained: %s", s));
}
--- /dev/null
+
+###########################
+## FIXME for 5.1 ##
+###########################
+
+* put this trigger-recreation thing into the init scripts -- what?!
+
+###########################################################################
+# Here are some information that are only of interest for the current and #
+# following Debian maintainers of MySQL. #
+###########################################################################
+
+The debian/ directory is under SVN control, see debian/control for URL.
+
+#
+# Preparing a new version
+#
+The new orig.tar.gz (without non-free documentation) is created in /tmp/ when
+running this command:
+
+debian/rules get-orig-source
+
+#
+# mysqlreport
+#
+The authors e-mail address is <public@codenode.com>.
+
+#
+# Remarks to dependencies
+#
+libwrap0-dev (>= 7.6-8.3)
+ According to bug report 114582 where where build problems on
+ IA-64/sid with at least two prior versions.
+psmisc
+ /usr/bin/killall in the initscript
+
+zlib1g in libmysqlclient-dev:
+ "mysql_config --libs" ads "-lz"
+
+Build-Dep:
+
+debhelper (>=4.1.16):
+ See po-debconf(7).
+
+autoconf (>= 2.13-20), automake1.7
+ Try to get rid of them.
+
+doxygen, tetex-bin, tetex-extra, gs
+ for ndb/docs/*tex
+
+#
+# Remarks to the start scripts
+#
+
+## initscripts rely on mysqladmin from a different package
+We have the problem that "/etc/init.d/mysql stop" relies on mysqladmin which
+is in another package (mysql-client) and a passwordless access that's maybe
+only available if the user configured his /root/.my.cnf. Can this be a problem?
+* normal mode: not because the user is required to have it. Else:
+* purge/remove: not, same as normal mode
+* upgrade: not, same as normal mode
+* first install: not, it depends on mysql-client which at least is unpacked
+ so mysqladmin is there (to ping). It is not yet configured
+ passwordles but if there's a server running then there's a
+ /root/.my.cnf. Anyways, we simply kill anything that's mysqld.
+
+## Passwordless access for the maintainer scripts
+Another issue is that the scripts needs passwordless access. To ensure this
+a debian-sys-maint user is configured which has process and shutdown privs.
+The file with the randomly (that's important!) generated password must be
+present as long as the databases remain installed because else a new install
+would have no access. This file should be used like:
+ mysqladmin --defaults-file=/etc/mysql/debian.cnf restart
+to avoid providing the password in plaintext on a commandline where it would
+be visible to any user via the "ps" command.
+
+## When to start the daemon?
+We aim to give the admin full control on when MySQL is running.
+Issues to be faced here:
+OLD:
+ 1. Debconf asks whether MySQL should be started on boot so update-rc.d is
+ only run if the answer has been yes. The admin is likely to forget
+ this decision but update-rc.d checks for an existing line in
+ /etc/runlevel.conf and leaves it intact.
+ 2. On initial install, if the answer is yes, the daemon has to be started.
+ 3. On upgrades it should only be started if it was already running, everything
+ else is confusing. Especiall relying on an debconf decision made month ago
+ is considered suboptimal. See bug #274264
+ Implementation so far:
+ prerm (called on upgrade before stopping the server):
+ check for a running server and set flag if necessary
+ preinst (called on initial install and before unpacking when upgrading):
+ check for the debconf variable and set flag if necessary
+ postinst (called on initial install and after each upgrade after unpacking):
+ call update-rc.d if debconf says yes
+ call invoce-rc.d if the flag has been set
+ Problems remaining:
+ dpkg-reconfigure and setting mysql start on boot to yes did not start mysql
+ (ok "start on boot" literally does not mean "start now" so that might have been ok)
+NEW:
+ 1. --- no debconf anymore for the sake of simplicity. We have runlevel.conf,
+ the admin should use it
+ 2. On initial install the server is started.
+ 3. On upgrades the server is started exactly if it was running before so the
+ runlevel configuration is irrelevant. It will be preserved by the mean of
+ update-rc.d's builtin check.
+ Implementation:
+ prerm (called on upgrade before stopping the server):
+ check for a running server and set flag if necessary
+ preinst (called on initial install and before unpacking when upgrading):
+ check for $1 beeing (initial) "install" and set flag
+ postinst (called on initial install and after each upgrade after unpacking):
+ call update-rc.d
+ call invoce-rc.d if the flag has been set
--- /dev/null
+all:
+
+distclean:
+ -rm -f Makefile
+
+.PHONY: all distclean clean install check
--- /dev/null
+all:
+
+distclean:
+ -rm -f Makefile
+
+.PHONY: all distclean clean install check
--- /dev/null
+#!/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
--- /dev/null
+#!/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
+}
--- /dev/null
+-- 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;
+
--- /dev/null
+#!/bin/bash
+echo "$*" 1>&2
--- /dev/null
+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.
--- /dev/null
+#!/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
--- /dev/null
+.\" 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.
--- /dev/null
+#
+# The MySQL database server configuration file.
+#
+# You can copy this to one of:
+# - "/etc/mysql/my.cnf" to set global options,
+# - "~/.my.cnf" to set user-specific options.
+#
+# One can use all long options that the program supports.
+# Run program with --help to get a list of available options and with
+# --print-defaults to see which it would actually understand and use.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# This will be passed to all mysql clients
+# It has been reported that passwords should be enclosed with ticks/quotes
+# escpecially if they contain "#" chars...
+# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
+[client]
+port = 3306
+socket = /var/run/mysqld/mysqld.sock
+
+# Here is entries for some specific programs
+# The following values assume you have at least 32M ram
+
+# This was formally known as [safe_mysqld]. Both versions are currently parsed.
+[mysqld_safe]
+socket = /var/run/mysqld/mysqld.sock
+nice = 0
+
+[mysqld]
+#
+# * Basic Settings
+#
+user = mysql
+pid-file = /var/run/mysqld/mysqld.pid
+socket = /var/run/mysqld/mysqld.sock
+port = 3306
+basedir = /usr
+datadir = /var/lib/mysql
+tmpdir = /tmp
+lc-messages-dir = /usr/share/mysql
+skip-external-locking
+#
+# Instead of skip-networking the default is now to listen only on
+# localhost which is more compatible and is not less secure.
+bind-address = 127.0.0.1
+#
+# * Fine Tuning
+#
+key_buffer = 16M
+max_allowed_packet = 16M
+thread_stack = 192K
+thread_cache_size = 8
+# This replaces the startup script and checks MyISAM tables if needed
+# the first time they are touched
+myisam-recover = BACKUP
+#max_connections = 100
+#table_cache = 64
+#thread_concurrency = 10
+#
+# * Query Cache Configuration
+#
+query_cache_limit = 1M
+query_cache_size = 16M
+#
+# * Logging and Replication
+#
+# Both location gets rotated by the cronjob.
+# Be aware that this log type is a performance killer.
+# As of 5.1 you can enable the log at runtime!
+#general_log_file = /var/log/mysql/mysql.log
+#general_log = 1
+#
+# Error log - should be very few entries.
+#
+log_error = /var/log/mysql/error.log
+#
+# Here you can see queries with especially long duration
+#log_slow_queries = /var/log/mysql/mysql-slow.log
+#long_query_time = 2
+#log-queries-not-using-indexes
+#
+# The following can be used as easy to replay backup logs or for replication.
+# note: if you are setting up a replication slave, see README.Debian about
+# other settings you may need to change.
+#server-id = 1
+#log_bin = /var/log/mysql/mysql-bin.log
+expire_logs_days = 10
+max_binlog_size = 100M
+#binlog_do_db = include_database_name
+#binlog_ignore_db = include_database_name
+#
+# * InnoDB
+#
+# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
+# Read the manual for more InnoDB related options. There are many!
+#
+# * Security Features
+#
+# Read the manual, too, if you want chroot!
+# chroot = /var/lib/mysql/
+#
+# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
+#
+# ssl-ca=/etc/mysql/cacert.pem
+# ssl-cert=/etc/mysql/server-cert.pem
+# ssl-key=/etc/mysql/server-key.pem
+
+
+
+[mysqldump]
+quick
+quote-names
+max_allowed_packet = 16M
+
+[mysql]
+#no-auto-rehash # faster start of mysql but no tab completition
+
+[isamchk]
+key_buffer = 16M
+
+#
+# * IMPORTANT: Additional settings that can override those from this file!
+# The files must end with '.cnf', otherwise they'll be ignored.
+#
+!includedir /etc/mysql/conf.d/
--- /dev/null
+#
+# The MySQL 5.6 database server configuration file.
+#
+# This custom MySQL 5.6 specific configuration file
+# adds on top of the existing default my.cnf file at
+# - /etc/mysql/my.cnf.
+#
+# Please add any extra MySQL 5.6 options in this file
+# for sake of clarity.
+#
+# You may uncomment any existing option to enable it
+#
+# sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
--- /dev/null
+W: mysql-dfsg source: maintainer-script-lacks-debhelper-token debian/mysql-server.postinst
+W: mysql-server: possible-bashism-in-maintainer-script postinst:68 'p{("a".."z","A".."Z",0..9)[int(rand(62))]}'
--- /dev/null
+.so man1/mysql_config.1
--- /dev/null
+.so man1/mysql.1
--- /dev/null
+[mysqld_safe]
+syslog
--- /dev/null
+#!/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'})
+.
--- /dev/null
+.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.
+
--- /dev/null
+# This file is intensionally empty to disable apparmor by default
--- /dev/null
+mysql-wsrep-5.6 (5.6.30-25.15-1) UNRELEASED; urgency=low
+
+ * Bump version numbers
+
+ -- Otto Kekäläinen <otto@seravo.fi> Wed, 22 Jun 2016 11:58:20 +0300
--- /dev/null
+debian/libmysqlclient18.links
+debian/libmysqlclient-dev.links
--- /dev/null
+Source: mysql-wsrep-5.6
+Section: database
+Priority: optional
+Maintainer: Codership Oy <info@codership.com>
+Build-Depends: bison,
+ chrpath,
+ cmake,
+ debhelper (>= 8.1.3~),
+ dh-apparmor,
+ dpkg-dev (>= 1.16.1~),
+ libaio-dev[linux-any],
+ libedit-dev,
+ libncurses5-dev (>= 5.0-6),
+ libwrap0-dev (>= 7.6-8.3),
+ lsb-release,
+ perl,
+ po-debconf,
+ psmisc,
+ zlib1g-dev (>= 1:1.1.3-5),
+ libssl-dev
+Standards-Version: 3.9.3
+Homepage: http://galeracluster.com/
+Vcs-Git: https://github.com/codership/mysql-wsrep.git
+Vcs-Browser: https://github.com/codership/mysql-wsrep
+
+Package: mysql-wsrep-libmysqlclient18
+Section: libs
+Architecture: any
+Depends: mysql-wsrep-common-5.6, ${misc:Depends}, ${shlibs:Depends}
+Pre-Depends: multiarch-support, ${misc:Pre-Depends}
+Replaces: libmysqlclient18
+Provides: libmysqlclient18
+Multi-Arch: same
+Description: MySQL database client library
+ MySQL is a fast, stable and true multi-user, multi-threaded SQL database
+ server. SQL (Structured Query Language) is the most popular database query
+ language in the world. The main goals of MySQL are speed, robustness and
+ ease of use.
+ .
+ This package includes the client library.
+
+Package: mysql-wsrep-libmysqlclient-dev
+Architecture: any
+Section: libdevel
+Depends: mysql-wsrep-libmysqlclient18 (= ${binary:Version}),
+ zlib1g-dev,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Description: MySQL database development files
+ MySQL is a fast, stable and true multi-user, multi-threaded SQL database
+ server. SQL (Structured Query Language) is the most popular database query
+ language in the world. The main goals of MySQL are speed, robustness and
+ ease of use.
+ .
+ This package includes development libraries and header files.
+
+Package: mysql-wsrep-common-5.6
+Architecture: all
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Multi-Arch: foreign
+Provides: mysql-common, mysql-common-5.6
+Replaces: mysql-common, mysql-common-5.6
+Description: MySQL 5.6 specific common files, e.g. /etc/mysql/conf.d/my-5.6.cnf
+ MySQL is a fast, stable and true multi-user, multi-threaded SQL database
+ server. SQL (Structured Query Language) is the most popular database query
+ language in the world. The main goals of MySQL are speed, robustness and
+ ease of use.
+ .
+ This package also includes files needed by all versions of the client library,
+ e.g. /etc/mysql/my.cnf.
+
+Package: mysql-wsrep-client-5.6
+Architecture: any
+Depends: debianutils (>=1.6),
+ mysql-wsrep-common-5.6,
+ mysql-wsrep-libmysqlclient18,
+ ${misc:Depends},
+ ${perl:Depends},
+ ${shlibs:Depends}
+Provides: virtual-mysql-client
+Breaks: mysql-client-5.5,
+ mysql-client-5.6,
+ mysql-client-core-5.5,
+ mysql-client-core-5.6,
+ virtual-mysql-client
+Replaces: mysql-client-5.5,
+ mysql-client-5.6,
+ mysql-client-core-5.5,
+ mysql-client-core-5.6,
+ virtual-mysql-client
+Recommends: libdbd-mysql-perl (>= 1.2202),
+ libdbi-perl,
+ libterm-readkey-perl
+Description: MySQL database client binaries
+ MySQL is a fast, stable and true multi-user, multi-threaded SQL database
+ server. SQL (Structured Query Language) is the most popular database query
+ language in the world. The main goals of MySQL are speed, robustness and
+ ease of use.
+ .
+ This package includes the client binaries and the additional tools
+ innotop and mysqlreport.
+
+Package: mysql-wsrep-server-5.6
+Architecture: any
+Recommends: libhtml-template-perl
+Suggests: mailx, tinyca
+Pre-Depends: adduser (>= 3.40), debconf, mysql-wsrep-common-5.6
+Depends: initscripts,
+ libdbi-perl,
+ lsb-base (>= 3.0-10),
+ lsof,
+ mysql-wsrep-client-5.6 (>= ${binary:Version}),
+ passwd,
+ perl (>= 5.6),
+ psmisc,
+ rsync,
+ socat,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Provides: virtual-mysql-server
+Breaks: mysql-server-5.5,
+ mysql-server-5.6,
+ mysql-server-core-5.5,
+ mysql-server-core-5.6,
+ virtual-mysql-server
+Replaces: mysql-server-5.5, mysql-server-5.6, virtual-mysql-server
+Description: MySQL database wsrep server binaries and system database setup
+ MySQL is a fast, stable and true multi-user, multi-threaded SQL database
+ server. SQL (Structured Query Language) is the most popular database query
+ language in the world. The main goals of MySQL are speed, robustness and
+ ease of use.
+ .
+ This package contains all the infrastructure needed to setup system
+ databases.
+
+Package: mysql-wsrep-testsuite-5.6
+Architecture: any
+Depends: mysql-wsrep-client-5.6 (= ${binary:Version}),
+ mysql-wsrep-server-5.6 (= ${binary:Version}),
+ python,
+ ${misc:Depends},
+ ${shlibs:Depends}
+Provides: virtual-mysql-testsuite
+Breaks: mysql-testsuite-5.5, mysql-testsuite-5.6, virtual-mysql-testsuite
+Replaces: mysql-testsuite-5.5, mysql-testsuite-5.6, virtual-mysql-testsuite
+Description: MySQL 5.6 testsuite
+ MySQL is a fast, stable, and true multi-user, multi-threaded SQL database
+ server. SQL (Structured Query Language) is the most popular database query
+ language in the world. The main goals of MySQL are speed, robustness and
+ ease of use.
+ .
+ This package includes the MySQL testsuite.
+
+Package: mysql-wsrep-5.6
+Architecture: any
+Depends: mysql-wsrep-client-5.6 (= ${binary:Version}),
+ mysql-wsrep-server-5.6 (= ${binary:Version}),
+ ${misc:Depends}
+Description: Metapackage that installs mysql-wsrep client and server packages.
--- /dev/null
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: MySQL 5.6
+Upstream-Contact: http://bugs.mysql.com/
+Source: http://dev.mysql.com/downloads/mysql/5.6.html
+Comments:
+ The file Docs/mysql.info is removed from the upstream source
+ because it is incompatible with the Debian Free Software Guidelines.
+ See debian/README.source for how this repacking was done.
+ .
+ Originally produced by a modified version of licensecheck2dep5
+ from CDBS by Clint Byrum <clint@ubuntu.com>. Hand modified to reduce
+ redundancy in the output and add appropriate license text.
+ .
+ Also, MySQL carries the "FOSS License Exception" specified in README
+ .
+ Quoting from README:
+ .
+ MySQL FOSS License Exception We want free and open source
+ software applications under certain licenses to be able to use
+ specified GPL-licensed MySQL client libraries despite the fact
+ that not all such FOSS licenses are compatible with version
+ 2 of the GNU General Public License. Therefore there are
+ special exceptions to the terms and conditions of the GPLv2
+ as applied to these client libraries, which are identified
+ and described in more detail in the FOSS License Exception at
+ <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
+ .
+ The text of the Above URL is quoted below, as of Aug 17, 2011.
+ .
+ > FOSS License Exception
+ > .
+ > Updated July 1, 2010
+ > .
+ > What is the FOSS License Exception? Oracle's Free and Open Source
+ > Software ("FOSS") License Exception (formerly known as the FLOSS
+ > License Exception) allows developers of FOSS applications to include
+ > Oracle's MySQL Client Libraries (also referred to as "MySQL Drivers"
+ > or "MySQL Connectors") with their FOSS applications. MySQL Client
+ > Libraries are typically licensed pursuant to version 2 of the General
+ > Public License ("GPL"), but this exception permits distribution of
+ > certain MySQL Client Libraries with a developer's FOSS applications
+ > licensed under the terms of another FOSS license listed below,
+ > even though such other FOSS license may be incompatible with the GPL.
+ > .
+ > The following terms and conditions describe the circumstances under
+ > which Oracle's FOSS License Exception applies.
+ > .
+ > Oracle's FOSS License Exception Terms and Conditions Definitions.
+ > "Derivative Work" means a derivative work, as defined under applicable
+ > copyright law, formed entirely from the Program and one or more
+ > FOSS Applications.
+ > .
+ > "FOSS Application" means a free and open source software application
+ > distributed subject to a license listed in the section below titled
+ > "FOSS License List."
+ > .
+ > "FOSS Notice" means a notice placed by Oracle or MySQL in a copy
+ > of the MySQL Client Libraries stating that such copy of the MySQL
+ > Client Libraries may be distributed under Oracle's or MySQL's FOSS
+ > (or FLOSS) License Exception.
+ > .
+ > "Independent Work" means portions of the Derivative Work that are not
+ > derived from the Program and can reasonably be considered independent
+ > and separate works.
+ > .
+ > "Program" means a copy of Oracle's MySQL Client Libraries that
+ > contains a FOSS Notice.
+ > .
+ > A FOSS application developer ("you" or "your") may distribute a
+ > Derivative Work provided that you and the Derivative Work meet all
+ > of the following conditions: You obey the GPL in all respects for
+ > the Program and all portions (including modifications) of the Program
+ > included in the Derivative Work (provided that this condition does not
+ > apply to Independent Works); The Derivative Work does not include any
+ > work licensed under the GPL other than the Program; You distribute
+ > Independent Works subject to a license listed in the section below
+ > titled "FOSS License List"; You distribute Independent Works in
+ > object code or executable form with the complete corresponding
+ > machine-readable source code on the same medium and under the same
+ > FOSS license applying to the object code or executable forms; All
+ > works that are aggregated with the Program or the Derivative Work
+ > on a medium or volume of storage are not derivative works of the
+ > Program, Derivative Work or FOSS Application, and must reasonably
+ > be considered independent and separate works. Oracle reserves all
+ > rights not expressly granted in these terms and conditions. If all
+ > of the above conditions are not met, then this FOSS License Exception
+ > does not apply to you or your Derivative Work.
+ > .
+ > FOSS License List
+ > .
+ > License Name Version(s)/Copyright Date
+ > Release Early Certified Software
+ > Academic Free License 2.0
+ > Apache Software License 1.0/1.1/2.0
+ > Apple Public Source License 2.0
+ > Artistic license From Perl 5.8.0
+ > BSD license "July 22 1999"
+ > Common Development and Distribution License (CDDL) 1.0
+ > Common Public License 1.0
+ > Eclipse Public License 1.0
+ > European Union Public License (EUPL)[1] 1.1
+ > GNU Library or "Lesser" General Public License (LGPL) 2.0/2.1/3.0
+ > GNU General Public License (GPL) 3.0
+ > IBM Public License 1.0
+ > Jabber Open Source License 1.0
+ > MIT License (As listed in file MIT-License.txt) -
+ > Mozilla Public License (MPL) 1.0/1.1
+ > Open Software License 2.0
+ > OpenSSL license (with original SSLeay license) "2003" ("1998")
+ > PHP License 3.0/3.01
+ > Python license (CNRI Python License) -
+ > Python Software Foundation License 2.1.1
+ > Sleepycat License "1999"
+ > University of Illinois/NCSA Open Source License -
+ > W3C License "2001"
+ > X11 License "2001"
+ > Zlib/libpng License -
+ > Zope Public License 2.0
+ > [1] When an Independent Work is licensed under a "Compatible License"
+ > pursuant to the EUPL, the Compatible License rather than the EUPL is
+ > the applicable license for purposes of these FOSS License Exception
+ > Terms and Conditions.
+ .
+ The above text is subject to this copyright notice:
+ © 2010, Oracle and/or its affiliates.
+
+Files: cmd-line-utils/libedit/config.h
+ dbug/example1.c
+ dbug/example2.c
+ dbug/example3.c
+ dbug/factorial.c
+ dbug/main.c
+ dbug/my_main.c
+ dbug/remove_function_from_trace.pl
+ dbug/tests.c
+ dbug/tests-t.pl
+ extra/yassl/src/dummy.cpp
+ include/probes_mysql_nodtrace.h
+ libmysqld/resource.h
+ mysql-test/*
+ regex/*
+ sql-bench/graph-compare-results.sh
+ storage/ndb/bin/*
+ storage/ndb/demos/*
+ support-files/binary-configure.sh
+ support-files/my-huge.cnf.sh
+ support-files/my-innodb-heavy-4G.cnf.sh
+ support-files/my-large.cnf.sh
+ support-files/my-medium.cnf.sh
+ support-files/my-small.cnf.sh
+ support-files/mysqld_multi.server.sh
+ support-files/mysql-log-rotate.sh
+ support-files/mysql.server-sys5.sh
+Copyright: UNKNOWN
+Comment: These files fall under the blanket license specified in the file
+ COPYING and README
+License: GPL-2
+ GPLv2 Disclaimer
+ For the avoidance of doubt, except that if any license choice
+ other than GPL or LGPL is available it will apply instead,
+ Oracle elects to use only the General Public License version 2
+ (GPLv2) at this time for any software where a choice of GPL
+ license versions is made available with the language indicating
+ that GPLv2 or any later version may be used, or where a choice
+ of which version of the GPL is applied is otherwise unspecified.
+
+Files: BUILD/*
+ Docs/*
+ client/*
+ client/echo.c
+ client/get_password.c
+ cmake/*
+ dbug/dbug_add_tags.pl
+ extra/*
+ include/*
+ libmysql/*
+ libmysqld/*
+ libservices/*
+ mysql-test/include/have_perfschema.inc
+ mysql-test/include/have_perfschema.inc
+ mysql-test/lib/mtr_cases.pm
+ mysql-test/lib/mtr_gcov.pl
+ mysql-test/lib/mtr_gprof.pl
+ mysql-test/lib/mtr_io.pl
+ mysql-test/lib/mtr_match.pm
+ mysql-test/lib/mtr_misc.pl
+ mysql-test/lib/mtr_process.pl
+ mysql-test/lib/mtr_report.pm
+ mysql-test/lib/mtr_results.pm
+ mysql-test/lib/mtr_stress.pl
+ mysql-test/lib/mtr_unique.pm
+ mysql-test/lib/My/ConfigFactory.pm
+ mysql-test/lib/My/Config.pm
+ mysql-test/lib/My/CoreDump.pm
+ mysql-test/lib/My/File/*
+ mysql-test/lib/My/Find.pm
+ mysql-test/lib/My/Handles.pm
+ mysql-test/lib/My/Options.pm
+ mysql-test/lib/My/Platform.pm
+ mysql-test/lib/My/SafeProcess/Base.pm
+ mysql-test/lib/My/SafeProcess.pm
+ mysql-test/lib/My/SafeProcess/safe_kill_win.cc
+ mysql-test/lib/My/SafeProcess/safe_process.cc
+ mysql-test/lib/My/SafeProcess/safe_process.pl
+ mysql-test/lib/My/SafeProcess/safe_process_win.cc
+ mysql-test/lib/My/SysInfo.pm
+ mysql-test/lib/My/Test.pm
+ mysql-test/lib/t/*
+ mysql-test/lib/v1/mtr_cases.pl
+ mysql-test/lib/v1/mtr_gcov.pl
+ mysql-test/lib/v1/mtr_gprof.pl
+ mysql-test/lib/v1/mtr_im.pl
+ mysql-test/lib/v1/mtr_io.pl
+ mysql-test/lib/v1/mtr_match.pl
+ mysql-test/lib/v1/mtr_misc.pl
+ mysql-test/lib/v1/mtr_process.pl
+ mysql-test/lib/v1/mtr_report.pl
+ mysql-test/lib/v1/mtr_stress.pl
+ mysql-test/lib/v1/mtr_timer.pl
+ mysql-test/lib/v1/mtr_unique.pl
+ mysql-test/lib/v1/My/*
+ mysql-test/lib/v1/My/*
+ mysql-test/lib/v1/mysql-test-run.pl
+ mysql-test/mysql-stress-test.pl
+ mysql-test/mysql-test-run.pl
+ mysql-test/std_data/*
+ mysql-test/suite/perfschema/include/*
+ mysql-test/suite/perfschema_stress/include/*
+ mysql-test/suite/perfschema_stress/include/*
+ mysys/*
+ packaging/WiX/ca/*
+ plugin/audit_null/*
+ plugin/auth/*
+ plugin/daemon_example/*
+ plugin/fulltext/*
+ plugin/semisync/semisync_slave.cc
+ plugin/semisync/semisync_slave.h
+ scripts/*
+ sql/*
+ sql-common/*
+ storage/*
+ strings/*
+ support-files/config.huge.ini.sh
+ support-files/config.medium.ini.sh
+ support-files/config.small.ini.sh
+ support-files/MacOSX/Description.plist.sh
+ support-files/MacOSX/Info.plist.sh
+ support-files/MacOSX/StartupParameters.plist.sh
+ support-files/MySQL-shared-compat.spec.sh
+ support-files/mysql.spec.sh
+ support-files/ndb-config-2-node.ini.sh
+ tests/*
+ unittest/*
+ vio/*
+Copyright: 1979-2008 MySQL AB
+ 1995-2010 MySQL AB Sun Microsystems Inc
+ 1994-1997,2000-2011 Oracle and/or its affiliates.
+License: GPL-2
+
+Files: storage/innobase/*
+Copyright: 1994-2011 Innobase Oy.
+License: GPL-2
+
+Files: cmd-line-utils/readline/*
+Copyright: 1987-2006 Free Software Foundation Inc
+License: GPL-2+
+
+Files: cmd-line-utils/libedit/*
+Copyright: 1989-1990,1992-1993 The Regents of the University of California.
+License: BSD (3 clause)
+
+Files: cmd-line-utils/libedit/filecomplete.c
+ cmd-line-utils/libedit/filecomplete.h
+ cmd-line-utils/libedit/np/fgetln.c
+ cmd-line-utils/libedit/read.h
+ cmd-line-utils/libedit/readline.c
+ cmd-line-utils/libedit/readline/*
+Copyright: 1997-2001 The NetBSD Foundation Inc
+License: BSD (2 clause)
+ This code is derived from software contributed to The NetBSD Foundation
+ by Jaromir Dolecek.
+ .
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+Files: client/completion_hash.h
+ scripts/mysqlaccess.sh
+ scripts/mysql_fix_extensions.sh
+ scripts/mysql_setpermission.sh
+ sql-bench/*
+ storage/myisam/ftbench/ft-test-run.sh
+ storage/myisam/mi_test_all.sh
+ storage/ndb/test/run-test/atrt-analyze-result.sh
+ storage/ndb/test/run-test/atrt-clear-result.sh
+ storage/ndb/test/run-test/atrt-gather-result.sh
+ storage/ndb/test/run-test/atrt-setup.sh
+ storage/ndb/test/run-test/make-config.sh
+ storage/ndb/test/run-test/make-html-reports.sh
+ storage/ndb/test/run-test/make-index.sh
+ storage/ndb/test/run-test/ndb-autotest.sh
+ strings/strxmov.c
+ strings/strxnmov.c
+ support-files/MacOSX/postflight.sh
+ support-files/MacOSX/preflight.sh
+Copyright: 2000-2009 MySQL AB Sun Microsystems Inc
+ 2000-2007 MySQL AB
+License: LGPL
+
+Files: storage/archive/azio.c
+ storage/archive/azlib.h
+ zlib/*
+Copyright: 1995-2005 Jean-loup Gailly and Mark Adler
+License: zlib/libpng
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ .
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ .
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+Files: sql-bench/innotest1.sh
+ sql-bench/innotest1a.sh
+ sql-bench/innotest1b.sh
+ sql-bench/innotest2.sh
+ sql-bench/innotest2a.sh
+ sql-bench/innotest2b.sh
+Copyright: 2000-2002 Innobase Oy & MySQL AB
+Comment: These files fall under the blanket license specified in the file COPYING
+License: GPL-2
+
+Files: storage/innobase/btr/btr0sea.c
+ storage/innobase/include/log0log.h
+ storage/innobase/include/os0sync.h
+ storage/innobase/log/log0log.c
+ storage/innobase/row/row0sel.c
+Copyright: 1995-1997,2009-2010 Innobase Oy.
+ 2008-2009 Google Inc
+License: GPL-2
+
+Files: storage/innobase/btr/btr0cur.c
+ storage/innobase/buf/buf0buf.c
+ storage/innobase/include/sync0rw.h
+ storage/innobase/include/sync0sync.h
+ storage/innobase/sync/*
+Copyright: 1994-2011 Oracle and/or its affiliates.
+ 2008 Google Inc
+License: GPL-2
+
+Files: storage/myisam/rt_index.h
+ storage/myisam/rt_key.c
+ storage/myisam/rt_mbr.c
+ storage/myisam/rt_mbr.h
+ storage/myisam/sp_defs.h
+Copyright: 2000,2002-2006 MySQL AB & Ramil Kalimullin
+License: GPL-2
+
+Files: storage/innobase/include/ut0bh.h
+ storage/innobase/trx/trx0rseg.c
+ storage/innobase/ut/ut0bh.c
+ storage/innobase/ut/ut0ut.c
+Copyright: 1996,2010-2011 Oracle Corpn.
+License: GPL-2
+
+Files: plugin/semisync/semisync.cc
+ plugin/semisync/semisync.h
+ plugin/semisync/semisync_slave_plugin.cc
+Copyright: 2008 MySQL AB
+ 2007 Google Inc
+License: GPL-2
+
+Files: strings/ctype-bin.c
+ strings/ctype-eucjpms.c
+ strings/ctype-ujis.c
+Copyright: 2000,2002,2005-2011 Oracle and/or its affiliates. & tommy@valley.ne.jp
+License: LGPL
+ On Debian and systems the full text of the GNU Library General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/LGPL-2`
+
+Files: scripts/mysqld_safe.sh
+ support-files/mysql-multi.server.sh
+ support-files/mysql.server.sh
+Copyright: 1996 Abandoned TCX DataKonsult AB & Monty Program KB & Detron HB
+License: public-domain
+ This file is public domain and comes with NO WARRANTY of any kind
+
+Files: sql/sql_yacc.cc
+ sql/sql_yacc.h
+Copyright: 1984,1989-1990,2000-2006 Free Software Foundation, Inc.
+License: GPL-2+
+
+Files: storage/innobase/include/pars0grm.h
+ storage/innobase/pars/pars0grm.c
+Copyright: 1995-2009 Innobase Oy.
+ 1984,1989-1990,2000-2004 Free Software Foundation Inc.
+License: GPL-2
+ As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison.
+ .
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; version 2 of the License.
+ .
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License along with
+ this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+Files: storage/innobase/include/srv0srv.h
+ storage/innobase/srv/srv0start.c
+Copyright: 1995-1996,2010-2011 Innobase Oy.
+ 2008-2009 Google Inc
+ 2009 Percona Inc
+License: GPL-2
+
+Files: plugin/semisync/semisync_master.cc
+ plugin/semisync/semisync_master_plugin.cc
+Copyright: 2008-2009 MySQL AB Sun Microsystems Inc
+ 2007 Google Inc
+License: GPL-2
+
+Files: storage/innobase/include/os0file.h
+ storage/innobase/os/os0file.c
+Copyright: 1995-2010 Innobase Oy.
+ 2009 Percona Inc
+License: GPL-2
+
+Files: include/t_ctype.h
+ strings/t_ctype.h
+Copyright: 2000 MySQL AB
+ 1998 Theppitak Karoonboonyanan
+ 1998-1999 Pruet Boonma
+License: GPL-2
+
+Files: cmd-line-utils/libedit/np/strlcat.c
+ cmd-line-utils/libedit/np/strlcpy.c
+Copyright: 1998 Todd C. Miller <Todd.Miller@courtesan.com>
+License: ISC
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
+ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
+ FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Files: sql/nt_servc.cc
+ sql/nt_servc.h
+Copyright: 1998 Abandoned Irena Pancirov - Irnet Snc
+License: public-domain
+ This file is public domain and comes with NO WARRANTY of any kind
+
+Files: dbug/dbug.c
+ dbug/dbug_long.h
+Copyright: 1987 Abandoned Fred Fish
+License: public-domain
+ N O T I C E
+ .
+ Copyright Abandoned, 1987, Fred Fish
+ .
+ .
+ This previously copyrighted work has been placed into the public
+ domain by the author and may be freely used for any purpose,
+ private or commercial.
+ .
+ Because of the number of inquiries I was receiving about the use
+ of this product in commercially developed works I have decided to
+ simply make it public domain to further its unrestricted use. I
+ specifically would be most happy to see this material become a
+ part of the standard Unix distributions by AT&T and the Berkeley
+ Computer Science Research Group, and a standard part of the GNU
+ system from the Free Software Foundation.
+ .
+ I would appreciate it, as a courtesy, if this notice is left in
+ all copies and derivative works. Thank you.
+ .
+ The author makes no warranty of any kind with respect to this
+ product and explicitly disclaims any implied warranties of mer-
+ chantability or fitness for any particular purpose.
+
+Files: cmd-line-utils/libedit/np/vis.c
+Copyright: 1989-1993 The Regents of the University of California.
+ 1999-2005 The NetBSD Foundation Inc
+License: BSD (3 clause)
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+Files: scripts/dheadgen.pl
+Copyright: 2008-2009 Sun Microsystems Inc
+License: BSD (3 clause)
+
+Files: storage/ndb/test/src/getarg.c
+Copyright: 1997-2000 - Kungliga Tekniska Högskolan
+License: BSD (3 clause)
+
+Files: storage/ndb/test/include/getarg.h
+Copyright: 2003 MySQL AB
+ 1997-1999 Kungliga Tekniska Högskolan
+License: BSD (3 clause) GPL-2
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ .
+ Copyright (c) 1997, 1999 Kungliga Tekniska Högskolan
+ (Royal Institute of Technology, Stockholm, Sweden).
+ All rights reserved.
+ .
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ .
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ .
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ .
+ 3. Neither the name of the Institute nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
+Files: storage/innobase/handler/ha_innodb.cc
+Copyright: 2008-2009 Google Inc
+ 2009 Percona Inc
+ 2000-2011 MySQL AB & Innobase Oy.
+License: GPL-2
+
+Files: plugin/semisync/semisync_master.h
+Copyright: 2008-2009 MySQL AB Sun Microsystems Inc
+ 2007 Google Inc
+License: GPL-2
+
+Files: storage/innobase/srv/srv0srv.c
+Copyright: 2008-2009 Google Inc
+ 1995-2011 Oracle and/or its affiliates.
+ 2009 Percona Inc
+License: GPL-2
+
+Files: storage/innobase/ut/ut0rbt.c
+Copyright: 2007-2010 Innobase Oy.
+ 2007 Oracle/Innobase Oy
+License: GPL-2
+
+Files: strings/ctype-win1250ch.c
+Copyright: 2002-2010 Oracle and/or its affiliates.
+ 2001 Jan Pazdziora
+License: GPL-2
+
+Files: strings/ctype-tis620.c
+Copyright: 1998 Theppitak Karoonboonyanan <thep@links.nectec.or.th>
+ 1989-1991 Samphan Raruenrom <samphan@thai.com>
+ 2000-2010 Oracle and/or its affiliates.
+ 2003 Sathit Jittanupat
+ 2001 Korakot Chaovavanich <korakot@iname.com> and
+ 1998-1999 Pruet Boonma <pruet@eng.cmu.ac.th>
+License: GPL-2
+
+Files: storage/innobase/handler/ha_innodb.h
+Copyright: 2000-2010 MySQL AB & Innobase Oy.
+License: GPL-2
+
+Files: strings/dtoa.c
+Copyright: 2007-2010 Oracle and/or its affiliates.
+ 1991,2000-2001 Lucent Technologies
+License: LGPL
+
+Files: scripts/mysqldumpslow.sh
+Copyright: 2000-2002,2005-2009 MySQL AB Sun Microsystems Inc
+License: LGPL
+
+Files: libmysqld/lib_sql.cc
+Copyright: 2000 SWsoft company
+License: SWsoft
+ This material is provided "as is", with absolutely no warranty expressed
+ or implied. Any use is at your own risk.
+ .
+ Permission to use or copy this software for any purpose is hereby granted
+ without fee, provided the above notices are retained on all copies.
+ Permission to modify the code and to distribute modified code is granted,
+ provided the above notices are retained, and a notice that the code was
+ modified is included with the above copyright notice.
+
+Files: tests/mail_to_db.pl
+Copyright: 1998 Abandoned TCX DataKonsult AB & Monty Program KB & Detron HB
+License: public-domain
+ This file is public domain and comes with NO WARRANTY of any kind
+
+Files: dbug/dbug_analyze.c
+Copyright: 1987 June Binayak Banerjee
+License: public-domain
+ This program may be freely distributed under the same terms and
+ conditions as Fred Fish's Dbug package.
+
+Files: regex/regexp.c
+Copyright: 1986 University of Toronto
+License: BSD-like
+ Permission is granted to anyone to use this software for any
+ purpose on any computer system, and to redistribute it freely,
+ subject to the following restrictions:
+ .
+ 1. The author is not responsible for the consequences of use of
+ this software, no matter how awful, even if they arise
+ from defects in it.
+ .
+ 2. The origin of this software must not be misrepresented, either
+ by explicit claim or by omission.
+ .
+ 3. Altered versions must be plainly marked as such, and must not
+ be misrepresented as being the original software.
+
+License: GPL-2
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ .
+ On Debian and systems the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2`
+
+License: GPL-2+
+ This file is part of GNU Readline, a library for reading lines
+ of text with interactive input and history editing.
+ .
+ Readline is free software; 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, or (at your option) any
+ later version.
+ .
+ Readline is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with Readline; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
+ .
+ On Debian and systems the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2`
+
+License: LGPL
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; version 2
+ of the License.
+ .
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+ .
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301, USA
+ .
+ On Debian and systems the full text of the GNU Library General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/LGPL-2`
+
+License: BSD (3 clause)
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
--- /dev/null
+[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
+upstream-tree = branch
+pristine-tar = False
--- /dev/null
+usr/lib/*/libmysqlservices.a
--- /dev/null
+This package was requested in http://bugs.debian.org/508406 because it
+is needed by programs want to include the embedded MySQL into their
+shared libraries.
+
+In order to get the full compile flags, use /bin/mysql_config_pic
--- /dev/null
+usr/bin/mysql_config_pic
+usr/lib/mysql/libmysqld_pic.a
--- /dev/null
+debian/tmp/usr/share/man/man1/mysql_config_pic.1
--- /dev/null
+'''apport package hook for mysql-5.6
+
+(c) 2009 Canonical Ltd.
+Author: Mathias Gug <mathias.gug@canonical.com>
+'''
+
+from __future__ import print_function, unicode_literals
+import os, os.path
+
+from apport.hookutils import *
+
+def _add_my_conf_files(report, filename):
+ key = 'MySQLConf' + path_to_key(filename)
+ report[key] = ""
+ for line in read_file(filename).split('\n'):
+ try:
+ if 'password' in line.split('=')[0]:
+ line = "%s = @@APPORTREPLACED@@" % (line.split('=')[0])
+ report[key] += line + '\n'
+ except IndexError:
+ continue
+
+def add_info(report):
+ attach_conffiles(report, 'mysql-server-5.6', conffiles=None)
+ key = 'Logs' + path_to_key('/var/log/daemon.log')
+ report[key] = ""
+ for line in read_file('/var/log/daemon.log').split('\n'):
+ try:
+ if 'mysqld' in line.split()[4]:
+ report[key] += line + '\n'
+ except IndexError:
+ continue
+ if os.path.exists('/var/log/mysql/error.log'):
+ key = 'Logs' + path_to_key('/var/log/mysql/error.log')
+ report[key] = ""
+ for line in read_file('/var/log/mysql/error.log').split('\n'):
+ report[key] += line + '\n'
+ attach_mac_events(report, '/usr/sbin/mysqld')
+ attach_file(report,'/etc/apparmor.d/usr.sbin.mysqld')
+ _add_my_conf_files(report, '/etc/mysql/my.cnf')
+ for f in os.listdir('/etc/mysql/conf.d'):
+ _add_my_conf_files(report, os.path.join('/etc/mysql/conf.d', f))
+ try:
+ report['MySQLVarLibDirListing'] = str(os.listdir('/var/lib/mysql'))
+ except OSError:
+ report['MySQLVarLibDirListing'] = str(False)
+
+if __name__ == '__main__':
+ report = {}
+ add_info(report)
+ for key in report:
+ print('%s: %s' % (key, report[key].split('\n', 1)[0]))
--- /dev/null
+FAQ:
+
+Q: My <tab> completition is gone, why?
+A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mysql/my.cnf!
--- /dev/null
+usr/bin/
+usr/share/man/man1/
+usr/share/perl5/
--- /dev/null
+debian/additions/innotop/changelog.innotop
+README
--- /dev/null
+debian/tmp/usr/bin/mysqlaccess.conf
--- /dev/null
+# this executable reprsent the embedded mysql server client
+debian/additions/innotop/innotop usr/bin/
+debian/additions/mysqlreport usr/bin/
+usr/bin/innochecksum
+usr/bin/myisam_ftdump
+usr/bin/mysql
+usr/bin/mysql_client_test
+usr/bin/mysql_config_editor
+usr/bin/mysql_find_rows
+usr/bin/mysql_fix_extensions
+usr/bin/mysql_plugin
+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
--- /dev/null
+usr/bin/mysqlcheck usr/bin/mysqlrepair
+usr/bin/mysqlcheck usr/bin/mysqlanalyze
+usr/bin/mysqlcheck usr/bin/mysqloptimize
+usr/share/man/man1/mysqlcheck.1.gz usr/share/man/man1/mysqlrepair.1.gz
+usr/share/man/man1/mysqlcheck.1.gz usr/share/man/man1/mysqlanalyze.1.gz
+usr/share/man/man1/mysqlcheck.1.gz usr/share/man/man1/mysqloptimize.1.gz
--- /dev/null
+# Will look at man pages later
+# 2012-03-08 periapt
+# still no update
+# 2012-01-09 jesusch-guest
+mysql-client-5.6: binary-without-manpage usr/bin/innochecksum
+# These long lines reproduce actual output and to reformat them
+# would damage the integrity of the man page.
+mysql-client-5.6: manpage-has-errors-from-man usr/share/man/man1/mysqladmin.1.gz 28: warning [p 1, 1.5i]: can't break line
+mysql-client-5.6: manpage-has-errors-from-man usr/share/man/man1/mysqldump.1.gz 2151: warning [p 12, 6.5i, div `3tbd2,1', 0.2i]: can't break line
--- /dev/null
+debian/additions/innotop/innotop.1
+debian/tmp/usr/share/man/man1/mysqlman.1
+debian/additions/mysqlreport.1
+debian/tmp/usr/share/man/man1/mysql_embedded.1
--- /dev/null
+etc/mysql/conf.d/
--- /dev/null
+debian/additions/my.cnf etc/mysql/
+debian/additions/my5.6.cnf etc/mysql/conf.d/
--- /dev/null
+#!/bin/bash
+
+set -e
+
+if [ "$1" = "purge" ]; then
+ rmdir /etc/mysql 2>/dev/null || true
+fi
+
+#DEBHELPER#
--- /dev/null
+The examples directory includes files that might be needed by some
+developers:
+- header files not installed by default
+- the example file udf_example.c
--- /dev/null
+usr/include/
+usr/lib/
--- /dev/null
+sql/udf_example.cc
--- /dev/null
+usr/bin/mysql_config
+usr/include/mysql/*
+usr/lib/*/libmysqlclient.a
+usr/lib/*/libmysqlclient.so
+usr/lib/*/libmysqlclient_r.a
+usr/lib/*/libmysqlclient_r.so
+usr/share/aclocal/mysql.m4
--- /dev/null
+usr/lib/*/libmysqlclient.so.18*
+usr/lib/*/libmysqlclient_r.so.18*
--- /dev/null
+# I take this issue seriously but as per bug #590905
+# it will need playing with in experimental. - periapt
+libmysqlclient18: no-symbols-control-file usr/lib/i386-linux-gnu/libmysqlclient.so.18.1.0
--- /dev/null
+mysql-dfsg-5.1 (5.1.36-1) unstable; urgency=low
+
+ * Please read http://dev.mysql.com/doc/refman/5.1/en/upgrading-from-5-0.html
+ * Make sure to do a REPAIR TABLE on all tables that use UTF-8 and have a
+ FULLTEXT index.
+
+ -- Christian Hammers <ch@debian.org> Sat, 4 Jul 2009 02:31:21 +0200
+
+mysql-dfsg-5.0 (5.1.14beta-2) unstable; urgency=low
+
+ * The BerkeleyDB Storage Engine is no longer supported. If the options
+ have-bdb or skip-bdb are found, MySQL will not start. If you have BDB
+ tables, you should change them to use another storage engine before
+ upgrading to 5.1.
+
+ -- Monty Taylor <mordred@inaugust.com> Thu, 18 Jan 2007 12:28:21 -0800
+
+mysql-dfsg-5.0 (5.0.45-2) unstable; urgency=low
+
+ * Binary logging is now disabled by default. If you really need it (e.g. on
+ a replication master), remove the comment from the log_bin line in my.cnf.
+
+ -- Norbert Tretkowski <norbert@tretkowski.de> Sat, 10 Nov 2007 16:26:35 +0100
+
+mysql-dfsg-5.0 (5.0.18-9) unstable; urgency=low
+
+ * Rotation of the binary logs is now configured in /etc/mysql/my.cnf with
+ "expire-logs-days" which defaults to 20 days. The old file
+ /etc/mysql/debian-log-rotate.conf should be removed together with
+ /etc/cron.daily/mysql-server after this value has been adjusted. Note that
+ the old variable defined the number of files whereas the new one defines
+ a time span in days.
+
+ -- Christian Hammers <ch@debian.org> Tue, 24 Jan 2006 22:18:21 +0100
--- /dev/null
+* 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.
--- /dev/null
+#!/bin/bash
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+CNF=/etc/mysql/my.cnf
+
+# Beware that there are two ypwhich one of them needs the 2>/dev/null!
+if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
+ db_input high mysql-server-5.6/nis_warning || true
+ db_go
+fi
+
+# only ask this question on fresh installs, during "reconfiguration" and when
+# not upgrading from an existing 5.0 installation.
+# there is also an additional check for empty root passwords in the
+# postinst script when the tools are available for us to use.
+if [ "$1" = "configure" ] && ([ -z "$2" ] && [ ! -e "/var/lib/mysql/debian-5.0.flag" ] ) || [ "$1" = "reconfigure" ]; then
+ while :; do
+ RET=""
+ db_input high mysql-server/root_password || true
+ db_go
+ db_get mysql-server/root_password
+ # if password isn't empty we ask for password verification
+ if [ -z "$RET" ]; then
+ db_fset mysql-server/root_password seen false
+ db_fset mysql-server/root_password_again seen false
+ break
+ fi
+ ROOT_PW="$RET"
+ db_input high mysql-server/root_password_again || true
+ db_go
+ db_get mysql-server/root_password_again
+ if [ "$RET" == "$ROOT_PW" ]; then
+ ROOT_PW=''
+ break
+ fi
+ db_fset mysql-server/password_mismatch seen false
+ db_input critical mysql-server/password_mismatch
+ db_set mysql-server/root_password ""
+ db_set mysql-server/root_password_again ""
+ db_go
+ done
+fi
--- /dev/null
+etc/init.d
+etc/logrotate.d
+etc/mysql/conf.d
+usr/bin
+usr/share/mysql
+var/lib/mysql-upgrade
+usr/sbin
+usr/share/man/man8
--- /dev/null
+debian/tmp/usr/share/mysql/wsrep.cnf
+debian/tmp/usr/share/mysql/magic
+debian/tmp/usr/lib/mysql/plugin/daemon_example.ini
--- /dev/null
+#usr/share/mysql/config.huge.ini
+#usr/share/mysql/config.medium.ini
+#usr/share/mysql/config.small.ini
+#usr/share/mysql/ndb-config-2-node.ini
+debian/additions/mysqld_safe_syslog.cnf etc/mysql/conf.d/
+etc/apparmor.d/usr.sbin.mysqld
+etc/init.d/mysql
+etc/mysql/debian-start
+usr/bin/msql2mysql
+usr/bin/my_print_defaults
+usr/bin/myisamchk
+usr/bin/myisamlog
+usr/bin/myisampack
+usr/bin/mysql_convert_table_format
+usr/bin/mysql_install_db
+usr/bin/mysql_secure_installation
+usr/bin/mysql_setpermission
+usr/bin/mysql_tzinfo_to_sql
+usr/bin/mysql_upgrade
+usr/bin/mysql_zap
+usr/bin/mysqlbinlog
+usr/bin/mysqld_multi
+usr/bin/mysqld_safe
+usr/bin/mysqlhotcopy
+usr/bin/mysqltest
+usr/bin/perror
+usr/bin/replace
+usr/bin/resolve_stack_dump
+usr/bin/resolveip
+usr/bin/wsrep_sst_common
+usr/bin/wsrep_sst_mysqldump
+usr/bin/wsrep_sst_rsync
+usr/bin/wsrep_sst_xtrabackup
+usr/lib/mysql/plugin/*.so
+usr/sbin/mysqld
+usr/sbin/mysqld
+usr/share/doc/mysql-server-5.6/
+usr/share/mysql/bulgarian
+usr/share/mysql/charsets
+usr/share/mysql/charsets
+usr/share/mysql/czech
+usr/share/mysql/czech
+usr/share/mysql/danish
+usr/share/mysql/danish
+usr/share/mysql/debian-start.inc.sh
+usr/share/mysql/debian_create_root_user.sql
+usr/share/mysql/dictionary.txt
+usr/share/mysql/dutch
+usr/share/mysql/dutch
+usr/share/mysql/echo_stderr
+usr/share/mysql/english
+usr/share/mysql/english
+usr/share/mysql/errmsg-utf8.txt
+usr/share/mysql/estonian
+usr/share/mysql/estonian
+usr/share/mysql/fill_help_tables.sql
+usr/share/mysql/french
+usr/share/mysql/french
+usr/share/mysql/german
+usr/share/mysql/german
+usr/share/mysql/greek
+usr/share/mysql/greek
+usr/share/mysql/hungarian
+usr/share/mysql/hungarian
+usr/share/mysql/innodb_memcached_config.sql
+usr/share/mysql/italian
+usr/share/mysql/italian
+usr/share/mysql/japanese
+usr/share/mysql/japanese
+usr/share/mysql/korean
+usr/share/mysql/korean
+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/mysqld_multi.server
+usr/share/mysql/norwegian
+usr/share/mysql/norwegian
+usr/share/mysql/norwegian-ny
+usr/share/mysql/norwegian-ny
+usr/share/mysql/polish
+usr/share/mysql/polish
+usr/share/mysql/portuguese
+usr/share/mysql/portuguese
+usr/share/mysql/romanian
+usr/share/mysql/romanian
+usr/share/mysql/russian
+usr/share/mysql/russian
+usr/share/mysql/serbian
+usr/share/mysql/serbian
+usr/share/mysql/slovak
+usr/share/mysql/slovak
+usr/share/mysql/spanish
+usr/share/mysql/spanish
+usr/share/mysql/swedish
+usr/share/mysql/swedish
+usr/share/mysql/ukrainian
+usr/share/mysql/ukrainian
+usr/share/mysql/wsrep.cnf
+usr/share/mysql/my-default.cnf
--- /dev/null
+# These long lines reproduce actual output and to reformat them
+# would damage the integrity of the man page.
+# mysql-server-5.6: manpage-has-errors-from-man usr/share/man/man1/mysqlbinlog.1.gz 1405: warning [p 9, 7.5i, div `3tbd3,2', 0.8i]: can't break line
+# These are random occurrences of a pseudo word in a binary.
+mysql-server-5.6: spelling-error-in-binary usr/sbin/mysqld yuR your
--- /dev/null
+/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$
+mysqld_safe\[[0-9]+\]: started$
+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'$
--- /dev/null
+/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$
+mysqld_safe\[[0-9]+\]: ?$
+mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$
+mysqld_safe\[[0-9]+\]: ended$
+mysqld_safe\[[0-9]+\]: http://www.mysql.com$
+mysqld_safe\[[0-9]+\]: NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run$
+mysqld_safe\[[0-9]+\]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !$
+mysqld_safe\[[0-9]+\]: Please report any problems with the /usr/bin/mysqlbug script!$
+mysqld_safe\[[0-9]+\]: See the manual for more instructions.$
+mysqld_safe\[[0-9]+\]: started$
+mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at https://order.mysql.com$
+mysqld_safe\[[0-9]+\]: The latest information about MySQL is available on the web at$
+mysqld_safe\[[0-9]+\]: the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be$
+mysqld_safe\[[0-9]+\]: To do so, start the server, then issue the following commands:$
+mysqld_safe\[[0-9]+\]: /usr/bin/mysqladmin -u root -h app109 password 'new-password'$
+mysqld_safe\[[0-9]+\]: /usr/bin/mysqladmin -u root password 'new-password'$
+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'$
--- /dev/null
+/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$
+mysqld_safe\[[0-9]+\]: ?$
+mysqld_safe\[[0-9]+\]: able to use the new GRANT command!$
+mysqld_safe\[[0-9]+\]: ended$
+mysqld_safe\[[0-9]+\]: http://www.mysql.com$
+mysqld_safe\[[0-9]+\]: NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run$
+mysqld_safe\[[0-9]+\]: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !$
+mysqld_safe\[[0-9]+\]: Please report any problems with the /usr/bin/mysqlbug script!$
+mysqld_safe\[[0-9]+\]: See the manual for more instructions.$
+mysqld_safe\[[0-9]+\]: started$
+mysqld_safe\[[0-9]+\]: Support MySQL by buying support/licenses at https://order.mysql.com$
+mysqld_safe\[[0-9]+\]: The latest information about MySQL is available on the web at$
+mysqld_safe\[[0-9]+\]: the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be$
+mysqld_safe\[[0-9]+\]: To do so, start the server, then issue the following commands:$
+mysqld_safe\[[0-9]+\]: /usr/bin/mysqladmin -u root -h app109 password 'new-password'$
+mysqld_safe\[[0-9]+\]: /usr/bin/mysqladmin -u root password 'new-password'$
+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'$
--- /dev/null
+# - 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
+}
--- /dev/null
+description "MySQL 5.6 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
--- /dev/null
+#!/bin/bash
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
+
+# This command can be used as pipe to syslog. With "-s" it also logs to stderr.
+ERR_LOGGER="logger -p daemon.err -t mysqld_safe -i"
+
+invoke() {
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ invoke-rc.d mysql $1
+ else
+ /etc/init.d/mysql $1
+ fi
+}
+
+MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables"
+
+test_mysql_access() {
+ mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1
+}
+
+# call with $1 = "online" to connect to the server, otherwise it bootstraps
+set_mysql_rootpw() {
+ # forget we ever saw the password. don't use reset to keep the seen status
+ db_set mysql-server/root_password ""
+ db_set mysql-server/root_password_again ""
+
+ tfile=`mktemp`
+ if [ ! -f "$tfile" ]; then
+ return 1
+ fi
+
+ # this avoids us having to call "test" or "[" on $rootpw
+ cat << EOF > $tfile
+USE mysql;
+UPDATE user SET password=PASSWORD("$rootpw") WHERE user='root';
+FLUSH PRIVILEGES;
+EOF
+ if grep -q 'PASSWORD("")' $tfile; then
+ retval=0
+ elif [ "$1" = "online" ]; then
+ mysql --no-defaults -u root -h localhost <$tfile >/dev/null
+ retval=$?
+ else
+ $MYSQL_BOOTSTRAP <$tfile
+ retval=$?
+ fi
+ rm -f $tfile
+ return $retval
+}
+
+# This is necessary because mysql_install_db removes the pid file in /var/run
+# and because changed configuration options should take effect immediately.
+# In case the server wasn't running at all it should be ok if the stop
+# script fails. I can't tell at this point because of the cleaned /var/run.
+set +e; invoke stop; set -e
+
+case "$1" in
+ configure)
+ mysql_datadir=/usr/share/mysql
+ mysql_statedir=/var/lib/mysql
+ mysql_rundir=/var/run/mysqld
+ mysql_logdir=/var/log/mysql
+ mysql_cfgdir=/etc/mysql
+ mysql_upgradedir=/var/lib/mysql-upgrade
+ mysql_filesdir=/var/lib/mysql-files
+
+ # Ensure the existence and right permissions for the database and
+ # log files.
+
+ # MySQL 5.6.34 needs this
+
+ if [ ! -d ${mysql_filesdir} -a ! -L ${mysql_filesdir} ];
+ then
+ mkdir ${mysql_filesdir}
+ chown mysql:mysql ${mysql_filesdir}
+ chmod 770 ${mysql_filesdir}
+ fi
+
+ if [ ! -d "$mysql_statedir" -a ! -L "$mysql_statedir" ]; then mkdir "$mysql_statedir"; fi
+ if [ ! -d "$mysql_statedir/mysql" -a ! -L "$mysql_statedir/mysql" ]; then mkdir "$mysql_statedir/mysql"; fi
+ if [ ! -d "$mysql_logdir" -a ! -L "$mysql_logdir" ]; then mkdir "$mysql_logdir"; fi
+ # When creating an ext3 jounal on an already mounted filesystem like e.g.
+ # /var/lib/mysql, you get a .journal file that is not modifyable by chown.
+ # The mysql_datadir must not be writable by the mysql user under any
+ # circumstances as it contains scripts that are executed by root.
+ set +e
+ chown -R 0:0 $mysql_datadir
+ chown -R mysql $mysql_statedir
+ chmod 700 $mysql_statedir $mysql_statedir/mysql
+ if [ ! -d "$mysql_rundir" ]; then mkdir "$mysql_rundir"; fi
+ chown -R mysql $mysql_rundir
+ touch $mysql_logdir/error.log
+ chown -R mysql:adm $mysql_logdir
+ chmod 0750 $mysql_logdir
+ chmod 0640 $mysql_logdir/error.log
+ set -e
+
+ # This is important to avoid dataloss when there is a removed
+ # mysql-server version from Woody lying around which used the same
+ # data directory and then somewhen gets purged by the admin.
+ db_set mysql-server/postrm_remove_database false || true
+
+ # To avoid downgrades.
+ touch $mysql_statedir/debian-5.6.flag
+
+ # initiate databases. Output is not allowed by debconf :-(
+ # Debian: can safely run on upgrades with existing databases
+
+ set +e
+ tfile_select_db=`mktemp`
+ echo "USE mysql;" > $tfile_select_db
+ MYSQL_EXTRA_OPTS=" --default-storage-engine=myisam --lc-messages-dir=/usr/share/mysql/english/.."
+ MYSQL_CMDLINE=$MYSQL_BOOTSTRAP$MYSQL_EXTRA_OPTS
+ cat $tfile_select_db $mysql_datadir/mysql_system_tables.sql $mysql_datadir/debian_create_root_user.sql $mysql_datadir/fill_help_tables.sql | $MYSQL_CMDLINE 2>&1 | $ERR_LOGGER
+ rm $tfile_select_db
+ set -e
+
+ ## On every reconfiguration the maintenance user is recreated.
+ #
+ # - It is easier to regenerate the password every time but as people
+ # use fancy rsync scripts and file alteration monitors, the existing
+ # password is used and existing files not touched.
+ # - The mysqld statement is like that in mysql_install_db because the
+ # server is not already running. This has some implications:
+ # - The amount of newlines and semicolons in the query is important!
+ # - GRANT is not possible with --skip-grant-tables and "INSERT
+ # (user,host..) VALUES" is not --ansi compliant
+ # - The echo is just for readability. ash's buildin has no "-e" so use /bin/echo.
+ # - The Super_priv, Show_db_priv, Create_tmp_table_priv and Lock_tables_priv
+ # may not be present as old Woody 3.23 databases did not have it and the
+ # admin might not already have run mysql_upgrade which adds them.
+ # As the binlog cron scripts to need at least the Super_priv, I do first
+ # the old query which always succeeds and then the new which may or may not.
+
+ # recreate the credentials file if not present or without mysql_upgrade stanza
+ dc=$mysql_cfgdir/debian.cnf;
+ if [ -e "$dc" -a -n "`fgrep mysql_upgrade $dc 2>/dev/null`" ]; then
+ pass="`sed -n 's/^[ ]*password *= *// p' $dc | head -n 1`"
+ else
+ pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`;
+ if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir; fi
+ umask 066
+ cat /dev/null > $dc
+ umask 022
+ echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc
+ echo "[client]" >>$dc
+ echo "host = localhost" >>$dc
+ echo "user = debian-sys-maint" >>$dc
+ echo "password = $pass" >>$dc
+ echo "socket = $mysql_rundir/mysqld.sock" >>$dc
+ echo "[mysql_upgrade]" >>$dc
+ echo "host = localhost" >>$dc
+ echo "user = debian-sys-maint" >>$dc
+ echo "password = $pass" >>$dc
+ echo "socket = $mysql_rundir/mysqld.sock" >>$dc
+ echo "basedir = /usr" >>$dc
+ fi
+ # If this dir chmod go+w then the admin did it. But this file should not.
+ chown 0:0 $dc
+ chmod 0600 $dc
+
+ replace_query=`echo -e \
+ "USE mysql;\n" \
+ "REPLACE INTO user SET " \
+ " host='localhost', user='debian-sys-maint', password=password('$pass'), " \
+ " Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', " \
+ " Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', " \
+ " Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y', " \
+ " Index_priv='Y', Alter_priv='Y', Super_priv='Y', Show_db_priv='Y', "\
+ " Create_tmp_table_priv='Y', Lock_tables_priv='Y', Execute_priv='Y', "\
+ " Repl_slave_priv='Y', Repl_client_priv='Y', Create_view_priv='Y', "\
+ " Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y', "\
+ " Create_user_priv='Y', Event_priv='Y', Trigger_priv='Y'; "`;
+ # Engines supported by etch should be installed per default. The query sequence is supposed
+ # to be aborted if the CREATE TABLE fails due to an already existent table in which case the
+ # admin might already have chosen to remove one or more plugins. Newlines are necessary.
+ install_plugins=`echo -e \
+ "USE mysql;\n" \
+ "CREATE TABLE IF NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT '', " \
+ " dl char(128) COLLATE utf8_bin NOT NULL DEFAULT '', " \
+ " PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MySQL plugins';\n" \
+ "INSERT INTO plugin VALUES ('innodb', 'ha_innodb.so');\n" \
+ "INSERT INTO plugin VALUES ('federated', 'ha_federated.so');\n" \
+ "INSERT INTO plugin VALUES ('blackhole', 'ha_blackhole.so');\n" \
+ "INSERT INTO plugin VALUES ('archive', 'ha_archive.so');" `
+
+ db_get mysql-server/root_password && rootpw="$RET"
+ if ! set_mysql_rootpw; then
+ password_error="yes"
+ fi
+
+ echo "$replace_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
+ set +e
+ echo "$install_plugins" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER
+ set -e
+ ;;
+
+ abort-upgrade|abort-remove|abort-configure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument '$1'" 1>&2
+ exit 1
+ ;;
+esac
+
+# here we check to see if we can connect as root without a password
+# this should catch upgrades from previous versions where the root
+# password wasn't set. if there is a password, or if the connection
+# fails for any other reason, nothing happens.
+if [ "$1" = "configure" ]; then
+ if test_mysql_access; then
+ db_input medium mysql-server/root_password || true
+ db_go
+ db_get mysql-server/root_password && rootpw="$RET"
+
+ if ! set_mysql_rootpw "online"; then
+ password_error="yes"
+ fi
+ fi
+
+ if [ "$password_error" = "yes" ]; then
+ db_input high mysql-server/error_setting_password || true
+ db_go
+ fi
+
+fi
+
+db_stop # in case invoke failes
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+set -e
+
+# It is possible that Debconf has already been removed, too.
+if [ -f /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+fi
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+
+# Try to stop the server in a sane way. If it does not success let the admin
+# do it himself. No database directories should be removed while the server
+# is running!
+stop_server() {
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ invoke-rc.d mysql stop
+ else
+ /etc/init.d/mysql stop
+ fi
+ errno=$?
+ set -e
+
+ if [ "$?" != 0 ]; then
+ echo "Trying to stop the MySQL server resulted in exitcode $?." 1>&2
+ echo "Stop it yourself and try again!" 1>&2
+ exit 1
+ fi
+}
+
+case "$1" in
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ if [ -n "`$MYADMIN ping 2>/dev/null`" ]; then
+ stop_server
+ sleep 2
+ fi
+ ;;
+ *)
+ echo "postrm called with unknown argument '$1'" 1>&2
+ exit 1
+ ;;
+esac
+
+#
+# - Do NOT purge logs or data if another mysql-sever* package is installed (#307473)
+# - Remove the mysql user only after all his owned files are purged.
+#
+if [ "$1" = "purge" -a ! \( -x /usr/sbin/mysqld -o -L /usr/sbin/mysqld \) ]; then
+ # we remove the mysql user only after all his owned files are purged
+ rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz}
+ rm -rf /var/log/mysql
+
+ db_input high mysql-server-5.6/postrm_remove_databases || true
+ db_go || true
+ db_get mysql-server-5.6/postrm_remove_databases || true
+ if [ "$RET" = "true" ]; then
+ # never remove the debian.cnf when the databases are still existing
+ # else we ran into big trouble on the next install!
+ rm -f /etc/mysql/debian.cnf
+ rm -rf /var/lib/mysql
+ rm -rf /var/run/mysqld
+ userdel mysql || true
+ fi
+fi
+
+# (normally) Automatically added by dh_installdebconf
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+ db_purge
+fi
+# (normally) End automatically added section
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/bash
+#
+# summary of how this script can be called:
+# * <new-preinst> install
+# * <new-preinst> install <old-version>
+# * <new-preinst> upgrade <old-version>
+# * <old-preinst> abort-upgrade <new-version>
+#
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
+MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
+DATADIR=/var/lib/mysql
+LOGDIR=/var/log/mysql
+UPGRADEDIR=/var/lib/mysql-upgrade
+
+# Try to stop the server in a sane way. If it does not success let the admin
+# do it himself. No database directories should be removed while the server
+# is running! Another mysqld in e.g. a different chroot is fine for us.
+stop_server() {
+ if [ ! -x /etc/init.d/mysql ]; then return; fi
+
+ set +e
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ cmd="invoke-rc.d mysql stop"
+ else
+ cmd="/etc/init.d/mysql stop"
+ fi
+ $cmd
+ errno=$?
+ set -e
+
+ # 0=ok, 100=no init script (fresh install)
+ if [ "$errno" != 0 -a "$errno" != 100 ]; then
+ echo "${cmd/ */} returned $errno" 1>&2
+ echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2
+ echo "Stop it yourself and try again!" 1>&2
+ db_stop
+ exit 1
+ fi
+}
+
+################################ main() ##########################
+
+this_version=5.6
+
+# Abort if an NDB cluster is in use.
+if egrep -qi -r '^[^#]*ndb.connectstring|^[[:space:]]*\[[[:space:]]*ndb_mgmd' /etc/mysql/; then
+ db_fset mysql-server/no_upgrade_when_using_ndb seen false || true
+ db_input high mysql-server/no_upgrade_when_using_ndb || true
+ db_go
+ db_stop
+ exit 1
+fi
+
+# Abort if skip-bdb option is enabled, required for 5.0 -> 5.1 upgrades.
+#TODO
+
+# Safe the user from stupidities.
+show_downgrade_warning=0
+for i in `ls $DATADIR/debian-*.flag 2>/dev/null`; do
+ found_version=`echo $i | sed 's/.*debian-\([0-9\.]\+\).flag/\1/'`
+ if dpkg --compare-versions "$this_version" '<<' "$found_version"; then
+ show_downgrade_warning=1
+ break;
+ fi
+done
+if [ "$show_downgrade_warning" = 1 ]; then
+ db_fset mysql-server-$this_version/really_downgrade seen false || true
+ db_input medium mysql-server-$this_version/really_downgrade || true
+ db_go
+ db_get mysql-server-$this_version/really_downgrade || true
+ if [ "$RET" = "true" ]; then
+ rm -f $DATADIR/debian-*.flag
+ touch $DATADIR/debian-$this_version.flag
+ else
+ echo "Aborting downgrade from (at least) $found_version to $this_version." 1>&2
+ echo "If are sure you want to downgrade to $this_version, remove the file" 1>&2
+ echo "$DATADIR/debian-*.flag and try installing again." 1>&2
+ db_stop
+ exit 1
+ fi
+fi
+
+# to be sure
+stop_server
+
+# If we use NIS then errors should be tolerated. It's up to the
+# user to ensure that the mysql user is correctly setup.
+# Beware that there are two ypwhich one of them needs the 2>/dev/null!
+if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then
+ set +e
+fi
+
+#
+# Now we have to ensure the following state:
+# /etc/passwd: mysql:x:100:101:MySQL Server:/nonexistent:/bin/false
+# /etc/group: mysql:x:101:
+#
+# Sadly there could any state be present on the system so we have to
+# modify everything carefully i.e. not doing a chown before creating
+# the user etc...
+#
+
+# creating mysql group if he isn't already there
+if ! getent group mysql >/dev/null; then
+ # Adding system group: mysql.
+ addgroup --system mysql >/dev/null
+fi
+
+# creating mysql user if he isn't already there
+if ! getent passwd mysql >/dev/null; then
+ # Adding system user: mysql.
+ adduser \
+ --system \
+ --disabled-login \
+ --ingroup mysql \
+ --no-create-home \
+ --home /nonexistent \
+ --gecos "MySQL Server" \
+ --shell /bin/false \
+ mysql >/dev/null
+fi
+
+# end of NIS tolerance zone
+set -e
+
+# if there's a symlink, let's store where it's pointing, because otherwise
+# it's going to be lost in some situations
+for dir in DATADIR LOGDIR; do
+ checkdir=`eval echo "$"$dir`
+ if [ -L "$checkdir" ]; then
+ mkdir -p "$UPGRADEDIR"
+ cp -d "$checkdir" "$UPGRADEDIR/$dir.link"
+ fi
+done
+
+# creating mysql home directory
+if [ ! -d $DATADIR -a ! -L $DATADIR ]; then
+ mkdir $DATADIR
+fi
+
+# checking disc space
+if LC_ALL=C BLOCKSIZE= df --portability $DATADIR/. | tail -n 1 | awk '{ exit ($4>1000) }'; then
+ echo "ERROR: There's not enough space in $DATADIR/" 1>&2
+ db_stop
+ exit 1
+fi
+
+# Since the home directory was created before putting the user into
+# the mysql group and moreover we cannot guarantee that the
+# permissions were correctly *before* calling this script, we fix them now.
+# In case we use NIS and no mysql user is present then this script should
+# better fail now than later..
+# The "set +e" is necessary as e.g. a ".journal" of a ext3 partition is
+# not chgrp'able (#318435).
+set +e
+chown mysql:mysql $DATADIR
+find $DATADIR -follow -not -group mysql -print0 2>/dev/null \
+ | xargs -0 --no-run-if-empty chgrp mysql
+set -e
+
+# Some files below /etc/ were possibly in the mysql-server-5.0/etch package
+# before. They get overwritten by current ones to avoid unnecessary dpkg questions.
+while read md5 file; do
+ if [ "`md5sum $file 2>/dev/null`" = "$md5 $file" ]; then
+ cp /usr/share/mysql-common/internal-use-only/`echo $file | sed 's°/°_°g'` $file
+ fi
+done <<EOT
+6691f2fdc5c6d27ff0260eb79813e1bc /etc/init.d/mysql
+b53b9552d44661361d39157c3c7c51d3 /etc/logrotate.d/mysql-server
+57f3e58f72582ca55100dc1ba0f1a8ae /etc/mysql/debian-start
+EOT
+
+db_stop
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
+${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }
+
+#DEBHELPER#
--- /dev/null
+# These templates have been reviewed by the debian-l10n-english
+# team
+#
+# If modifications/additions/rewording are needed, please ask
+# for an advice to debian-l10n-english@lists.debian.org
+#
+# Even minor modifications require translation updates and such
+# changes should be coordinated with translators and reviewers.
+
+Template: mysql-server-5.6/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-server-5.6/nis_warning
+Type: note
+#flag:translate!:3,5
+_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-server-5.6/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.
+ .
+ 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-server-5.6/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-server/root_password
+Type: password
+_Description: New password for the MySQL "root" user:
+ While not mandatory, it is highly recommended that you set a password
+ for the MySQL administrative "root" user.
+ .
+ If this field is left blank, the password will not be changed.
+
+Template: mysql-server/root_password_again
+Type: password
+_Description: Repeat password for the MySQL "root" user:
+
+Template: mysql-server/error_setting_password
+Type: error
+_Description: Unable to set password for the MySQL "root" user
+ 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.
+ .
+ You should check the account's password after the package installation.
+ .
+ Please read the /usr/share/doc/mysql-server-5.6/README.Debian file
+ for more information.
+
+Template: mysql-server/password_mismatch
+Type: error
+_Description: Password input error
+ The two passwords you entered were not the same. Please try again.
+
+Template: mysql-server/no_upgrade_when_using_ndb
+Type: error
+_Description: NDB Cluster seems to be in use
+ 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/.
--- /dev/null
+/usr/lib/mysql-testsuite
+usr/share/mysql/mysql-test/suite/wsrep
+usr/share/mysql/mysql-test/suite/wsrep/t
+usr/share/mysql/mysql-test/suite/wsrep/r
--- /dev/null
+usr/share/mysql-test/* usr/lib/mysql-testsuite/
--- /dev/null
+# These are random occurrences of a pseudo word in a binary.
+mysql-testsuite-5.6: spelling-error-in-binary usr/bin/mysql_client_test_embedded yuR your
+mysql-testsuite-5.6: spelling-error-in-binary usr/bin/mysql_embedded yuR your
+mysql-testsuite-5.6: spelling-error-in-binary usr/bin/mysqltest_embedded yuR your
--- /dev/null
+From: Clint Byrum <clint@ubuntu.com>
+Description: makes mtr look in the standard location from the
+ mysql-testsuite-5.5 package.
+Forwarded: not-needed
+
+--- a/mysql-test/lib/mtr_cases.pm
++++ b/mysql-test/lib/mtr_cases.pm
+@@ -287,7 +287,8 @@ sub collect_one_suite($)
+ else
+ {
+ $suitedir= my_find_dir($::basedir,
+- ["share/mysql-test/suite",
++ ["lib/mysql-testsuite/suite",
++ "share/mysql-test/suite",
+ "mysql-test/suite",
+ "internal/mysql-test/suite",
+ "mysql-test",
--- /dev/null
+Author: Pino Toscano <pino@debian.org>
+Subject: cmake options for GNU/Hurd
+Bug: http://bugs.mysql.com/bug.php?id=64685
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=651002
+Last-Update: 2012-03-18
+Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
+--- /dev/null
++++ b/cmake/os/GNU.cmake
+@@ -0,0 +1,20 @@
++# This file includes GNU/Hurd specific options and quirks, related to system checks
++
++INCLUDE(CheckSymbolExists)
++
++SET(_GNU_SOURCE 1)
++
++# Fix CMake (< 2.8) flags. -rdynamic exports too many symbols.
++FOREACH(LANG C CXX)
++ STRING(REPLACE "-rdynamic" ""
++ CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS
++ "${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}"
++ )
++ENDFOREACH()
++
++# Ensure we have clean build for shared libraries
++# without unresolved symbols
++SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined")
++
++# 64 bit file offset support flag
++SET(_FILE_OFFSET_BITS 64)
+--- a/mysql-test/lib/My/Platform.pm
++++ b/mysql-test/lib/My/Platform.pm
+@@ -110,6 +110,9 @@ sub check_socket_path_length {
+ # This may not be true, but we can't test for it on AIX due to Perl bug
+ # See Bug #45771
+ return 0 if ($^O eq 'aix');
++ # Similarly the path length is hidden.
++ # See Debian bug #651002
++ return 0 if ($^O eq 'gnu');
+
+ require IO::Socket::UNIX;
+
--- /dev/null
+Author: Nicholas Bamber <nicholas@periapt.co.uk>
+Debian-Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=540153
+Subject: tests not getting started on kFreeBSD
+ As per #670722 I found that the test socket created to test
+ file name truncation was barfing even for the shortened form.
+Forwarded: no
+Last-Update: 2012-04-28
+--- a/mysql-test/lib/My/Platform.pm
++++ b/mysql-test/lib/My/Platform.pm
+@@ -113,6 +113,8 @@ sub check_socket_path_length {
+ # Similarly the path length is hidden.
+ # See Debian bug #651002
+ return 0 if ($^O eq 'gnu');
++ # See Debian bug #670722 - failing on kFreeBSD even after setting short path
++ return 0 if length $path < 40;
+
+ require IO::Socket::UNIX;
+
--- /dev/null
+Author: Christian Hammers <ch@debian.org>
+Subject: Executes /etc/init.d/mysql on signals
+ Note if you check the bug report on mysql.com the patch is accepted
+ as interesting but they were waiting on Christian Hammers to sign an SCA.
+ Meanwhile this bug report fell off in the transition from 5.0 to 5.1.
+Bug: http://bugs.mysql.com/bug.php?id=31361
+Debian-Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527623
+Last-Update: 2012-03-07
+Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
+
+--- a/scripts/mysqld_safe.sh
++++ b/scripts/mysqld_safe.sh
+@@ -29,9 +29,6 @@ err_log=
+ syslog_tag_mysqld=mysqld
+ syslog_tag_mysqld_safe=mysqld_safe
+
+-trap '' 1 2 3 15 # we shouldn't let anyone kill us
+-trap '' 13 # not even SIGPIPE
+-
+ # MySQL-specific environment variable. First off, it's not really a umask,
+ # it's the desired mode. Second, it follows umask(2), not umask(3) in that
+ # octal needs to be explicit. Our shell might be a proper sh without printf,
+@@ -154,7 +151,7 @@ eval_log_error () {
+ # sed buffers output (only GNU sed supports a -u (unbuffered) option)
+ # which means that messages may not get sent to syslog until the
+ # mysqld process quits.
+- cmd="$cmd 2>&1 | logger -t '$syslog_tag_mysqld' -p daemon.error"
++ cmd="$cmd 2>&1 | logger -t '$syslog_tag_mysqld' -p daemon.error & wait"
+ ;;
+ *)
+ echo "Internal program error (non-fatal):" \
+@@ -815,6 +815,13 @@ mysqld daemon not started"
+ fi
+
+ #
++# From now on, we catch signals to do a proper shutdown of mysqld
++# when signalled to do so.
++#
++trap '/usr/bin/mysqladmin --defaults-extra-file=/etc/mysql/debian.cnf refresh & wait' 1 # HUP
++trap '/usr/bin/mysqladmin --defaults-extra-file=/etc/mysql/debian.cnf shutdown' 2 3 15 # INT QUIT and TERM
++
++#
+ # Uncomment the following lines if you want all tables to be automatically
+ # checked and repaired during startup. You should add sensible key_buffer
+ # and sort_buffer values to my.cnf to improve check performance or require
--- /dev/null
+hurd.patch
+scripts__mysqld_safe.sh__signals.patch
+fix_standalone_tests.patch
+kfreebsd_tests.patch
--- /dev/null
+Author <nicholas@periapt.co.uk>
+Subject: spelling errors
+ Preceeding -> preceding
+Last-Update: 2012-05-19
+Forwarded: no
+--- a/libevent/event.3
++++ b/libevent/event.3
+@@ -253,7 +253,7 @@ the type of event which will be either
+ or
+ .Va EV_WRITE .
+ Additionally, an event which has registered interest in more than one of the
+-preceeding events, via bitwise-OR to
++preceding events, via bitwise-OR to
+ .Fn event_set ,
+ can provide its callback function with a bitwise-OR of more than one triggered
+ event.
+--- a/mysql-test/extra/rpl_tests/rpl_ddl.test
++++ b/mysql-test/extra/rpl_tests/rpl_ddl.test
+@@ -98,8 +98,8 @@
+ # --> less switching of AUTOCOMMIT mode on master side.
+ #
+ # 4. Never use a test object, which was direct or indirect affected by a
+-# preceeding test sequence again.
+-# If one preceeding test sequence hits a (sometimes not visible,
++# preceding test sequence again.
++# If one preceding test sequence hits a (sometimes not visible,
+ # because the sql error code of the statement might be 0) bug
+ # and these rules are ignored, a following test sequence might earn ugly
+ # effects like failing 'sync_slave_with_master', crashes of the slave or
+--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test
++++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test
+@@ -221,7 +221,7 @@ INSERT INTO t7 VALUES (1,3), (2,6), (3,9
+ SELECT * FROM t7 ORDER BY C1;
+
+ # since bug#31552/31609 idempotency is not default any longer. In order
+-# the preceeding test INSERT INTO t7 to pass the mode is switched
++# the preceding test INSERT INTO t7 to pass the mode is switched
+ # temprorarily
+ set @@global.slave_exec_mode= 'IDEMPOTENT';
+
+@@ -260,7 +260,7 @@ INSERT INTO t8 VALUES (1,2,3), (2,4,6),
+ SELECT * FROM t8 ORDER BY a;
+
+ # since bug#31552/31609 idempotency is not default any longer. In order
+-# the preceeding test INSERT INTO t8 to pass the mode is switched
++# the preceding test INSERT INTO t8 to pass the mode is switched
+ # temprorarily
+ set @@global.slave_exec_mode= 'IDEMPOTENT';
+
+--- a/mysql-test/include/wait_until_count_sessions.inc
++++ b/mysql-test/include/wait_until_count_sessions.inc
+@@ -10,7 +10,7 @@
+ # 1. We wait for $current_sessions <= $count_sessions because in the use case
+ # with count_sessions.inc before and wait_until_count_sessions.inc after
+ # the core of the test it could happen that the disconnects of sessions
+-# belonging to the preceeding test are not finished.
++# belonging to the preceding test are not finished.
+ # sessions at test begin($count_sessions) = m + n
+ # sessions of the previous test which will be soon disconnected = n (n >= 0)
+ # sessions at test end ($current sessions, assuming the test disconnects
+--- a/mysql-test/suite/funcs_1/views/func_view.inc
++++ b/mysql-test/suite/funcs_1/views/func_view.inc
+@@ -285,7 +285,7 @@ INSERT INTO t1_values SET
+ # other interesting value
+ # numbers -> 0
+ # strings, blobs, binaries -> not full length of used data type, "exotic"
+-# characters and preceeding and trailing spaces
++# characters and preceding and trailing spaces
+ # FIXME enum, set ??
+ INSERT INTO t1_values SET
+ my_char_30 = ' ---äÖüß@µ*$-- ',
+--- a/mysql-test/suite/funcs_1/views/views_master.inc
++++ b/mysql-test/suite/funcs_1/views/views_master.inc
+@@ -545,7 +545,7 @@ let $message= Testcase 3.3.1.7 ;
+ # view names are accepted, at creation time, alteration time,
+ # and drop time.
+ ###############################################################################
+-# Note(mleich): non-qualified view name means a view name without preceeding
++# Note(mleich): non-qualified view name means a view name without preceding
+ # database name
+ --disable_warnings
+ DROP VIEW IF EXISTS v1 ;
+--- a/mysql-test/suite/rpl/t/rpl_ddl.test
++++ b/mysql-test/suite/rpl/t/rpl_ddl.test
+@@ -13,10 +13,10 @@
+ # sequences start.
+ #
+ # 2. Never use a test object, which was direct or indirect affected by a
+-# preceeding test sequence again.
++# preceding test sequence again.
+ # Except table d1.t1 where ONLY DML is allowed.
+ #
+-# If one preceeding test sequence hits a (sometimes not good visible,
++# If one preceding test sequence hits a (sometimes not good visible,
+ # because the sql error code of the statement might be 0) bug
+ # and these rules are ignored, a following test sequence might earn ugly
+ # effects like failing 'sync_slave_with_master', crashes of the slave or
+--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
++++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
+@@ -239,7 +239,7 @@ INSERT INTO t1 VALUES (1,'master,slave')
+ UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1;
+ SELECT * FROM t1 ORDER BY a;
+ # since bug#31552/31609 idempotency is not default any longer. In
+-# order for the preceeding test UPDATE t1 to pass, the mode is switched
++# order for the preceding test UPDATE t1 to pass, the mode is switched
+ # temprorarily
+ set @@global.slave_exec_mode= 'IDEMPOTENT';
+ --echo **** On Master ****
+--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test
++++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test
+@@ -13,10 +13,10 @@
+ # sequences start.
+ #
+ # 2. Never use a test object, which was direct or indirect affected by a
+-# preceeding test sequence again.
++# preceding test sequence again.
+ # Except table d1.t1 where ONLY DML is allowed.
+ #
+-# If one preceeding test sequence hits a (sometimes not good visible,
++# If one preceding test sequence hits a (sometimes not good visible,
+ # because the sql error code of the statement might be 0) bug
+ # and these rules are ignored, a following test sequence might earn ugly
+ # effects like failing 'sync_slave_with_master', crashes of the slave or
+--- a/sql/abstract_query_plan.cc
++++ b/sql/abstract_query_plan.cc
+@@ -336,7 +336,7 @@ namespace AQP
+ {
+ /*
+ use_quick == 2 means that the decision on which access method to use
+- will be taken late (as rows from the preceeding operation arrive).
++ will be taken late (as rows from the preceding operation arrive).
+ This operation is therefor not pushable.
+ */
+ DBUG_PRINT("info",
+--- a/sql/ha_ndbcluster_push.cc
++++ b/sql/ha_ndbcluster_push.cc
+@@ -1271,7 +1271,7 @@ ndb_pushed_builder_ctx::build_key(const
+ if (m_join_scope.contain(referred_table_no))
+ {
+ // Locate the parent operation for this 'join_items[]'.
+- // May refer any of the preceeding parent tables
++ // May refer any of the preceding parent tables
+ const NdbQueryOperationDef* const parent_op= m_tables[referred_table_no].m_op;
+ DBUG_ASSERT(parent_op != NULL);
+
+--- a/sql/log_event.cc
++++ b/sql/log_event.cc
+@@ -4625,7 +4625,7 @@ int Query_log_event::do_apply_event(Rela
+ if ((error= rows_event_stmt_cleanup(const_cast<Relay_log_info*>(rli), thd)))
+ {
+ const_cast<Relay_log_info*>(rli)->report(ERROR_LEVEL, error,
+- "Error in cleaning up after an event preceeding the commit; "
++ "Error in cleaning up after an event preceding the commit; "
+ "the group log file/position: %s %s",
+ const_cast<Relay_log_info*>(rli)->get_group_master_log_name(),
+ llstr(const_cast<Relay_log_info*>(rli)->get_group_master_log_pos(),
+--- a/sql/rpl_utility.cc
++++ b/sql/rpl_utility.cc
+@@ -1564,7 +1564,7 @@ bool Deferred_log_events::execute(Relay_
+ void Deferred_log_events::rewind()
+ {
+ /*
+- Reset preceeding Query log event events which execution was
++ Reset preceding Query log event events which execution was
+ deferred because of slave side filtering.
+ */
+ if (!is_empty())
+--- a/sql/sql_optimizer.cc
++++ b/sql/sql_optimizer.cc
+@@ -971,7 +971,7 @@ JOIN::optimize()
+ }
+ }
+ }
+- else if (order && // ORDER BY wo/ preceeding GROUP BY
++ else if (order && // ORDER BY wo/ preceding GROUP BY
+ (simple_order || skip_sort_order)) // which is possibly skippable
+ {
+ if (test_if_skip_sort_order(tab, order, m_select_limit, false,
+--- a/sql/sql_rewrite.cc
++++ b/sql/sql_rewrite.cc
+@@ -40,7 +40,7 @@
+
+
+ /**
+- Append a key/value pair to a string, with an optional preceeding comma.
++ Append a key/value pair to a string, with an optional preceding comma.
+ For numeric values.
+
+ @param str The string to append to
+@@ -72,7 +72,7 @@ bool append_int(String *str, bool comma,
+
+ /**
+ Append a key/value pair to a string if the value is non-NULL,
+- with an optional preceeding comma.
++ with an optional preceding comma.
+
+ @param str The string to append to
+ @param comma Prepend a comma?
+--- a/sql/sql_yacc.cc
++++ b/sql/sql_yacc.cc
+@@ -35151,7 +35151,7 @@ yyreduce:
+ {
+ /*
+ Not in trigger assigning value to new row,
+- and option_type preceeding local variable is illegal.
++ and option_type preceding local variable is illegal.
+ */
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+--- a/sql/sql_yacc.yy
++++ b/sql/sql_yacc.yy
+@@ -14573,7 +14573,7 @@ opt_var_ident_type:
+ | SESSION_SYM '.' { $$=OPT_SESSION; }
+ ;
+
+-// Option values with preceeding option_type.
++// Option values with preceding option_type.
+ option_value_following_option_type:
+ internal_variable_name equal set_expr_or_default
+ {
+@@ -14590,7 +14590,7 @@ option_value_following_option_type:
+ {
+ /*
+ Not in trigger assigning value to new row,
+- and option_type preceeding local variable is illegal.
++ and option_type preceding local variable is illegal.
+ */
+ my_parse_error(ER(ER_SYNTAX_ERROR));
+ MYSQL_YYABORT;
+@@ -14598,7 +14598,7 @@ option_value_following_option_type:
+ }
+ ;
+
+-// Option values without preceeding option_type.
++// Option values without preceding option_type.
+ option_value_no_option_type:
+ internal_variable_name equal
+ {
+--- a/storage/myisam/mi_rnext.c
++++ b/storage/myisam/mi_rnext.c
+@@ -65,7 +65,7 @@ int mi_rnext(MI_INFO *info, uchar *buf,
+ Normally SQL layer would never request "search next" if
+ "search first" failed. But HANDLER may do anything.
+
+- As mi_rnext() without preceeding mi_rkey()/mi_rfirst()
++ As mi_rnext() without preceding mi_rkey()/mi_rfirst()
+ equals to mi_rfirst(), we must restore original state
+ as if failing mi_rfirst() was not called.
+ */
--- /dev/null
+[type: gettext/rfc822deb] mysql-wsrep-server-5.6.templates
--- /dev/null
+# 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 لن يكونوا قادرين على الاتصال باستخدام "
+#~ "الحسابات الحديثة أو الحسابات التي تم تغيير كلمة مرورها."
--- /dev/null
+# 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/."
--- /dev/null
+#
+# 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?"
--- /dev/null
+# 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/."
--- /dev/null
+# 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/."
--- /dev/null
+# 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."
--- /dev/null
+# 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:"
--- /dev/null
+# 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 »."
--- /dev/null
+# 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."
--- /dev/null
+# 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/."
--- /dev/null
+#
+# 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」"
+"で始まる行を削除してください。"
--- /dev/null
+# 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)."
--- /dev/null
+# 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/."
--- /dev/null
+# 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)."
--- /dev/null
+# 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."
--- /dev/null
+# 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)."
--- /dev/null
+# 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/."
--- /dev/null
+# 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”."
--- /dev/null
+# 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:"
--- /dev/null
+# 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 ""
--- /dev/null
+# 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."
--- /dev/null
+#!/usr/bin/make -f
+
+export DH_VERBOSE=1
+
+# enable Debian Hardening
+# see: https://wiki.debian.org/Hardening
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/buildflags.mk
+
+ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+ARCH_OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
+BUILDDIR := builddir
+BUILDDIR_PIC := builddir-pic
+builddir = $(if $(findstring -pic,$@),$(BUILDDIR_PIC),$(BUILDDIR))
+DEBVERSION := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | sed 's/^.*-//' )
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_SOURCE_PACKAGE ?= $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':'))
+DEB_VERSION ?= $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
+DEB_NOEPOCH_VERSION ?= $(shell echo $(DEB_VERSION) | cut -d: -f2-)
+DEB_UPSTREAM_VERSION ?= $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
+DEB_UPSTREAM_VERSION_MAJOR_MINOR := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -r -n 's/^([0-9]+\.[0-9]+).*/\1/p')
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+DISTRIBUTION := $(shell lsb_release -i -s)
+EXPORTED_SOURCE_TARBALL := debian/mysql-source-5.6.tar.gz
+TESTSUITE_FAIL_CMD:=true
+TMP := $(CURDIR)/debian/tmp/
+USE_ASSEMBLER:=--enable-assembler
+
+
+export MYSQL_BUILD_CC=$(DEB_HOST_GNU_TYPE)-gcc
+export MYSQL_BUILD_CXX=$(DEB_HOST_GNU_TYPE)-g++
+
+
+ifneq (,$(filter $(ARCH), i386 kfreebsd-i386 hurd-i386))
+ TAOCRYPT_OPT="-DTAOCRYPT_DISABLE_X86ASM"
+endif
+
+# make test-bt is the testsuite run by the MySQL build team
+# before a release, but it is long
+MAKE_TEST_TARGET:=test-mtr
+ifneq ($(findstring fulltest,$(DEB_BUILD_OPTIONS)),)
+ MAKE_TEST_TARGET:=test-bt
+endif
+ifeq ($(ARCH_OS),hurd)
+# Tests not fully working under Hurd
+# See http://bugs.mysql.com/bug.php?id=64685
+ MAKE_TEST_TARGET:=test
+endif
+
+
+# This causes seg11 crashes if LDAP is used for groups in /etc/nsswitch.conf
+# so it is disabled by default although, according to MySQL, it brings >10%
+# performance gain if enabled. See #299382.
+ifeq ($(STATIC_MYSQLD), 1)
+ USE_STATIC_MYSQLD:=--with-mysqld-ldflags=-all-static
+endif
+
+override_dh_auto_clean:
+ @echo "RULES.$@"
+ dh_testdir
+ dh_testroot
+ [ ! -d mysql-test/var ] || rm -rf mysql-test/var
+ rm -rf $(BUILDDIR) $(BUILDDIR_PIC) .pc
+ debconf-updatepo
+ rm -f $(EXPORTED_SOURCE_TARBALL)
+ rm -f cmake/os/GNU.cmake
+
+override_dh_prep:
+
+override_dh_auto_configure: configure-stamp
+
+configure-pic-stamp: FORCE_FPIC_CFLAGS=-fPIC
+configure-pic-stamp: FORCE_FPIC=-DWITH_PIC=On
+
+configure-stamp configure-pic-stamp:
+ @echo "RULES.$@"
+ dh_testdir
+ ( test -d $(builddir) || mkdir $(builddir) ) && cd $(builddir) && \
+ sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/usr/local/bin:/usr/bin:/bin"} \
+ CC=$${MYSQL_BUILD_CC:-gcc} \
+ CFLAGS=$${MYSQL_BUILD_CFLAGS:-"-O2 -DBIG_JOINS=1 ${FORCE_FPIC_CFLAGS} -fno-strict-aliasing ${TAOCRYPT_OPT}"} \
+ CXX=$${MYSQL_BUILD_CXX:-g++} \
+ CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O3 -DBIG_JOINS=1 -felide-constructors -fpermissive ${FORCE_FPIC_CFLAGS} -fno-strict-aliasing ${TAOCRYPT_OPT}"} \
+ cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_VERBOSE_MAKEFILE=ON \
+ $(FORCE_FPIC) \
+ -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DWITH_WSREP=1 \
+ -DWITH_LIBWRAP=ON \
+ -DWITH_ZLIB=system \
+ -DWITH_EDITLINE=system \
+ $(USE_STATIC_MYSQLD) \
+ -DWITH_SSL=system \
+ -DCOMPILATION_COMMENT="($(DISTRIBUTION))" \
+ -DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \
+ -DSYSTEM_TYPE="debian-$(DEB_BUILD_GNU_SYSTEM)" \
+ -DINSTALL_LAYOUT=RPM \
+ -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
+ -DINSTALL_PLUGINDIR=lib/mysql/plugin \
+ -DWITH_EMBEDDED_SERVER=ON \
+ -DWITH_ARCHIVE_STORAGE_ENGINE=ON \
+ -DWITH_BLACKHOLE_STORAGE_ENGINE=ON \
+ -DWITH_FEDERATED_STORAGE_ENGINE=ON \
+ -DWITH_EXTRA_CHARSETS=all ..'
+ touch $@
+
+override_dh_auto_build: build-stamp
+
+build-stamp:
+ @echo "RULES.$@"
+ [ -f $(EXPORTED_SOURCE_TARBALL) ] || tar -zcf $(EXPORTED_SOURCE_TARBALL) \
+ --exclude=debian . \
+ --transform="s,^\./,mysql-5.6/,"
+ cd $(builddir) && $(MAKE)
+ touch $@
+
+build-pic-stamp:
+ # Don't call this section from dh_auto_build as
+ # linmysqld does not exsist in mysql-wsrep
+ @echo "RULES.$@"
+ cd $(builddir) && $(MAKE) -C scripts
+ cd $(builddir) && $(MAKE) -C libmysqld
+ touch $@
+
+override_dh_auto_test:
+ @echo "RULES.$@"
+ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),)
+ cp unittest/unit.pl $(builddir)/unittest/
+ cp -r mysql-test/* $(builddir)/mysql-test/
+ cp -r sql/share/* $(builddir)/sql/share/
+ cp -r scripts/*sql $(builddir)/scripts/
+ cd $(builddir) && $(MAKE) $(MAKE_TEST_TARGET) || $(TESTSUITE_FAIL_CMD) ;
+endif
+
+override_dh_auto_install: auto_install-stamp
+
+auto_install-stamp:
+ @echo "RULES.$@"
+ dh_testdir
+ dh_testroot
+ # make install (trailing slash needed for innobase)
+ cd $(builddir) && $(MAKE) install DESTDIR=$(TMP)/
+ # install libmysqld built with -FPIC
+ install -d -m 0755 -o root -g root $(TMP)/usr/lib/mysql
+ # linmysqld does not exsist in mysql-wsrep
+ # install -m 0644 -o root -g root $(BUILDDIR_PIC)/libmysqld/libmysqld.a $(TMP)/usr/lib/mysql/libmysqld_pic.a
+ ## mysql_config won't report the -fPIC, so give libmysqld-pic users a way to get their flags
+ # install -m 0755 -o root -g root $(BUILDDIR_PIC)/scripts/mysql_config $(TMP)/usr/bin/mysql_config_pic
+ mkdir -p $(TMP)/usr/share/doc/mysql-server-5.6
+ install -m 0644 Docs/README-wsrep $(TMP)/usr/share/doc/mysql-server-5.6
+ nm -n $(BUILDDIR)/sql/mysqld |gzip -9 > $(TMP)/usr/share/doc/mysql-server-5.6/mysqld.sym.gz
+ install -m 0644 support-files/wsrep.cnf $(TMP)/usr/share/mysql
+ # This seems to be the only safe place to fix permissions issues
+ # not handled by dh_fixperms.
+ mkdir -p $(TMP)/etc/mysql/conf.d/
+ touch $(TMP)/etc/mysql/conf.d/.keepme
+ install -D -m 0755 $(builddir)/support-files/mysql.server $(TMP)/etc/init.d/mysql
+ install -m 0755 debian/additions/echo_stderr $(TMP)/usr/share/mysql/
+ install -m 0755 debian/additions/debian-start $(TMP)/etc/mysql/
+ install -m 0755 debian/additions/debian-start.inc.sh $(TMP)/usr/share/mysql/
+ install -m 0644 debian/additions/mysql_config_pic.1 $(TMP)/usr/share/man/man1
+ install -m 0644 debian/additions/mysql_embedded.1 $(TMP)/usr/share/man/man1
+ install -m 0644 debian/additions/debian_create_root_user.sql $(TMP)/usr/share/mysql/
+ # install AppArmor profile
+ install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mysqld
+ chmod 0755 $(TMP)/usr/share/mysql-test/std_data/checkDBI_DBD-mysql.pl
+ # install Apport hook
+ install -D -m 644 debian/mysql-server-5.6.py $(TMP)/usr/share/apport/package-hooks/source_mysql-5.6.py
+ # chmod 0644 $(TMP)/usr/share/mysql/*.ini
+ chmod 0644 $(TMP)/usr/bin/mysqlaccess.conf
+ touch $@
+
+# Use the --fail-missing to check for stuff that we should be installing
+# Exclusion Package Type
+# usr/share/man/ various man
+# usr/share/mysql/magic M-server-5.6 example
+# usr/bin/mysqlaccess.conf M-client-5.6 example
+# usr/lib/mysql/plugin/daemon_example.ini M-server-5.6 example
+# usr/share/mysql/my- M-server-5.6 example
+# The following exclusions have been inherited from pre short form
+# debian/rules days.
+# usr/share/mysql/mi_test_all
+# usr/share/mysql/mysql-log-rotate
+# usr/share/mysql/mysql.server
+# usr/share/mysql/binary-configure
+# NOTE(james-page) usr/include -> end can be dropped when 5.6 becomes default
+# NOTE(james-page) skip --fail-missing until package is complete 5.5 replacement
+#override_dh_install:
+# dh_install --fail-missing \
+# -Xusr/share/man/ \
+# -Xusr/share/info/mysql.info \
+# -Xusr/share/mysql/magic \
+# -Xusr/share/mysql/solaris/postinstall-solaris \
+# -Xusr/lib/mysql/plugin/daemon_example.ini \
+# -Xusr/bin/mysqlaccess.conf \
+# -Xusr/share/mysql/mi_test_all \
+# -Xusr/share/mysql/mysql-log-rotate \
+# -Xusr/share/mysql/mysql.server \
+# -Xusr/share/mysql/binary-configure \
+# -Xusr/share/mysql/my- \
+# -Xusr/include \
+# -Xusr/bin/mysql_config \
+# -Xusr/share/aclocal/mysql.m4 \
+# -Xlibmysql
+
+override_dh_installlogrotate-arch:
+ dh_installlogrotate --name mysql-server
+ dh_apparmor -pmysql-server-5.6 --profile-name=usr.sbin.mysqld
+
+# Start mysql in runlevel 19 before 20 where apache, proftpd etc gets
+# started which might depend on a running database server.
+override_dh_installinit-arch:
+ dh_installinit --name=mysql -- defaults 19 21
+
+override_dh_installcron-arch:
+ dh_installcron --name mysql-server
+
+override_dh_strip:
+ @echo "Notice: not stripping debug symbols from any binaries"
+
+binary: binary-indep binary-arch
+
+get-orig-source:
+ uscan --force-download --verbose
+
+%:
+ dh $@ --parallel
--- /dev/null
+# The mysql-server-5.6.postrm script handles
+# what debhelper normally would.
+# This is apparently related to #526464.
+maintainer-script-lacks-debhelper-token debian/mysql-server-5.6.postrm
+# Probably best to keep the debhelper version low in
+# case someone needs to backport
+package-needs-versioned-debhelper-build-depends 9
--- /dev/null
+3.0 (quilt)
--- /dev/null
+#!/bin/sh
+# autopkgtest check: Build and run a program against libmysqlclient, to verify that the
+# headers and pkg-config file are installed correctly
+# (C) 2012 Canonical Ltd.
+# Author: Daniel Kessel <d.kessel@gmx.de>
+
+echo "test 'build' starting"
+set -e
+
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+
+cat <<EOF > libmysqltest.c
+#include <stdio.h>
+#include <mysql.h>
+
+int main()
+{
+ if (mysql_library_init(0, NULL, NULL)) {
+ fprintf(stderr, "failed to initialize mysql client library\n");
+ return 1;
+ }
+
+ mysql_library_end();
+ return 0;
+}
+EOF
+
+echo "building..."
+gcc -o libmysqltest libmysqltest.c `/usr/bin/mysql_config --cflags --libs` -Wall -Werror
+echo "build: OK"
+[ -x libmysqltest ]
+./libmysqltest
+echo "run: OK"
--- /dev/null
+Tests: smoke upstream
+Depends: mysql-testsuite-5.6
+Restrictions: allow-stderr needs-root breaks-testbed
--- /dev/null
+#!/bin/sh
+set -ex
+
+# dep8 smoke test for mysql-server
+# Author: Robie Basak <robie.basak at canonical.com>
+#
+# This test should be declared in debian/tests/control with a dependency
+# on the package that provides a configured MySQL server (eg.
+# mysql-server-5.6).
+#
+# This test should be declared in debian/tests/control with the
+# following restrictions:
+#
+# needs-root (needed to reset the root mysql password)
+# breaks-testbed (because it resets the root mysql password)
+# allow-stderr
+#
+# This test:
+#
+# 1) Configures packaged mysql server root password with maintainer
+# scripts.
+#
+# 2) Creates a test database and test user as the root user.
+#
+# 3) Creates a test table and checks it appears to operate normally
+# using the test user and test database.
+
+debconf-set-selections <<EOT
+mysql-server-5.6 mysql-server/root_password password rootpassword
+mysql-server-5.6 mysql-server/root_password_again password rootpassword
+EOT
+
+DEBIAN_FRONTEND=noninteractive dpkg-reconfigure mysql-server-5.6
+
+mysql --user=root --password=rootpassword <<EOT
+CREATE DATABASE testdatabase;
+CREATE USER 'testuser'@'localhost' identified by 'testpassword';
+GRANT ALL ON testdatabase.* TO 'testuser'@'localhost';
+EOT
+
+mysql --user=testuser --password=testpassword testdatabase <<EOT
+CREATE TABLE foo (bar INTEGER);
+INSERT INTO foo (bar) VALUES (41);
+EOT
+
+result=`echo 'SELECT bar+1 FROM foo;'|mysql --batch --skip-column-names --user=testuser --password=testpassword testdatabase`
+if [ "$result" != "42" ]; then
+ echo "Unexpected result" >&2
+ exit 1
+fi
+
+mysql --user=testuser --password=testpassword testdatabase <<EOT
+DROP TABLE foo;
+EOT
+
+mysql --user=root --password=rootpassword <<EOT
+DROP DATABASE testdatabase;
+DROP USER 'testuser'@'localhost';
+EOT
--- /dev/null
+#!/bin/sh
+# autopkgtest check: Build and run the upstream test suite.
+# (C) 2012 Canonical Ltd.
+# Author: Daniel Kessel <d.kessel@gmx.de>
+
+# running the mysql testsuite as described in:
+# https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/959683
+
+echo "running test 'testsuite'"
+set -e
+
+SKIP_TEST_LST="/tmp/skip-test.lst"
+WORKDIR=$(mktemp -d)
+trap "rm -rf $WORKDIRi $SKIP_TEST_LST" 0 INT QUIT ABRT PIPE TERM
+cd $WORKDIR
+
+mkdir var
+mkdir tmp
+
+echo "using vardir: $WORKDIR/var"
+echo "using tmpdir: $WORKDIR/tmp"
+
+echo "Setting up skip-tests-list"
+cat > $SKIP_TEST_LST << EOF
+binlog.binlog_server_start_options : Requires writable /usr
+main.ctype_uca : Requires writable /usr
+EOF
+
+cd /usr/lib/mysql-testsuite
+echo "starting mysql-test-tun.pl..."
+./mysql-test-run.pl --force --vardir=$WORKDIR/var --tmpdir=$WORKDIR/tmp \
+ --comment=normal --timer --skip-ndbcluster --report-features \
+ --skip-test-list=$SKIP_TEST_LST $@ 2>&1
+echo "run: OK"
--- /dev/null
+# See debian/README.source for more information about the DFSG repacking here.
+version=3
+http://mysql.mirrors.pair.com/Downloads/MySQL-5.6/mysql-([\d\.]+).tar.gz
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__ ((unused)),
- char *argument __attribute__ ((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE ((unused)),
+ char *argument MY_ATTRIBUTE ((unused)))
{
DBUG_ENTER("get_one_option");
switch (optid) {
/*
- Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
innochecksum_get_one_option(
/*========================*/
int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
case 'd':
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
case 'c':
org_argv= argv;
args_used= get_defaults_options(argc, argv, &defaults, &extra_defaults,
- &group_suffix, &login_path);
+ &group_suffix, &login_path, FALSE);
/* Copy defaults-xxx arguments & program name */
count=args_used+1;
-/* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
};
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch(optid) {
case 'V':
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
case 's':
-/* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static std::vector<sym_entry> sym_table;
static FILE* fp_dump, *fp_sym = 0, *fp_out;
static void die(const char* fmt, ...)
- __attribute__((noreturn)) __attribute__((format(printf, 1, 2)));
+ MY_ATTRIBUTE((noreturn)) MY_ATTRIBUTE((format(printf, 1, 2)));
static struct my_option my_long_options[] =
{
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch(optid) {
case 'V':
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
case 'V': print_version(); exit(0);
*** end Note ***
+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
+ the same CPU core cache could exploit. VM users, hyper-threading users,
+ and users where potential attackers have access to the CPU cache will need
+ to update if they utilize AES.
+
+ DSA padding fixes for unusual sizes is included as well. Users with DSA
+ certficiates should update.
+
+yaSSL Release notes, version 2.4.0 (5/20/2016)
+ This release of yaSSL fixes the OpenSSL compatibility function
+ SSL_CTX_load_verify_locations() when using the path directory to allow
+ unlimited path sizes. Minor Windows build fixes are included.
+ No high level security fixes in this version but we always recommend
+ updating.
+
+
yaSSL Release notes, version 2.3.9b (2/03/2016)
This release of yaSSL fixes the OpenSSL compatibility function
X509_NAME_get_index_by_NID() to use the actual index of the common name
-----BEGIN CERTIFICATE-----
-MIIDqzCCA2ugAwIBAgIJAMGqrgDU6DyhMAkGByqGSM44BAMwgY4xCzAJBgNVBAYT
+MIIDrzCCA2+gAwIBAgIJAK1zRM7YFcNjMAkGByqGSM44BAMwgZAxCzAJBgNVBAYT
AlVTMQ8wDQYDVQQIDAZPcmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQK
-DAd3b2xmU1NMMRAwDgYDVQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wu
-Y29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wuY29tMB4XDTEzMDQyMjIw
-MDk0NFoXDTE2MDExNzIwMDk0NFowgY4xCzAJBgNVBAYTAlVTMQ8wDQYDVQQIDAZP
-cmVnb24xETAPBgNVBAcMCFBvcnRsYW5kMRAwDgYDVQQKDAd3b2xmU1NMMRAwDgYD
-VQQLDAd0ZXN0aW5nMRYwFAYDVQQDDA13d3cueWFzc2wuY29tMR8wHQYJKoZIhvcN
-AQkBFhBpbmZvQHdvbGZzc2wuY29tMIIBuDCCASwGByqGSM44BAEwggEfAoGBAL1R
-7koy4IrH6sbh6nDEUUPPKgfhxxLCWCVexF2+qzANEr+hC9M002haJXFOfeS9DyoO
-WFbL0qMZOuqv+22CaHnoUWl7q3PjJOAI3JH0P54ZyUPuU1909RzgTdIDp5+ikbr7
-KYjnltL73FQVMbjTZQKthIpPn3MjYcF+4jp2W2zFAhUAkcntYND6MGf+eYzIJDN2
-L7SonHUCgYEAklpxErfqznIZjVvqqHFaq+mgAL5J8QrKVmdhYZh/Y8z4jCjoCA8o
-TDoFKxf7s2ZzgaPKvglaEKiYqLqic9qY78DYJswzQMLFvjsF4sFZ+pYCBdWPQI4N
-PgxCiznK6Ce+JH9ikSBvMvG+tevjr2UpawDIHX3+AWYaZBZwKADAaboDgYUAAoGB
-AJ3LY89yHyvQ/TsQ6zlYbovjbk/ogndsMqPdNUvL4RuPTgJP/caaDDa0XJ7ak6A7
-TJ+QheLNwOXoZPYJC4EGFSDAXpYniGhbWIrVTCGe6lmZDfnx40WXS0kk3m/DHaC0
-3ElLAiybxVGxyqoUfbT3Zv1JwftWMuiqHH5uADhdXuXVo1AwTjAdBgNVHQ4EFgQU
-IJjk416o4v8qpH9LBtXlR9v8gccwHwYDVR0jBBgwFoAUIJjk416o4v8qpH9LBtXl
-R9v8gccwDAYDVR0TBAUwAwEB/zAJBgcqhkjOOAQDAy8AMCwCFCjGKIdOSV12LcTu
-k08owGM6YkO1AhQe+K173VuaO/OsDNsxZlKpyH8+1g==
+DAd3b2xmU1NMMRAwDgYDVQQLDAd0ZXN0aW5nMRgwFgYDVQQDDA93d3cud29sZnNz
+bC5jb20xHzAdBgkqhkiG9w0BCQEWEGluZm9Ad29sZnNzbC5jb20wHhcNMTYwOTIy
+MjEyMzA0WhcNMjIwMzE1MjEyMzA0WjCBkDELMAkGA1UEBhMCVVMxDzANBgNVBAgM
+Bk9yZWdvbjERMA8GA1UEBwwIUG9ydGxhbmQxEDAOBgNVBAoMB3dvbGZTU0wxEDAO
+BgNVBAsMB3Rlc3RpbmcxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqG
+SIb3DQEJARYQaW5mb0B3b2xmc3NsLmNvbTCCAbgwggEsBgcqhkjOOAQBMIIBHwKB
+gQC9Ue5KMuCKx+rG4epwxFFDzyoH4ccSwlglXsRdvqswDRK/oQvTNNNoWiVxTn3k
+vQ8qDlhWy9KjGTrqr/ttgmh56FFpe6tz4yTgCNyR9D+eGclD7lNfdPUc4E3SA6ef
+opG6+ymI55bS+9xUFTG402UCrYSKT59zI2HBfuI6dltsxQIVAJHJ7WDQ+jBn/nmM
+yCQzdi+0qJx1AoGBAJJacRK36s5yGY1b6qhxWqvpoAC+SfEKylZnYWGYf2PM+Iwo
+6AgPKEw6BSsX+7Nmc4Gjyr4JWhComKi6onPamO/A2CbMM0DCxb47BeLBWfqWAgXV
+j0CODT4MQos5yugnviR/YpEgbzLxvrXr469lKWsAyB19/gFmGmQWcCgAwGm6A4GF
+AAKBgQCdy2PPch8r0P07EOs5WG6L425P6IJ3bDKj3TVLy+Ebj04CT/3Gmgw2tFye
+2pOgO0yfkIXizcDl6GT2CQuBBhUgwF6WJ4hoW1iK1UwhnupZmQ358eNFl0tJJN5v
+wx2gtNxJSwIsm8VRscqqFH2092b9ScH7VjLoqhx+bgA4XV7l1aNQME4wHQYDVR0O
+BBYEFCCY5ONeqOL/KqR/SwbV5Ufb/IHHMB8GA1UdIwQYMBaAFCCY5ONeqOL/KqR/
+SwbV5Ufb/IHHMAwGA1UdEwQFMAMBAf8wCQYHKoZIzjgEAwMvADAsAhQRYSCVN/Ge
+agV3mffU3qNZ92fI0QIUPH7Jp+iASI7U1ocaYDc10qXGaGY=
-----END CERTIFICATE-----
#include "rsa.h"
-#define YASSL_VERSION "2.3.9b"
+#define YASSL_VERSION "2.4.2"
#if defined(__cplusplus)
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
time_t clicks = time(0);
char timeStr[32];
+ memset(timeStr, 0, sizeof(timeStr));
// get rid of newline
strncpy(timeStr, ctime(&clicks), sizeof(timeStr));
unsigned int len = strlen(timeStr);
TaoCrypt::DSA_PrivateKey dsaKey;
dsaKey.Initialize(dsaSource);
- if (rsaSource.GetError().What()) {
+ if (dsaSource.GetError().What()) {
// neither worked
ret = SSL_FAILURE;
}
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
- char name[MAX_PATH + 1]; // directory specification
- strncpy(name, path, MAX_PATH - 3);
- strncat(name, "\\*", 3);
+ const int DELIMITER_SZ = 2;
+ const int DELIMITER_STAR_SZ = 3;
+ int pathSz = (int)strlen(path);
+ int nameSz = pathSz + DELIMITER_STAR_SZ + 1; // plus 1 for terminator
+ char* name = NEW_YS char[nameSz]; // directory specification
+ memset(name, 0, nameSz);
+ strncpy(name, path, nameSz - DELIMITER_STAR_SZ - 1);
+ strncat(name, "\\*", DELIMITER_STAR_SZ);
hFind = FindFirstFile(name, &FindFileData);
- if (hFind == INVALID_HANDLE_VALUE) return SSL_BAD_PATH;
+ if (hFind == INVALID_HANDLE_VALUE) {
+ ysArrayDelete(name);
+ return SSL_BAD_PATH;
+ }
do {
- if (FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) {
- strncpy(name, path, MAX_PATH - 2 - HALF_PATH);
- strncat(name, "\\", 2);
- strncat(name, FindFileData.cFileName, HALF_PATH);
+ if (!(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
+ int curSz = (int)strlen(FindFileData.cFileName);
+ if (pathSz + curSz + DELIMITER_SZ + 1 > nameSz) {
+ ysArrayDelete(name);
+ // plus 1 for terminator
+ nameSz = pathSz + curSz + DELIMITER_SZ + 1;
+ name = NEW_YS char[nameSz];
+ }
+ memset(name, 0, nameSz);
+ strncpy(name, path, nameSz - curSz - DELIMITER_SZ - 1);
+ strncat(name, "\\", DELIMITER_SZ);
+ strncat(name, FindFileData.cFileName,
+ nameSz - pathSz - DELIMITER_SZ - 1);
ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA);
}
} while (ret == SSL_SUCCESS && FindNextFile(hFind, &FindFileData));
+ ysArrayDelete(name);
FindClose(hFind);
#else // _WIN32
-
- const int MAX_PATH = 260;
-
DIR* dir = opendir(path);
if (!dir) return SSL_BAD_PATH;
struct dirent* entry;
struct stat buf;
- char name[MAX_PATH + 1];
+ const int DELIMITER_SZ = 1;
+ int pathSz = (int)strlen(path);
+ int nameSz = pathSz + DELIMITER_SZ + 1; //plus 1 for null terminator
+ char* name = NEW_YS char[nameSz]; // directory specification
while (ret == SSL_SUCCESS && (entry = readdir(dir))) {
- strncpy(name, path, MAX_PATH - 1 - HALF_PATH);
- strncat(name, "/", 1);
- strncat(name, entry->d_name, HALF_PATH);
+ int curSz = (int)strlen(entry->d_name);
+ if (pathSz + curSz + DELIMITER_SZ + 1 > nameSz) {
+ ysArrayDelete(name);
+ nameSz = pathSz + DELIMITER_SZ + curSz + 1;
+ name = NEW_YS char[nameSz];
+ }
+ memset(name, 0, nameSz);
+ strncpy(name, path, nameSz - curSz - 1);
+ strncat(name, "/", DELIMITER_SZ);
+ strncat(name, entry->d_name, nameSz - pathSz - DELIMITER_SZ - 1);
+
if (stat(name, &buf) < 0) {
+ ysArrayDelete(name);
closedir(dir);
return SSL_BAD_STAT;
}
ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA);
}
+ ysArrayDelete(name);
closedir(dir);
#endif
-# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
+
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL
${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include)
include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp
include/rabbit.hpp include/hc128.hpp)
+# Segfaults with SIGILL at high optimization levels in:
+# ModularArithmetic::SimultaneousExponentiate
+IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
+ IF(CMAKE_CXX_FLAGS MATCHES "-std=")
+ ADD_COMPILE_FLAGS(src/integer.cpp COMPILE_FLAGS "-xO1")
+ ENDIF()
+ENDIF()
+
IF(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION)
SET(TAOCRYPT_SOURCES ${TAOCRYPT_SOURCES} src/template_instnt.cpp)
ENDIF()
static const word32 Te[5][256];
static const word32 Td[5][256];
+ static const byte CTd4[256];
static const word32* Te0;
static const word32* Te1;
void ProcessAndXorBlock(const byte*, const byte*, byte*) const;
+ word32 PreFetchTe() const;
+ word32 PreFetchTd() const;
+ word32 PreFetchCTd4() const;
+
AES(const AES&); // hide copy
AES& operator=(const AES&); // and assign
};
+#if defined(__x86_64__) || defined(_M_X64) || \
+ (defined(__ILP32__) && (__ILP32__ >= 1))
+ #define TC_CACHE_LINE_SZ 64
+#else
+ /* default cache line size */
+ #define TC_CACHE_LINE_SZ 32
+#endif
+
+inline word32 AES::PreFetchTe() const
+{
+ word32 x = 0;
+
+ /* 4 tables of 256 entries */
+ for (int i = 0; i < 4; i++) {
+ /* each entry is 4 bytes */
+ for (int j = 0; j < 256; j += TC_CACHE_LINE_SZ/4) {
+ x &= Te[i][j];
+ }
+ }
+
+ return x;
+}
+
+
+inline word32 AES::PreFetchTd() const
+{
+ word32 x = 0;
+
+ /* 4 tables of 256 entries */
+ for (int i = 0; i < 4; i++) {
+ /* each entry is 4 bytes */
+ for (int j = 0; j < 256; j += TC_CACHE_LINE_SZ/4) {
+ x &= Td[i][j];
+ }
+ }
+
+ return x;
+}
+
+
+inline word32 AES::PreFetchCTd4() const
+{
+ word32 x = 0;
+ int i;
+
+ for (i = 0; i < 256; i += TC_CACHE_LINE_SZ) {
+ x &= CTd4[i];
+ }
+
+ return x;
+}
+
+
typedef BlockCipher<ENCRYPTION, AES, ECB> AES_ECB_Encryption;
typedef BlockCipher<DECRYPTION, AES, ECB> AES_ECB_Decryption;
+#ifdef _WIN32
+ #undef max // avoid name clash
+#endif
// general MAX
template<typename T> inline
const T& max(const T& a, const T& b)
{
temp = rk[3];
rk[4] = rk[0] ^
- (Te4[GETBYTE(temp, 2)] & 0xff000000) ^
- (Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^
- (Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^
- (Te4[GETBYTE(temp, 3)] & 0x000000ff) ^
+ (Te2[GETBYTE(temp, 2)] & 0xff000000) ^
+ (Te3[GETBYTE(temp, 1)] & 0x00ff0000) ^
+ (Te0[GETBYTE(temp, 0)] & 0x0000ff00) ^
+ (Te1[GETBYTE(temp, 3)] & 0x000000ff) ^
rcon_[i];
rk[5] = rk[1] ^ rk[4];
rk[6] = rk[2] ^ rk[5];
{
temp = rk[ 5];
rk[ 6] = rk[ 0] ^
- (Te4[GETBYTE(temp, 2)] & 0xff000000) ^
- (Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^
- (Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^
- (Te4[GETBYTE(temp, 3)] & 0x000000ff) ^
+ (Te2[GETBYTE(temp, 2)] & 0xff000000) ^
+ (Te3[GETBYTE(temp, 1)] & 0x00ff0000) ^
+ (Te0[GETBYTE(temp, 0)] & 0x0000ff00) ^
+ (Te1[GETBYTE(temp, 3)] & 0x000000ff) ^
rcon_[i];
rk[ 7] = rk[ 1] ^ rk[ 6];
rk[ 8] = rk[ 2] ^ rk[ 7];
{
temp = rk[ 7];
rk[ 8] = rk[ 0] ^
- (Te4[GETBYTE(temp, 2)] & 0xff000000) ^
- (Te4[GETBYTE(temp, 1)] & 0x00ff0000) ^
- (Te4[GETBYTE(temp, 0)] & 0x0000ff00) ^
- (Te4[GETBYTE(temp, 3)] & 0x000000ff) ^
+ (Te2[GETBYTE(temp, 2)] & 0xff000000) ^
+ (Te3[GETBYTE(temp, 1)] & 0x00ff0000) ^
+ (Te0[GETBYTE(temp, 0)] & 0x0000ff00) ^
+ (Te1[GETBYTE(temp, 3)] & 0x000000ff) ^
rcon_[i];
rk[ 9] = rk[ 1] ^ rk[ 8];
rk[10] = rk[ 2] ^ rk[ 9];
break;
temp = rk[11];
rk[12] = rk[ 4] ^
- (Te4[GETBYTE(temp, 3)] & 0xff000000) ^
- (Te4[GETBYTE(temp, 2)] & 0x00ff0000) ^
- (Te4[GETBYTE(temp, 1)] & 0x0000ff00) ^
- (Te4[GETBYTE(temp, 0)] & 0x000000ff);
+ (Te2[GETBYTE(temp, 3)] & 0xff000000) ^
+ (Te3[GETBYTE(temp, 2)] & 0x00ff0000) ^
+ (Te0[GETBYTE(temp, 1)] & 0x0000ff00) ^
+ (Te1[GETBYTE(temp, 0)] & 0x000000ff);
rk[13] = rk[ 5] ^ rk[12];
rk[14] = rk[ 6] ^ rk[13];
rk[15] = rk[ 7] ^ rk[14];
for (i = 1; i < rounds_; i++) {
rk += 4;
rk[0] =
- Td0[Te4[GETBYTE(rk[0], 3)] & 0xff] ^
- Td1[Te4[GETBYTE(rk[0], 2)] & 0xff] ^
- Td2[Te4[GETBYTE(rk[0], 1)] & 0xff] ^
- Td3[Te4[GETBYTE(rk[0], 0)] & 0xff];
+ Td0[Te1[GETBYTE(rk[0], 3)] & 0xff] ^
+ Td1[Te1[GETBYTE(rk[0], 2)] & 0xff] ^
+ Td2[Te1[GETBYTE(rk[0], 1)] & 0xff] ^
+ Td3[Te1[GETBYTE(rk[0], 0)] & 0xff];
rk[1] =
- Td0[Te4[GETBYTE(rk[1], 3)] & 0xff] ^
- Td1[Te4[GETBYTE(rk[1], 2)] & 0xff] ^
- Td2[Te4[GETBYTE(rk[1], 1)] & 0xff] ^
- Td3[Te4[GETBYTE(rk[1], 0)] & 0xff];
+ Td0[Te1[GETBYTE(rk[1], 3)] & 0xff] ^
+ Td1[Te1[GETBYTE(rk[1], 2)] & 0xff] ^
+ Td2[Te1[GETBYTE(rk[1], 1)] & 0xff] ^
+ Td3[Te1[GETBYTE(rk[1], 0)] & 0xff];
rk[2] =
- Td0[Te4[GETBYTE(rk[2], 3)] & 0xff] ^
- Td1[Te4[GETBYTE(rk[2], 2)] & 0xff] ^
- Td2[Te4[GETBYTE(rk[2], 1)] & 0xff] ^
- Td3[Te4[GETBYTE(rk[2], 0)] & 0xff];
+ Td0[Te1[GETBYTE(rk[2], 3)] & 0xff] ^
+ Td1[Te1[GETBYTE(rk[2], 2)] & 0xff] ^
+ Td2[Te1[GETBYTE(rk[2], 1)] & 0xff] ^
+ Td3[Te1[GETBYTE(rk[2], 0)] & 0xff];
rk[3] =
- Td0[Te4[GETBYTE(rk[3], 3)] & 0xff] ^
- Td1[Te4[GETBYTE(rk[3], 2)] & 0xff] ^
- Td2[Te4[GETBYTE(rk[3], 1)] & 0xff] ^
- Td3[Te4[GETBYTE(rk[3], 0)] & 0xff];
+ Td0[Te1[GETBYTE(rk[3], 3)] & 0xff] ^
+ Td1[Te1[GETBYTE(rk[3], 2)] & 0xff] ^
+ Td2[Te1[GETBYTE(rk[3], 1)] & 0xff] ^
+ Td3[Te1[GETBYTE(rk[3], 0)] & 0xff];
}
}
}
s2 ^= rk[2];
s3 ^= rk[3];
+ s0 |= PreFetchTe();
/*
* Nr - 1 full rounds:
*/
*/
s0 =
- (Te4[GETBYTE(t0, 3)] & 0xff000000) ^
- (Te4[GETBYTE(t1, 2)] & 0x00ff0000) ^
- (Te4[GETBYTE(t2, 1)] & 0x0000ff00) ^
- (Te4[GETBYTE(t3, 0)] & 0x000000ff) ^
+ (Te2[GETBYTE(t0, 3)] & 0xff000000) ^
+ (Te3[GETBYTE(t1, 2)] & 0x00ff0000) ^
+ (Te0[GETBYTE(t2, 1)] & 0x0000ff00) ^
+ (Te1[GETBYTE(t3, 0)] & 0x000000ff) ^
rk[0];
s1 =
- (Te4[GETBYTE(t1, 3)] & 0xff000000) ^
- (Te4[GETBYTE(t2, 2)] & 0x00ff0000) ^
- (Te4[GETBYTE(t3, 1)] & 0x0000ff00) ^
- (Te4[GETBYTE(t0, 0)] & 0x000000ff) ^
+ (Te2[GETBYTE(t1, 3)] & 0xff000000) ^
+ (Te3[GETBYTE(t2, 2)] & 0x00ff0000) ^
+ (Te0[GETBYTE(t3, 1)] & 0x0000ff00) ^
+ (Te1[GETBYTE(t0, 0)] & 0x000000ff) ^
rk[1];
s2 =
- (Te4[GETBYTE(t2, 3)] & 0xff000000) ^
- (Te4[GETBYTE(t3, 2)] & 0x00ff0000) ^
- (Te4[GETBYTE(t0, 1)] & 0x0000ff00) ^
- (Te4[GETBYTE(t1, 0)] & 0x000000ff) ^
+ (Te2[GETBYTE(t2, 3)] & 0xff000000) ^
+ (Te3[GETBYTE(t3, 2)] & 0x00ff0000) ^
+ (Te0[GETBYTE(t0, 1)] & 0x0000ff00) ^
+ (Te1[GETBYTE(t1, 0)] & 0x000000ff) ^
rk[2];
s3 =
- (Te4[GETBYTE(t3, 3)] & 0xff000000) ^
- (Te4[GETBYTE(t0, 2)] & 0x00ff0000) ^
- (Te4[GETBYTE(t1, 1)] & 0x0000ff00) ^
- (Te4[GETBYTE(t2, 0)] & 0x000000ff) ^
+ (Te2[GETBYTE(t3, 3)] & 0xff000000) ^
+ (Te3[GETBYTE(t0, 2)] & 0x00ff0000) ^
+ (Te0[GETBYTE(t1, 1)] & 0x0000ff00) ^
+ (Te1[GETBYTE(t2, 0)] & 0x000000ff) ^
rk[3];
s2 ^= rk[2];
s3 ^= rk[3];
+ s0 |= PreFetchTd();
+
/*
* Nr - 1 full rounds:
*/
* apply last round and
* map cipher state to byte array block:
*/
+
+ t0 |= PreFetchCTd4();
+
s0 =
- (Td4[GETBYTE(t0, 3)] & 0xff000000) ^
- (Td4[GETBYTE(t3, 2)] & 0x00ff0000) ^
- (Td4[GETBYTE(t2, 1)] & 0x0000ff00) ^
- (Td4[GETBYTE(t1, 0)] & 0x000000ff) ^
+ ((word32)CTd4[GETBYTE(t0, 3)] << 24) ^
+ ((word32)CTd4[GETBYTE(t3, 2)] << 16) ^
+ ((word32)CTd4[GETBYTE(t2, 1)] << 8) ^
+ ((word32)CTd4[GETBYTE(t1, 0)]) ^
rk[0];
s1 =
- (Td4[GETBYTE(t1, 3)] & 0xff000000) ^
- (Td4[GETBYTE(t0, 2)] & 0x00ff0000) ^
- (Td4[GETBYTE(t3, 1)] & 0x0000ff00) ^
- (Td4[GETBYTE(t2, 0)] & 0x000000ff) ^
+ ((word32)CTd4[GETBYTE(t1, 3)] << 24) ^
+ ((word32)CTd4[GETBYTE(t0, 2)] << 16) ^
+ ((word32)CTd4[GETBYTE(t3, 1)] << 8) ^
+ ((word32)CTd4[GETBYTE(t2, 0)]) ^
rk[1];
s2 =
- (Td4[GETBYTE(t2, 3)] & 0xff000000) ^
- (Td4[GETBYTE(t1, 2)] & 0x00ff0000) ^
- (Td4[GETBYTE(t0, 1)] & 0x0000ff00) ^
- (Td4[GETBYTE(t3, 0)] & 0x000000ff) ^
+ ((word32)CTd4[GETBYTE(t2, 3)] << 24 ) ^
+ ((word32)CTd4[GETBYTE(t1, 2)] << 16 ) ^
+ ((word32)CTd4[GETBYTE(t0, 1)] << 8 ) ^
+ ((word32)CTd4[GETBYTE(t3, 0)]) ^
rk[2];
s3 =
- (Td4[GETBYTE(t3, 3)] & 0xff000000) ^
- (Td4[GETBYTE(t2, 2)] & 0x00ff0000) ^
- (Td4[GETBYTE(t1, 1)] & 0x0000ff00) ^
- (Td4[GETBYTE(t0, 0)] & 0x000000ff) ^
+ ((word32)CTd4[GETBYTE(t3, 3)] << 24) ^
+ ((word32)CTd4[GETBYTE(t2, 2)] << 16) ^
+ ((word32)CTd4[GETBYTE(t1, 1)] << 8) ^
+ ((word32)CTd4[GETBYTE(t0, 0)]) ^
rk[3];
gpBlock::Put(xorBlock, outBlock)(s0)(s1)(s2)(s3);
}
};
+const byte AES::CTd4[256] =
+{
+ 0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
+ 0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
+ 0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, 0xffU, 0x87U,
+ 0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU,
+ 0x54U, 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU,
+ 0xeeU, 0x4cU, 0x95U, 0x0bU, 0x42U, 0xfaU, 0xc3U, 0x4eU,
+ 0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, 0xb2U,
+ 0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U,
+ 0x72U, 0xf8U, 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U,
+ 0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, 0x65U, 0xb6U, 0x92U,
+ 0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU,
+ 0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U,
+ 0x90U, 0xd8U, 0xabU, 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU,
+ 0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, 0x45U, 0x06U,
+ 0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U,
+ 0xc1U, 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU,
+ 0x3aU, 0x91U, 0x11U, 0x41U, 0x4fU, 0x67U, 0xdcU, 0xeaU,
+ 0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, 0x73U,
+ 0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U,
+ 0xe2U, 0xf9U, 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU,
+ 0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, 0x29U, 0xc5U, 0x89U,
+ 0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU,
+ 0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U,
+ 0x9aU, 0xdbU, 0xc0U, 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U,
+ 0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, 0xc7U, 0x31U,
+ 0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU,
+ 0x60U, 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU,
+ 0x2dU, 0xe5U, 0x7aU, 0x9fU, 0x93U, 0xc9U, 0x9cU, 0xefU,
+ 0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, 0xb0U,
+ 0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U,
+ 0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
+ 0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
+};
+
const word32* AES::Te0 = AES::Te[0];
const word32* AES::Te1 = AES::Te[1];
const word32* AES::Te2 = AES::Te[2];
const word32* AES::Te3 = AES::Te[3];
-const word32* AES::Te4 = AES::Te[4];
const word32* AES::Td0 = AES::Td[0];
const word32* AES::Td1 = AES::Td[1];
const word32* AES::Td2 = AES::Td[2];
const word32* AES::Td3 = AES::Td[3];
-const word32* AES::Td4 = AES::Td[4];
}
word32 rLen = GetLength(source);
if (rLen != 20) {
- if (rLen == 21) { // zero at front, eat
+ while (rLen > 20 && source.remaining() > 0) { // zero's at front, eat
source.next();
--rLen;
}
- else if (rLen == 19) { // add zero to front so 20 bytes
+ if (rLen < 20) { // add zero's to front so 20 bytes
+ word32 tmpLen = rLen;
+ while (tmpLen < 20) {
decoded[0] = 0;
decoded++;
+ tmpLen++;
}
- else {
- source.SetError(DSA_SZ_E);
- return 0;
}
}
memcpy(decoded, source.get_buffer() + source.get_index(), rLen);
}
word32 sLen = GetLength(source);
if (sLen != 20) {
- if (sLen == 21) {
- source.next(); // zero at front, eat
+ while (sLen > 20 && source.remaining() > 0) {
+ source.next(); // zero's at front, eat
--sLen;
}
- else if (sLen == 19) {
- decoded[rLen] = 0; // add zero to front so 20 bytes
+ if (sLen < 20) { // add zero's to front so 20 bytes
+ word32 tmpLen = sLen;
+ while (tmpLen < 20) {
+ decoded[rLen] = 0;
decoded++;
+ tmpLen++;
}
- else {
- source.SetError(DSA_SZ_E);
- return 0;
}
}
memcpy(decoded + rLen, source.get_buffer() + source.get_index(), sLen);
const Integer& q = key_.GetSubGroupOrder();
const Integer& g = key_.GetSubGroupGenerator();
const Integer& x = key_.GetPrivatePart();
+ byte* tmpPtr = sig; // initial signature output
Integer k(rng, 1, q - 1);
return -1;
int rSz = r_.ByteCount();
+ int tmpSz = rSz;
- if (rSz == 19) {
- sig[0] = 0;
- sig++;
+ while (tmpSz++ < SHA::DIGEST_SIZE) {
+ *sig++ = 0;
}
r_.Encode(sig, rSz);
+ sig = tmpPtr + SHA::DIGEST_SIZE; // advance sig output to s
int sSz = s_.ByteCount();
+ tmpSz = sSz;
- if (sSz == 19) {
- sig[rSz] = 0;
- sig++;
+ while (tmpSz++ < SHA::DIGEST_SIZE) {
+ *sig++ = 0;
}
- s_.Encode(sig + rSz, sSz);
+ s_.Encode(sig, sSz);
return 40;
}
if (!verifier.Verify(digest, decoded))
return -90;
+ if (!verifier.Verify(digest, signature))
+ return -91;
+
return 0;
}
#define yaSSL_TEST_HPP
#include "runtime.hpp"
-#include "openssl/ssl.h" /* openssl compatibility test */
#include "error.hpp"
#include <stdio.h>
#include <stdlib.h>
#endif
#define SOCKET_T int
#endif /* _WIN32 */
+#include "openssl/ssl.h" /* openssl compatibility test */
#ifdef _MSC_VER
#ifndef ATOMIC_NOLOCK_INCLUDED
#define ATOMIC_NOLOCK_INCLUDED
-/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. reserved.
reserved.
This program is free software; you can redistribute it and/or modify
Type not used so minimal size (emptry struct has different size between C
and C++, zero-length array is gcc-specific).
*/
-typedef char my_atomic_rwlock_t __attribute__ ((unused));
+typedef char my_atomic_rwlock_t MY_ATTRIBUTE ((unused));
#define my_atomic_rwlock_destroy(name)
#define my_atomic_rwlock_init(name)
#define my_atomic_rwlock_rdlock(name)
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#ifndef _lf_h
#define _lf_h
-#include <my_atomic.h>
+#include "my_global.h"
+#include "my_atomic.h"
+#include "my_sys.h"
+#include "hash.h"
C_MODE_START
typedef struct {
void * volatile pin[LF_PINBOX_PINS];
LF_PINBOX *pinbox;
- void **stack_ends_here;
void *purgatory;
uint32 purgatory_count;
uint32 volatile link;
/* we want sizeof(LF_PINS) to be 64 to avoid false sharing */
-#if SIZEOF_INT*2+SIZEOF_CHARP*(LF_PINBOX_PINS+3) != 64
- char pad[64-sizeof(uint32)*2-sizeof(void*)*(LF_PINBOX_PINS+3)];
+#if SIZEOF_INT*2+SIZEOF_CHARP*(LF_PINBOX_PINS+2) != 64
+ char pad[64-sizeof(uint32)*2-sizeof(void*)*(LF_PINBOX_PINS+2)];
#endif
} LF_PINS;
#if defined(__GNUC__) && defined(MY_LF_EXTRA_DEBUG)
#define LF_REQUIRE_PINS(N) \
static const char require_pins[LF_PINBOX_PINS-N] \
- __attribute__ ((unused)); \
+ MY_ATTRIBUTE ((unused)); \
static const int LF_NUM_PINS_IN_THIS_FILE= N;
#define _lf_pin(PINS, PIN, ADDR) \
( \
(pins),
&pins->pinbox->pinarray.lock)
-C_MODE_END
-
-/*
- extendible hash, lf_hash.c
-*/
-#include <hash.h>
-
-C_MODE_START
-
#define LF_HASH_UNIQUE 1
/* lf_hash overhead per element (that is, sizeof(LF_SLIST) */
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many);
-int my_strcasecmp_mb_bin(const CHARSET_INFO * cs __attribute__((unused)),
+int my_strcasecmp_mb_bin(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
const char *s, const char *t);
-void my_hash_sort_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2);
size_t my_strnxfrm_mb(const CHARSET_INFO *,
#ifndef MY_ATOMIC_INCLUDED
#define MY_ATOMIC_INCLUDED
-/* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
typedef union { \
int ## S i; \
uint ## S u; \
- } U_ ## S __attribute__ ((transparent_union)); \
+ } U_ ## S MY_ATTRIBUTE ((transparent_union)); \
typedef union { \
int ## S volatile *i; \
uint ## S volatile *u; \
- } Uv_ ## S __attribute__ ((transparent_union));
+ } Uv_ ## S MY_ATTRIBUTE ((transparent_union));
#define uintptr intptr
make_transparent_unions(8)
make_transparent_unions(16)
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#endif
/*
- Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
+ Disable MY_ATTRIBUTE() on g++ < 3.4, and non-gcc compilers.
Some forms of __attribute__ are actually supported in earlier versions of
g++, but we just disable them all because we only use them to generate
compilation warnings.
*/
-#ifndef __attribute__
-# if !defined(__GNUC__)
-# define __attribute__(A)
-# elif GCC_VERSION < 2008
-# define __attribute__(A)
-# elif defined(__cplusplus) && GCC_VERSION < 3004
-# define __attribute__(A)
-# endif
+#ifndef MY_ATTRIBUTE
+#if defined(__GNUC__) && GCC_VERSION > 3003
+# define MY_ATTRIBUTE(A) __attribute__(A)
+#else
+# define MY_ATTRIBUTE(A)
+#endif
#endif
/*
- __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
- But that's already covered by the __attribute__ tests above, so this is
+ __attribute__((format(...))) is only supported in g++ >= 3.4
+ But that's already covered by the MY_ATTRIBUTE tests above, so this is
just a convenience macro.
*/
#ifndef ATTRIBUTE_FORMAT
-# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
+# define ATTRIBUTE_FORMAT(style, m, n) MY_ATTRIBUTE((format(style, m, n)))
#endif
-/*
-
- __attribute__((format(...))) on a function pointer is not supported
- until gcc 3.1
-*/
#ifndef ATTRIBUTE_FORMAT_FPTR
-# if (GCC_VERSION >= 3001)
# define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n)
-# else
-# define ATTRIBUTE_FORMAT_FPTR(style, m, n)
-# endif /* GNUC >= 3.1 */
#endif
-/* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 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
extern const char *my_defaults_group_suffix;
extern const char *my_defaults_file;
extern my_bool my_getopt_use_args_separator;
+extern my_bool my_defaults_read_login_file;
/* Define the type of function to be passed to process_default_option_files */
typedef int (*Process_option_func)(void *ctx, const char *group_name,
my_bool my_getopt_is_args_separator(const char* arg);
int get_defaults_options(int argc, char **argv,
char **defaults, char **extra_defaults,
- char **group_suffix, char **login_path);
+ char **group_suffix, char **login_path,
+ my_bool found_no_defaults);
int my_load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv, const char ***);
-int check_file_permissions(const char *file_name);
+int check_file_permissions(const char *file_name, my_bool is_login_file);
int load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv);
int my_search_option_files(const char *conf_file, int *argc,
char ***argv, uint *args_used,
Process_option_func func, void *func_ctx,
- const char **default_directories);
+ const char **default_directories,
+ my_bool is_login_file, my_bool found_no_defaults);
void free_defaults(char **argv);
void my_print_default_files(const char *conf_file);
void print_defaults(const char *conf_file, const char **groups);
/*
- Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
other reason to use them is for documentation
*/
-#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
+#if !defined(__builtin_expect)
#define __builtin_expect(x, expected_value) (x)
#endif
#define compile_time_assert(X) \
do \
{ \
- typedef char compile_time_assert[(X) ? 1 : -1] __attribute__((unused)); \
+ typedef char compile_time_assert[(X) ? 1 : -1] MY_ATTRIBUTE((unused)); \
} while(0)
#endif
my_bool init;
struct st_my_thread_var *next,**prev;
void *opt_info;
- void *stack_ends_here;
#ifndef DBUG_OFF
void *dbug;
char name[THREAD_NAME_SIZE+1];
#endif
};
-extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const));
+extern struct st_my_thread_var *_my_thread_var(void) MY_ATTRIBUTE ((const));
extern int set_mysys_var(struct st_my_thread_var *mysys_var);
extern void **my_thread_var_dbug();
extern uint my_thread_end_wait_time;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define MY_RESOLVE_LINK 128 /* my_realpath(); Only resolve links */
#define MY_HOLD_ORIGINAL_MODES 128 /* my_copy() holds to file modes */
#define MY_REDEL_MAKE_BACKUP 256
+#define MY_REDEL_NO_COPY_STAT 512 /* my_redel() doesn't call my_copystat() */
#define MY_SEEK_NOT_DONE 32 /* my_lock may have to do a seek */
#define MY_DONT_WAIT 64 /* my_lock() don't wait if can't lock */
#define MY_ZEROFILL 32 /* my_malloc(), fill array with zero */
extern size_t system_filename(char * to,const char *from);
extern size_t unpack_filename(char * to,const char *from);
extern char * intern_filename(char * to,const char *from);
-extern char * directory_file_name(char * dst, const char *src);
extern int pack_filename(char * to, const char *name, size_t max_length);
extern char * my_path(char * to,const char *progname,
const char *own_pathname_part);
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
} TREE;
/* Functions on whole tree */
-void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
+void init_tree(TREE *tree, size_t default_alloc_size, ulong memory_limit,
int size, qsort_cmp2 compare, my_bool with_delete,
tree_element_free free_element, const void *custom_arg);
void delete_tree(TREE*);
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int chk_key(MI_CHECK *param, MI_INFO *info);
int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend);
int mi_repair(MI_CHECK *param, register MI_INFO *info,
- char * name, int rep_quick);
-int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name);
+ char * name, int rep_quick, my_bool no_copy_stat);
+int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name,
+ my_bool no_copy_stat);
int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
- const char * name, int rep_quick);
+ const char * name, int rep_quick, my_bool no_copy_stat);
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
- const char * name, int rep_quick);
+ const char * name, int rep_quick, my_bool no_copy_stat);
int change_to_newfile(const char * filename, const char * old_ext,
const char * new_ext, myf myflags);
int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type,
-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
PSI_file_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
-/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
const struct sockaddr *addr,
socklen_t addr_len
#else
- MYSQL_SOCKET socket __attribute__ ((unused)),
- const struct sockaddr *addr __attribute__ ((unused)),
- socklen_t addr_len __attribute__ ((unused))
+ MYSQL_SOCKET socket MY_ATTRIBUTE ((unused)),
+ const struct sockaddr *addr MY_ATTRIBUTE ((unused)),
+ socklen_t addr_len MY_ATTRIBUTE ((unused))
#endif
)
{
#ifdef HAVE_PSI_SOCKET_INTERFACE
MYSQL_SOCKET socket
#else
-MYSQL_SOCKET socket __attribute__ ((unused))
+MYSQL_SOCKET socket MY_ATTRIBUTE ((unused))
#endif
)
{
-/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
PSI_mutex_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
PSI_rwlock_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
PSI_cond_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
PSI_thread_info *info,
int count
#else
- const char *category __attribute__ ((unused)),
- void *info __attribute__ ((unused)),
- int count __attribute__ ((unused))
+ const char *category MY_ATTRIBUTE ((unused)),
+ void *info MY_ATTRIBUTE ((unused)),
+ int count MY_ATTRIBUTE ((unused))
#endif
)
{
OUTPUT_NAME mysqlclient
VERSION "${OS_SHARED_LIB_VERSION}"
SOVERSION "${SHARED_LIB_MAJOR_VERSION}")
- CONFIGURE_FILE(libmysql.ver.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver)
+ IF(WITH_SYMVER16)
+ CONFIGURE_FILE(libmysql.ver16.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver)
+ ELSE()
+ CONFIGURE_FILE(libmysql.ver.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver)
+ ENDIF()
GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS)
IF(NOT libmysql_link_flag)
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
1 could not initialize environment (out of memory or thread keys)
*/
-int STDCALL mysql_server_init(int argc __attribute__((unused)),
- char **argv __attribute__((unused)),
- char **groups __attribute__((unused)))
+int STDCALL mysql_server_init(int argc MY_ATTRIBUTE((unused)),
+ char **argv MY_ATTRIBUTE((unused)),
+ char **groups MY_ATTRIBUTE((unused)))
{
int result= 0;
if (!mysql_client_init)
if (!mysql_port)
{
char *env;
- struct servent *serv_ptr __attribute__((unused));
+ struct servent *serv_ptr MY_ATTRIBUTE((unused));
mysql_port = MYSQL_PORT;
**************************************************************************/
void STDCALL
-mysql_debug(const char *debug __attribute__((unused)))
+mysql_debug(const char *debug MY_ATTRIBUTE((unused)))
{
#ifndef DBUG_OFF
char *env;
**************************************************************************/
sig_handler
-my_pipe_sig_handler(int sig __attribute__((unused)))
+my_pipe_sig_handler(int sig MY_ATTRIBUTE((unused)))
{
DBUG_PRINT("info",("Hit by signal %d",sig));
#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
*/
static int default_local_infile_init(void **ptr, const char *filename,
- void *userdata __attribute__ ((unused)))
+ void *userdata MY_ATTRIBUTE ((unused)))
{
default_local_infile_data *data;
char tmp_name[FN_REFLEN];
*/
static int
-stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)),
- unsigned char **row __attribute__((unused)))
+stmt_read_row_no_data(MYSQL_STMT *stmt MY_ATTRIBUTE((unused)),
+ unsigned char **row MY_ATTRIBUTE((unused)))
{
return MYSQL_NO_DATA;
}
static int
-stmt_read_row_no_result_set(MYSQL_STMT *stmt __attribute__((unused)),
- unsigned char **row __attribute__((unused)))
+stmt_read_row_no_result_set(MYSQL_STMT *stmt MY_ATTRIBUTE((unused)),
+ unsigned char **row MY_ATTRIBUTE((unused)))
{
set_stmt_error(stmt, CR_NO_RESULT_SET, unknown_sqlstate, NULL);
return 1;
}
static void fetch_result_int32(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
}
static void fetch_result_int64(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
}
static void fetch_result_float(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
float value;
}
static void fetch_result_double(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
double value;
}
static void fetch_result_time(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
}
static void fetch_result_date(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
}
static void fetch_result_datetime(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
}
static void fetch_result_bin(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
ulong length= net_field_length(row);
}
static void fetch_result_str(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
ulong length= net_field_length(row);
*/
static void skip_result_fixed(MYSQL_BIND *param,
- MYSQL_FIELD *field __attribute__((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
}
-static void skip_result_with_length(MYSQL_BIND *param __attribute__((unused)),
- MYSQL_FIELD *field __attribute__((unused)),
+static void skip_result_with_length(MYSQL_BIND *param MY_ATTRIBUTE((unused)),
+ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
uchar **row)
{
}
-static void skip_result_string(MYSQL_BIND *param __attribute__((unused)),
+static void skip_result_string(MYSQL_BIND *param MY_ATTRIBUTE((unused)),
MYSQL_FIELD *field,
uchar **row)
return (*mysql->methods->read_query_result)(mysql);
}
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
+
+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
+
+void STDCALL symver16_myodbc_remove_escape(MYSQL *mysql,char *name)
+{
+ return myodbc_remove_escape(mysql, name);
+}
+SYM_16(myodbc_remove_escape);
+
+
+my_ulonglong STDCALL symver16_mysql_affected_rows(MYSQL *mysql)
+{
+ return mysql_affected_rows(mysql);
+}
+SYM_16(mysql_affected_rows);
+
+
+my_bool STDCALL symver16_mysql_autocommit(MYSQL * mysql, my_bool auto_mode)
+{
+ return mysql_autocommit(mysql, auto_mode);
+}
+SYM_16(mysql_autocommit);
+
+
+my_bool STDCALL symver16_mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db)
+{
+ return mysql_change_user(mysql, user, passwd, db);
+}
+SYM_16(mysql_change_user);
+
+
+const char * STDCALL symver16_mysql_character_set_name(MYSQL *mysql)
+{
+ return mysql_character_set_name(mysql);
+}
+SYM_16(mysql_character_set_name);
+
+
+my_bool STDCALL symver16_mysql_commit(MYSQL * mysql)
+{
+ return mysql_commit(mysql);
+}
+SYM_16(mysql_commit);
+
+
+void STDCALL symver16_mysql_data_seek(MYSQL_RES *result, my_ulonglong row)
+{
+ return mysql_data_seek(result, row);
+}
+SYM_16(mysql_data_seek);
+
+
+void STDCALL symver16_mysql_debug(const char *debug __attribute__((unused)))
+{
+ return mysql_debug(debug);
+}
+SYM_16(mysql_debug);
+
+
+int STDCALL symver16_mysql_dump_debug_info(MYSQL *mysql)
+{
+ return mysql_dump_debug_info(mysql);
+}
+SYM_16(mysql_dump_debug_info);
+
+
+my_bool STDCALL symver16_mysql_embedded(void)
+{
+ return mysql_embedded();
+}
+SYM_16(mysql_embedded);
+
+
+my_bool STDCALL symver16_mysql_eof(MYSQL_RES *res)
+{
+ return mysql_eof(res);
+}
+SYM_16(mysql_eof);
+
+
+ulong STDCALL symver16_mysql_escape_string(char *to,const char *from,ulong length)
+{
+ return mysql_escape_string(to, from, length);
+}
+SYM_16(mysql_escape_string);
+
+
+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field(MYSQL_RES *result)
+{
+ return mysql_fetch_field(result);
+}
+SYM_16(mysql_fetch_field);
+
+
+MYSQL_FIELD * STDCALL symver16_mysql_fetch_field_direct(MYSQL_RES *res,uint fieldnr)
+{
+ return mysql_fetch_field_direct(res, fieldnr);
+}
+SYM_16(mysql_fetch_field_direct);
+
+
+MYSQL_FIELD * STDCALL symver16_mysql_fetch_fields(MYSQL_RES *res)
+{
+ return mysql_fetch_fields(res);
+}
+SYM_16(mysql_fetch_fields);
+
+
+unsigned int STDCALL symver16_mysql_field_count(MYSQL *mysql)
+{
+ return mysql_field_count(mysql);
+}
+SYM_16(mysql_field_count);
+
+
+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset)
+{
+ return mysql_field_seek(result, field_offset);
+}
+SYM_16(mysql_field_seek);
+
+
+MYSQL_FIELD_OFFSET STDCALL symver16_mysql_field_tell(MYSQL_RES *res)
+{
+ return mysql_field_tell(res);
+}
+SYM_16(mysql_field_tell);
+
+
+void STDCALL symver16_mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo)
+{
+ return mysql_get_character_set_info(mysql, csinfo);
+}
+SYM_16(mysql_get_character_set_info);
+
+
+const char * STDCALL symver16_mysql_get_client_info(void)
+{
+ return mysql_get_client_info();
+}
+SYM_16(mysql_get_client_info);
+
+ulong STDCALL symver16_mysql_get_client_version(void)
+{
+ return mysql_get_client_version();
+}
+SYM_16(mysql_get_client_version);
+
+
+const char * STDCALL symver16_mysql_get_host_info(MYSQL *mysql)
+{
+ return mysql_get_host_info(mysql);
+}
+SYM_16(mysql_get_host_info);
+
+
+MYSQL_PARAMETERS *STDCALL symver16_mysql_get_parameters(void)
+{
+ return mysql_get_parameters();
+}
+SYM_16(mysql_get_parameters);
+
+
+uint STDCALL symver16_mysql_get_proto_info(MYSQL *mysql)
+{
+ return mysql_get_proto_info(mysql);
+}
+SYM_16(mysql_get_proto_info);
+
+
+const char * STDCALL symver16_mysql_get_server_info(MYSQL *mysql)
+{
+ return mysql_get_server_info(mysql);
+}
+SYM_16(mysql_get_server_info);
+
+
+ulong STDCALL symver16_mysql_hex_string(char *to, const char *from, ulong length)
+{
+ return mysql_hex_string(to, from, length);
+}
+SYM_16(mysql_hex_string);
+
+
+const char *STDCALL symver16_mysql_info(MYSQL *mysql)
+{
+ return mysql_info(mysql);
+}
+SYM_16(mysql_info);
+
+
+my_ulonglong STDCALL symver16_mysql_insert_id(MYSQL *mysql)
+{
+ return mysql_insert_id(mysql);
+}
+SYM_16(mysql_insert_id);
+
+
+int STDCALL symver16_mysql_kill(MYSQL *mysql,ulong pid)
+{
+ return mysql_kill(mysql, pid);
+}
+SYM_16(mysql_kill);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_dbs(MYSQL *mysql, const char *wild)
+{
+ return mysql_list_dbs(mysql, wild);
+}
+SYM_16(mysql_list_dbs);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
+{
+ return mysql_list_fields(mysql, table, wild);
+}
+SYM_16(mysql_list_fields);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_processes(MYSQL *mysql)
+{
+ return mysql_list_processes(mysql);
+}
+SYM_16(mysql_list_processes);
+
+
+MYSQL_RES * STDCALL symver16_mysql_list_tables(MYSQL *mysql, const char *wild)
+{
+ return mysql_list_tables(mysql, wild);
+}
+SYM_16(mysql_list_tables);
+
+
+my_bool STDCALL symver16_mysql_more_results(MYSQL *mysql)
+{
+ return mysql_more_results(mysql);
+}
+SYM_16(mysql_more_results);
+
+
+int STDCALL symver16_mysql_next_result(MYSQL *mysql)
+{
+ return mysql_next_result(mysql);
+}
+SYM_16(mysql_next_result);
+
+
+int STDCALL symver16_mysql_ping(MYSQL *mysql)
+{
+ return mysql_ping(mysql);
+}
+SYM_16(mysql_ping);
+
+
+int STDCALL symver16_mysql_query(MYSQL *mysql, const char *query)
+{
+ return mysql_query(mysql, query);
+}
+SYM_16(mysql_query);
+
+
+my_bool STDCALL symver16_mysql_read_query_result(MYSQL *mysql)
+{
+ return mysql_read_query_result(mysql);
+}
+SYM_16(mysql_read_query_result);
+
+
+ulong STDCALL symver16_mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, ulong length)
+{
+ return mysql_real_escape_string(mysql, to, from, length);
+}
+SYM_16(mysql_real_escape_string);
+
+
+int STDCALL symver16_mysql_refresh(MYSQL *mysql,uint options)
+{
+ return mysql_refresh(mysql, options);
+}
+SYM_16(mysql_refresh);
+
+
+my_bool STDCALL symver16_mysql_rollback(MYSQL * mysql)
+{
+ return mysql_rollback(mysql);
+}
+SYM_16(mysql_rollback);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET row)
+{
+ return mysql_row_seek(result, row);
+}
+SYM_16(mysql_row_seek);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_row_tell(MYSQL_RES *res)
+{
+ return mysql_row_tell(res);
+}
+SYM_16(mysql_row_tell);
+
+
+void STDCALL symver16_mysql_server_end()
+{
+ return mysql_server_end();
+}
+SYM_16(mysql_server_end);
+
+
+int STDCALL symver16_mysql_server_init(int argc __attribute__((unused)), char **argv __attribute__((unused)), char **groups __attribute__((unused)))
+{
+ return mysql_server_init(argc, argv, groups);
+}
+SYM_16(mysql_server_init);
+
+
+void symver16_mysql_set_local_infile_default(MYSQL *mysql)
+{
+ return mysql_set_local_infile_default(mysql);
+}
+SYM_16(mysql_set_local_infile_default);
+
+
+void symver16_mysql_set_local_infile_handler(MYSQL *mysql, int (*local_infile_init)(void **, const char *, void *), int (*local_infile_read)(void *, char *, uint), void (*local_infile_end)(void *), int (*local_infile_error)(void *, char *, uint), void *userdata)
+{
+ return mysql_set_local_infile_handler(mysql, local_infile_init, local_infile_read, local_infile_end, local_infile_error, userdata);
+}
+SYM_16(mysql_set_local_infile_handler);
+
+
+int STDCALL symver16_mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option)
+{
+ return mysql_set_server_option(mysql, option);
+}
+SYM_16(mysql_set_server_option);
+
+
+int STDCALL symver16_mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
+{
+ return mysql_shutdown(mysql, shutdown_level);
+}
+SYM_16(mysql_shutdown);
+
+
+const char *STDCALL symver16_mysql_sqlstate(MYSQL *mysql)
+{
+ return mysql_sqlstate(mysql);
+}
+SYM_16(mysql_sqlstate);
+
+
+const char * STDCALL symver16_mysql_stat(MYSQL *mysql)
+{
+ return mysql_stat(mysql);
+}
+SYM_16(mysql_stat);
+
+
+my_ulonglong STDCALL symver16_mysql_stmt_affected_rows(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_affected_rows(stmt);
+}
+SYM_16(mysql_stmt_affected_rows);
+
+
+my_bool STDCALL symver16_mysql_stmt_attr_get(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, void *value)
+{
+ return mysql_stmt_attr_get(stmt, attr_type, value);
+}
+SYM_16(mysql_stmt_attr_get);
+
+
+my_bool STDCALL symver16_mysql_stmt_attr_set(MYSQL_STMT *stmt, enum enum_stmt_attr_type attr_type, const void *value)
+{
+ return mysql_stmt_attr_set(stmt, attr_type, value);
+}
+SYM_16(mysql_stmt_attr_set);
+
+
+my_bool STDCALL symver16_mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
+{
+ return mysql_stmt_bind_param(stmt, my_bind);
+}
+SYM_16(mysql_stmt_bind_param);
+
+
+my_bool STDCALL symver16_mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *my_bind)
+{
+ return mysql_stmt_bind_result(stmt, my_bind);
+}
+SYM_16(mysql_stmt_bind_result);
+
+
+my_bool STDCALL symver16_mysql_stmt_close(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_close(stmt);
+}
+SYM_16(mysql_stmt_close);
+
+
+void STDCALL symver16_mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
+{
+ return mysql_stmt_data_seek(stmt, row);
+}
+SYM_16(mysql_stmt_data_seek);
+
+
+uint STDCALL symver16_mysql_stmt_errno(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_errno(stmt);
+}
+SYM_16(mysql_stmt_errno);
+
+
+const char *STDCALL symver16_mysql_stmt_error(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_error(stmt);
+}
+SYM_16(mysql_stmt_error);
+
+
+int STDCALL symver16_mysql_stmt_execute(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_execute(stmt);
+}
+SYM_16(mysql_stmt_execute);
+
+
+int STDCALL symver16_mysql_stmt_fetch(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_fetch(stmt);
+}
+SYM_16(mysql_stmt_fetch);
+
+
+int STDCALL symver16_mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *my_bind, uint column, ulong offset)
+{
+ return mysql_stmt_fetch_column(stmt, my_bind, column, offset);
+}
+SYM_16(mysql_stmt_fetch_column);
+
+
+unsigned int STDCALL symver16_mysql_stmt_field_count(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_field_count(stmt);
+}
+SYM_16(mysql_stmt_field_count);
+
+
+my_bool STDCALL symver16_mysql_stmt_free_result(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_free_result(stmt);
+}
+SYM_16(mysql_stmt_free_result);
+
+
+MYSQL_STMT * STDCALL symver16_mysql_stmt_init(MYSQL *mysql)
+{
+ return mysql_stmt_init(mysql);
+}
+SYM_16(mysql_stmt_init);
+
+
+my_ulonglong STDCALL symver16_mysql_stmt_insert_id(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_insert_id(stmt);
+}
+SYM_16(mysql_stmt_insert_id);
+
+
+my_ulonglong STDCALL symver16_mysql_stmt_num_rows(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_num_rows(stmt);
+}
+SYM_16(mysql_stmt_num_rows);
+
+
+ulong STDCALL symver16_mysql_stmt_param_count(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_param_count(stmt);
+}
+SYM_16(mysql_stmt_param_count);
+
+
+MYSQL_RES * STDCALL symver16_mysql_stmt_param_metadata(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_param_metadata(stmt);
+}
+SYM_16(mysql_stmt_param_metadata);
+
+
+int STDCALL symver16_mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
+{
+ return mysql_stmt_prepare(stmt, query, length);
+}
+SYM_16(mysql_stmt_prepare);
+
+
+my_bool STDCALL symver16_mysql_stmt_reset(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_reset(stmt);
+}
+SYM_16(mysql_stmt_reset);
+
+
+MYSQL_RES * STDCALL symver16_mysql_stmt_result_metadata(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_result_metadata(stmt);
+}
+SYM_16(mysql_stmt_result_metadata);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row)
+{
+ return mysql_stmt_row_seek(stmt, row);
+}
+SYM_16(mysql_stmt_row_seek);
+
+
+MYSQL_ROW_OFFSET STDCALL symver16_mysql_stmt_row_tell(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_row_tell(stmt);
+}
+SYM_16(mysql_stmt_row_tell);
+
+
+my_bool STDCALL symver16_mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, const char *data, ulong length)
+{
+ return mysql_stmt_send_long_data(stmt, param_number, data, length);
+}
+SYM_16(mysql_stmt_send_long_data);
+
+
+const char *STDCALL symver16_mysql_stmt_sqlstate(MYSQL_STMT * stmt)
+{
+ return mysql_stmt_sqlstate(stmt);
+}
+SYM_16(mysql_stmt_sqlstate);
+
+
+int STDCALL symver16_mysql_stmt_store_result(MYSQL_STMT *stmt)
+{
+ return mysql_stmt_store_result(stmt);
+}
+SYM_16(mysql_stmt_store_result);
+
+
+void STDCALL symver16_mysql_thread_end()
+{
+ return mysql_thread_end();
+}
+SYM_16(mysql_thread_end);
+
+
+ulong STDCALL symver16_mysql_thread_id(MYSQL *mysql)
+{
+ return mysql_thread_id(mysql);
+}
+SYM_16(mysql_thread_id);
+
+
+my_bool STDCALL symver16_mysql_thread_init()
+{
+ return mysql_thread_init();
+}
+SYM_16(mysql_thread_init);
+
+
+uint STDCALL symver16_mysql_thread_safe(void)
+{
+ return mysql_thread_safe();
+}
+SYM_16(mysql_thread_safe);
+
+
+MYSQL_RES * STDCALL symver16_mysql_use_result(MYSQL *mysql)
+{
+ return mysql_use_result(mysql);
+}
+SYM_16(mysql_use_result);
+
+
+uint STDCALL symver16_mysql_warning_count(MYSQL *mysql)
+{
+ return mysql_warning_count(mysql);
+}
+SYM_16(mysql_warning_count);
+
+/*****/
+
+MYSQL * STDCALL symver16_mysql_real_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd, const char *db, uint port, const char *unix_socket,ulong client_flag)
+{
+ return mysql_real_connect(mysql, host, user, passwd, db, port, unix_socket, client_flag);
+}
+SYM_16(mysql_real_connect);
+
+/*****/
+
+my_bool symver16_my_init(void)
+{
+ return my_init();
+}
+SYM_16(my_init);
+
+
+#endif
+#endif /* EXPORT_SYMVER16 */
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
libmysqlclient_@SHARED_LIB_MAJOR_VERSION@ { global: *; };
--- /dev/null
+/* Copyright (c) 2014, 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 */
+
+libmysqlclient_16
+{
+ local:
+ symver16_*;
+};
+
+libmysqlclient_18
+{
+ global:
+ my_init;
+ myodbc_remove_escape;
+ mysql_affected_rows;
+ mysql_autocommit;
+ mysql_change_user;
+ mysql_character_set_name;
+ mysql_close;
+ mysql_commit;
+ mysql_data_seek;
+ mysql_debug;
+ mysql_dump_debug_info;
+ mysql_embedded;
+ mysql_eof;
+ mysql_errno;
+ mysql_error;
+ mysql_escape_string;
+ mysql_fetch_field;
+ mysql_fetch_field_direct;
+ mysql_fetch_fields;
+ mysql_fetch_lengths;
+ mysql_fetch_row;
+ mysql_field_count;
+ mysql_field_seek;
+ mysql_field_tell;
+ mysql_free_result;
+ mysql_get_character_set_info;
+ mysql_get_client_info;
+ mysql_get_client_version;
+ mysql_get_host_info;
+ mysql_get_parameters;
+ mysql_get_proto_info;
+ mysql_get_server_info;
+ mysql_get_server_version;
+ mysql_get_ssl_cipher;
+ mysql_hex_string;
+ mysql_info;
+ mysql_init;
+ mysql_insert_id;
+ mysql_kill;
+ mysql_list_dbs;
+ mysql_list_fields;
+ mysql_list_processes;
+ mysql_list_tables;
+ mysql_more_results;
+ mysql_next_result;
+ mysql_num_fields;
+ mysql_num_rows;
+ mysql_options;
+ mysql_ping;
+ mysql_query;
+ mysql_read_query_result;
+ mysql_real_connect;
+ mysql_real_escape_string;
+ mysql_real_query;
+ mysql_refresh;
+ mysql_rollback;
+ mysql_row_seek;
+ mysql_row_tell;
+ mysql_select_db;
+ mysql_send_query;
+ mysql_server_end;
+ mysql_server_init;
+ mysql_set_character_set;
+ mysql_set_local_infile_default;
+ mysql_set_local_infile_handler;
+ mysql_set_server_option;
+ mysql_shutdown;
+ mysql_sqlstate;
+ mysql_ssl_set;
+ mysql_stat;
+ mysql_stmt_affected_rows;
+ mysql_stmt_attr_get;
+ mysql_stmt_attr_set;
+ mysql_stmt_bind_param;
+ mysql_stmt_bind_result;
+ mysql_stmt_close;
+ mysql_stmt_data_seek;
+ mysql_stmt_errno;
+ mysql_stmt_error;
+ mysql_stmt_execute;
+ mysql_stmt_fetch;
+ mysql_stmt_fetch_column;
+ mysql_stmt_field_count;
+ mysql_stmt_free_result;
+ mysql_stmt_init;
+ mysql_stmt_insert_id;
+ mysql_stmt_num_rows;
+ mysql_stmt_param_count;
+ mysql_stmt_param_metadata;
+ mysql_stmt_prepare;
+ mysql_stmt_reset;
+ mysql_stmt_result_metadata;
+ mysql_stmt_row_seek;
+ mysql_stmt_row_tell;
+ mysql_stmt_send_long_data;
+ mysql_stmt_sqlstate;
+ mysql_stmt_store_result;
+ mysql_store_result;
+ mysql_thread_end;
+ mysql_thread_id;
+ mysql_thread_init;
+ mysql_thread_safe;
+ mysql_use_result;
+ mysql_warning_count;
+
+ free_defaults;
+ handle_options;
+ load_defaults;
+ my_print_help;
+
+ #my_make_scrambled_password;
+ THR_KEY_mysys;
+
+ mysql_client_find_plugin;
+ mysql_client_register_plugin;
+ mysql_load_plugin;
+ mysql_load_plugin_v;
+ mysql_plugin_options;
+ mysql_stmt_next_result;
+
+ #mysql_default_charset_info;
+ mysql_get_charset;
+ mysql_get_charset_by_csname;
+ mysql_net_realloc;
+ #mysql_client_errors;
+ *;
+} libmysqlclient_16;
* Copyright (c) 2000
* SWsoft company
*
- * Modifications copyright (c) 2001, 2015. Oracle and/or its affiliates.
+ * Modifications copyright (c) 2001, 2016. Oracle and/or its affiliates.
* All rights reserved.
*
* This material is provided "as is", with absolutely no warranty expressed
*/
static MYSQL_DATA *
-emb_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields __attribute__((unused)),
- unsigned int fields __attribute__((unused)))
+emb_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields MY_ATTRIBUTE((unused)),
+ unsigned int fields MY_ATTRIBUTE((unused)))
{
MYSQL_DATA *result= ((THD*)mysql->thd)->cur_data;
((THD*)mysql->thd)->cur_data= 0;
#define vsnprintf _vsnprintf
#endif
-int vprint_msg_to_log(enum loglevel level __attribute__((unused)),
+int vprint_msg_to_log(enum loglevel level MY_ATTRIBUTE((unused)),
const char *format, va_list argsi)
{
my_vsnprintf(mysql_server_last_error, sizeof(mysql_server_last_error),
'\" t
.\" Title: \fBcomp_err\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBCOMP_ERR\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBCOMP_ERR\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" comp_err
.SH "NAME"
comp_err \- compile MySQL error message file
.SH "SYNOPSIS"
normally is run automatically when MySQL is built\&. It compiles the
errmsg\&.sys
file from the text file located at
-sql/share/errmsg\&.txt
+sql/share/errmsg\-utf8\&.txt
in MySQL source distributions\&.
.PP
\fBcomp_err\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: help option
-.\" help option: comp_err
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: charset option
-.\" charset option: comp_err
\fB\-\-charset=\fR\fB\fIdir_name\fR\fR,
\fB\-C \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: debug option
-.\" debug option: comp_err
\fB\-\-debug=\fR\fB\fIdebug_options\fR\fR,
\fB\-# \fR\fB\fIdebug_options\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: debug-info option
-.\" debug-info option: comp_err
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: header_file option
-.\" header_file option: comp_err
\fB\-\-header_file=\fR\fB\fIfile_name\fR\fR,
\fB\-H \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: in_file option
-.\" in_file option: comp_err
\fB\-\-in_file=\fR\fB\fIfile_name\fR\fR,
\fB\-F \fR\fB\fIfile_name\fR\fR
.sp
The name of the input file\&. The default is
-\&.\&./sql/share/errmsg\&.txt\&.
+\&.\&./sql/share/errmsg\-utf8\&.txt\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: name_file option
-.\" name_file option: comp_err
\fB\-\-name_file=\fR\fB\fIfile_name\fR\fR,
\fB\-N \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: out_dir option
-.\" out_dir option: comp_err
\fB\-\-out_dir=\fR\fB\fIdir_name\fR\fR,
\fB\-D \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: out_file option
-.\" out_file option: comp_err
\fB\-\-out_file=\fR\fB\fIfile_name\fR\fR,
\fB\-O \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: statefile option
-.\" statefile option: comp_err
\fB\-\-statefile=\fR\fB\fIfile_name\fR\fR,
\fB\-S \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" comp_err: version option
-.\" version option: comp_err
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBinnochecksum\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBINNOCHECKSUM\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBINNOCHECKSUM\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" innochecksum
.SH "NAME"
innochecksum \- offline InnoDB file checksum utility
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmsql2mysql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMSQL2MYSQL\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMSQL2MYSQL\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" msql2mysql
.SH "NAME"
msql2mysql \- convert mSQL programs for use with MySQL
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmy_print_defaults\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMY_PRINT_DEFAULTS" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMY_PRINT_DEFAULTS" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" my_print_defaults
.SH "NAME"
my_print_defaults \- display options from option files
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: help option
-.\" help option: my_print_defaults
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: config-file option
-.\" config-file option: my_print_defaults
\fB\-\-config\-file=\fR\fB\fIfile_name\fR\fR,
-.\" my_print_defaults: defaults-file option
-.\" defaults-file option: my_print_defaults
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-c \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: debug option
-.\" debug option: my_print_defaults
\fB\-\-debug=\fR\fB\fIdebug_options\fR\fR,
\fB\-# \fR\fB\fIdebug_options\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: defaults-extra-file option
-.\" defaults-extra-file option: my_print_defaults
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR,
-.\" my_print_defaults: extra-file option
-.\" extra-file option: my_print_defaults
\fB\-\-extra\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-e \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: defaults-group-suffix option
-.\" defaults-group-suffix option: my_print_defaults
\fB\-\-defaults\-group\-suffix=\fR\fB\fIsuffix\fR\fR,
\fB\-g \fR\fB\fIsuffix\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" login-path option
\fB\-\-login\-path=\fR\fB\fIname\fR\fR,
\fB\-l \fR\fB\fIname\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: no-defaults option
-.\" no-defaults option: my_print_defaults
\fB\-\-no\-defaults\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: show option
-.\" show option: my_print_defaults
\fB\-\-show\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: verbose option
-.\" verbose option: my_print_defaults
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" my_print_defaults: version option
-.\" version option: my_print_defaults
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmyisam_ftdump\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAM_FTDUMP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAM_FTDUMP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" myisam_ftdump
.SH "NAME"
myisam_ftdump \- display full\-text index information
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: help option
-.\" help option: myisam_ftdump
\fB\-\-help\fR,
\fB\-h\fR
\fB\-?\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: count option
-.\" count option: myisam_ftdump
\fB\-\-count\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: dump option
-.\" dump option: myisam_ftdump
\fB\-\-dump\fR,
\fB\-d\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: length option
-.\" length option: myisam_ftdump
\fB\-\-length\fR,
\fB\-l\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: stats option
-.\" stats option: myisam_ftdump
\fB\-\-stats\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisam_ftdump: verbose option
-.\" verbose option: myisam_ftdump
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
'\" t
.\" Title: \fBmyisamchk\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAMCHK\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMCHK\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" myisamchk
.SH "NAME"
myisamchk \- MyISAM table\-maintenance utility
.SH "SYNOPSIS"
group of an option file\&. For information about option files used by MySQL programs, see
Section\ \&4.2.6, \(lqUsing Option Files\(rq\&.
.SH "MYISAMCHK GENERAL OPTIONS"
-.\" options: myisamchk
-.\" myisamchk: options
.PP
The options described in this section can be used for any type of table maintenance operation performed by
\fBmyisamchk\fR\&. The sections following this one describe options that pertain only to specific operations, such as table checking or repairing\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: help option
-.\" help option: myisamchk
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: HELP option
-.\" HELP option: myisamchk
\fB\-\-HELP\fR,
\fB\-H\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: debug option
-.\" debug option: myisamchk
\fB\-\-debug=\fR\fB\fIdebug_options\fR\fR,
\fB\-# \fR\fB\fIdebug_options\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: defaults-extra-file option
-.\" defaults-extra-file option: myisamchk
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: defaults-file option
-.\" defaults-file option: myisamchk
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: defaults-group-suffix option
-.\" defaults-group-suffix option: myisamchk
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: no-defaults option
-.\" no-defaults option: myisamchk
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: print-defaults option
-.\" print-defaults option: myisamchk
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: silent option
-.\" silent option: myisamchk
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: verbose option
-.\" verbose option: myisamchk
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: version option
-.\" version option: myisamchk
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: wait option
-.\" wait option: myisamchk
\fB\-\-wait\fR,
\fB\-w\fR
.sp
You can also set the following variables by using
\fB\-\-\fR\fB\fIvar_name\fR\fR\fB=\fR\fB\fIvalue\fR\fR
syntax:
-.\" decode_bits myisamchk variable
-.\" ft_max_word_len myisamchk variable
-.\" ft_min_word_len myisamchk variable
-.\" ft_stopword_file myisamchk variable
-.\" key_buffer_size myisamchk variable
-.\" myisam_block_size myisamchk variable
-.\" read_buffer_size myisamchk variable
-.\" sort_buffer_size myisamchk variable
-.\" myisam_sort_buffer_size myisamchk variable
-.\" sort_key_blocks myisamchk variable
-.\" stats_method myisamchk variable
-.\" write_buffer_size myisamchk variable
.TS
allbox tab(:);
lB lB.
OPTIMIZE TABLE, or
ALTER TABLE\&. These statements are performed by the server, which knows the proper full\-text parameter values to use\&.
.SH "MYISAMCHK CHECK OPTIONS"
-.\" check options: myisamchk
-.\" tables: checking
.PP
\fBmyisamchk\fR
supports the following options for table checking operations:
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: check option
-.\" check option: myisamchk
\fB\-\-check\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: check-only-changed option
-.\" check-only-changed option: myisamchk
\fB\-\-check\-only\-changed\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: extend-check option
-.\" extend-check option: myisamchk
\fB\-\-extend\-check\fR,
\fB\-e\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: fast option
-.\" fast option: myisamchk
\fB\-\-fast\fR,
\fB\-F\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: force option
-.\" force option: myisamchk
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: information option
-.\" information option: myisamchk
\fB\-\-information\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: medium-check option
-.\" medium-check option: myisamchk
\fB\-\-medium\-check\fR,
\fB\-m\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: read-only option
-.\" read-only option: myisamchk
\fB\-\-read\-only\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: update-state option
-.\" update-state option: myisamchk
\fB\-\-update\-state\fR,
\fB\-U\fR
.sp
server is using the table and you are running it with external locking disabled\&.
.RE
.SH "MYISAMCHK REPAIR OPTIONS"
-.\" repair options: myisamchk
-.\" files: repairing
.PP
\fBmyisamchk\fR
supports the following options for table repair operations (operations performed when an option such as
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: backup option
-.\" backup option: myisamchk
\fB\-\-backup\fR,
\fB\-B\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: character-sets-dir option
-.\" character-sets-dir option: myisamchk
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: correct-checksum option
-.\" correct-checksum option: myisamchk
\fB\-\-correct\-checksum\fR
.sp
Correct the checksum information for the table\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: data-file-length option
-.\" data-file-length option: myisamchk
\fB\-\-data\-file\-length=\fR\fB\fIlen\fR\fR,
\fB\-D \fR\fB\fIlen\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: extend-check option
-.\" extend-check option: myisamchk
\fB\-\-extend\-check\fR,
\fB\-e\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: force option
-.\" force option: myisamchk
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: keys-used option
-.\" keys-used option: myisamchk
\fB\-\-keys\-used=\fR\fB\fIval\fR\fR,
\fB\-k \fR\fB\fIval\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: no-symlinks option
-.\" no-symlinks option: myisamchk
\fB\-\-no\-symlinks\fR,
\fB\-l\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: max-record-length option
-.\" max-record-length option: myisamchk
\fB\-\-max\-record\-length=\fR\fB\fIlen\fR\fR
.sp
Skip rows larger than the given length if
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: parallel-recover option
-.\" parallel-recover option: myisamchk
\fB\-\-parallel\-recover\fR,
\fB\-p\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: quick option
-.\" quick option: myisamchk
\fB\-\-quick\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: recover option
-.\" recover option: myisamchk
\fB\-\-recover\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: safe-recover option
-.\" safe-recover option: myisamchk
\fB\-\-safe\-recover\fR,
\fB\-o\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: set-collation option
-.\" set-collation option: myisamchk
\fB\-\-set\-collation=\fR\fB\fIname\fR\fR
.sp
Specify the collation to use for sorting table indexes\&. The character set name is implied by the first part of the collation name\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: sort-recover option
-.\" sort-recover option: myisamchk
\fB\-\-sort\-recover\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: tmpdir option
-.\" tmpdir option: myisamchk
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR,
\fB\-t \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: unpack option
-.\" unpack option: myisamchk
\fB\-\-unpack\fR,
\fB\-u\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: analyze option
-.\" analyze option: myisamchk
\fB\-\-analyze\fR,
\fB\-a\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: block-search option
-.\" block-search option: myisamchk
\fB\-\-block\-search=\fR\fB\fIoffset\fR\fR,
\fB\-b \fR\fB\fIoffset\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: description option
-.\" description option: myisamchk
\fB\-\-description\fR,
\fB\-d\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: set-auto-increment[ option
-.\" set-auto-increment[ option: myisamchk
\fB\-\-set\-auto\-increment[=\fR\fB\fIvalue\fR\fR\fB]\fR,
\fB\-A[\fR\fB\fIvalue\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: sort-index option
-.\" sort-index option: myisamchk
\fB\-\-sort\-index\fR,
\fB\-S\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisamchk: sort-records option
-.\" sort-records option: myisamchk
\fB\-\-sort\-records=\fR\fB\fIN\fR\fR,
\fB\-R \fR\fB\fIN\fR\fR
.sp
must unpack key blocks first, then re\-create indexes and pack the key blocks again\&. (In this case, re\-creating indexes is faster than updating offsets for each index\&.)
.RE
.SH "OBTAINING TABLE INFORMATION WITH MYISAMCHK"
-.\" table description: myisamchk
-.\" tables: information
-.\" examples: myisamchk output
-.\" myisamchk: example output
.PP
To obtain a description of a
MyISAM
is the sum of the amount of storage used by all such pointers\&.
.RE
.SH "MYISAMCHK MEMORY USAGE"
-.\" memory usage: myisamchk
.PP
Memory allocation is important when you run
\fBmyisamchk\fR\&.
'\" t
.\" Title: \fBmyisamlog\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAMLOG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMLOG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" myisamlog
.SH "NAME"
myisamlog \- display MyISAM log file contents
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmyisampack\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYISAMPACK\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYISAMPACK\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" myisampack
-.\" compressed tables
-.\" tables: compressed
-.\" MyISAM: compressed tables
.SH "NAME"
myisampack \- generate compressed, read\-only MyISAM tables
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: help option
-.\" help option: myisampack
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: backup option
-.\" backup option: myisampack
\fB\-\-backup\fR,
\fB\-b\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: character-sets-dir option
-.\" character-sets-dir option: myisampack
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: debug option
-.\" debug option: myisampack
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: force option
-.\" force option: myisampack
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: join option
-.\" join option: myisampack
\fB\-\-join=\fR\fB\fIbig_tbl_name\fR\fR,
\fB\-j \fR\fB\fIbig_tbl_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: silent option
-.\" silent option: myisampack
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: test option
-.\" test option: myisampack
\fB\-\-test\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: tmpdir option
-.\" tmpdir option: myisampack
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR,
\fB\-T \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: verbose option
-.\" verbose option: myisampack
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: version option
-.\" version option: myisampack
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" myisampack: wait option
-.\" wait option: myisampack
\fB\-\-wait\fR,
\fB\-w\fR
.sp
\fBmyisampack\fR
if the table might be updated by the server during the packing process\&.
.RE
-.\" examples: compressed tables
.PP
The following sequence of commands illustrates a typical table compression session:
.sp
'\" t
.\" Title: \fBmysql-stress-test.pl\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL
.\" Language: English
.\"
-.TH "\FBMYSQL\-STRESS\-TE" "1" "03/02/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL\-STRESS\-TE" "1" "08/25/2016" "MySQL" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql-stress-test.pl
.SH "NAME"
mysql-stress-test.pl \- server stress test program
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: help option
-.\" help option: mysql-stress-test.pl
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: abort-on-error option
-.\" abort-on-error option: mysql-stress-test.pl
\fB\-\-abort\-on\-error=\fR\fB\fIN\fR\fR
.sp
Causes the program to abort if an error with severity less than or equal to N was encountered\&. Set to 1 to abort on any error\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: check-tests-file option
-.\" check-tests-file option: mysql-stress-test.pl
\fB\-\-check\-tests\-file\fR
.sp
Periodically check the file that lists the tests to be run\&. If it has been modified, reread the file\&. This can be useful if you update the list of tests to be run during a stress test\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: cleanup option
-.\" cleanup option: mysql-stress-test.pl
\fB\-\-cleanup\fR
.sp
Force cleanup of the working directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: log-error-details option
-.\" log-error-details option: mysql-stress-test.pl
\fB\-\-log\-error\-details\fR
.sp
Log error details in the global error log file\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: loop-count option
-.\" loop-count option: mysql-stress-test.pl
\fB\-\-loop\-count=\fR\fB\fIN\fR\fR
.sp
In sequential test mode, the number of loops to execute before exiting\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: mysqltest option
-.\" mysqltest option: mysql-stress-test.pl
\fB\-\-mysqltest=\fR\fB\fIpath\fR\fR
.sp
The path name to the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-database option
-.\" server-database option: mysql-stress-test.pl
\fB\-\-server\-database=\fR\fB\fIdb_name\fR\fR
.sp
The database to use for the tests\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-host option
-.\" server-host option: mysql-stress-test.pl
\fB\-\-server\-host=\fR\fB\fIhost_name\fR\fR
.sp
The host name of the local host to use for making a TCP/IP connection to the local server\&. By default, the connection is made to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-logs-dir option
-.\" server-logs-dir option: mysql-stress-test.pl
\fB\-\-server\-logs\-dir=\fR\fB\fIpath\fR\fR
.sp
This option is required\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-password option
-.\" server-password option: mysql-stress-test.pl
\fB\-\-server\-password=\fR\fB\fIpassword\fR\fR
.sp
The password to use when connecting to the server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-port option
-.\" server-port option: mysql-stress-test.pl
\fB\-\-server\-port=\fR\fB\fIport_num\fR\fR
.sp
The TCP/IP port number to use for connecting to the server\&. The default is 3306\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-socket option
-.\" server-socket option: mysql-stress-test.pl
\fB\-\-server\-socket=\fR\fB\fIfile_name\fR\fR
.sp
For connections to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: server-user option
-.\" server-user option: mysql-stress-test.pl
\fB\-\-server\-user=\fR\fB\fIuser_name\fR\fR
.sp
The MySQL user name to use when connecting to the server\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: sleep-time option
-.\" sleep-time option: mysql-stress-test.pl
\fB\-\-sleep\-time=\fR\fB\fIN\fR\fR
.sp
The delay in seconds between test executions\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-basedir option
-.\" stress-basedir option: mysql-stress-test.pl
\fB\-\-stress\-basedir=\fR\fB\fIpath\fR\fR
.sp
This option is required\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-datadir option
-.\" stress-datadir option: mysql-stress-test.pl
\fB\-\-stress\-datadir=\fR\fB\fIpath\fR\fR
.sp
The directory of data files to be used during testing\&. The default location is the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-init-file option
-.\" stress-init-file option: mysql-stress-test.pl
\fB\-\-stress\-init\-file[=\fR\fB\fIpath\fR\fR\fB]\fR
.sp
\fIfile_name\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-mode option
-.\" stress-mode option: mysql-stress-test.pl
\fB\-\-stress\-mode=\fR\fB\fImode\fR\fR
.sp
This option indicates the test order in stress\-test mode\&. The
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-suite-basedir option
-.\" stress-suite-basedir option: mysql-stress-test.pl
\fB\-\-stress\-suite\-basedir=\fR\fB\fIpath\fR\fR
.sp
This option is required\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: stress-tests-file option
-.\" stress-tests-file option: mysql-stress-test.pl
\fB\-\-stress\-tests\-file[=\fR\fB\fIfile_name\fR\fR\fB]\fR
.sp
Use this option to run the stress tests\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: suite option
-.\" suite option: mysql-stress-test.pl
\fB\-\-suite=\fR\fB\fIsuite_name\fR\fR
.sp
Run the named test suite\&. The default name is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: test-count option
-.\" test-count option: mysql-stress-test.pl
\fB\-\-test\-count=\fR\fB\fIN\fR\fR
.sp
The number of tests to execute before exiting\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: test-duration option
-.\" test-duration option: mysql-stress-test.pl
\fB\-\-test\-duration=\fR\fB\fIN\fR\fR
.sp
The duration of stress testing in seconds\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: threads option
-.\" threads option: mysql-stress-test.pl
\fB\-\-threads=\fR\fB\fIN\fR\fR
.sp
The number of threads\&. The default is 1\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-stress-test.pl: verbose option
-.\" verbose option: mysql-stress-test.pl
\fB\-\-verbose\fR
.sp
Verbose mode\&. Print more information about what the program does\&.
'\" t
.\" Title: \fBmysql-test-run.pl\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL
.\" Language: English
.\"
-.TH "\FBMYSQL\-TEST\-RUN\" "1" "03/02/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL\-TEST\-RUN\" "1" "08/25/2016" "MySQL" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql-test-run.pl
.SH "NAME"
mysql-test-run.pl \- run MySQL test suite
.SH "SYNOPSIS"
with anything in between\&. In the latter case, the pattern match is not anchored to the beginning of the test name, so it also matches names such as
xmainytesta\&.
.PP
-From MySQL 5\&.7 it is possible to put a list of test names in a file and have
+As of MySQL 5\&.7, it is possible to put a list of test names in a file and have
\fBmysql\-test\-run\&.pl\fR
run those tests, using the option
\fB\-\-do\-test\-list=\fR\fB\fIfile\fR\fR\&. The tests should be listed one per line in the file, using the fully qualified name
#
indicates a comment and is ignored\&.
.PP
+As of MySQL 8\&.0,
+\fBmysql\-test\-run\&.pl\fR
+supports a
+\fB\-\-do\-suite\fR
+option, which is similar to
+\fB\-\-do\-test\fR
+but permits specifying entire suites of tests to run\&.
+.PP
To perform setup prior to running tests,
\fBmysql\-test\-run\&.pl\fR
needs to invoke
\fBmysql\-test\-run\&.pl\fR, others are set by
\fBmysql\-test\-run\&.pl\fR
instead, and may be referred to in tests\&.
-.\" MTR_MEM environment variable
-.\" environment variable: MTR_MEM
-.\" MTR_PARALLEL environment variable
-.\" environment variable: MTR_PARALLEL
-.\" MTR_BUILD_THREAD environment variable
-.\" environment variable: MTR_BUILD_THREAD
-.\" MTR_PORT_BASE environment variable
-.\" environment variable: MTR_PORT_BASE
-.\" MTR_TESTCASE_TIMEOUT environment variable
-.\" environment variable: MTR_TESTCASE_TIMEOUT
-.\" MTR_SUITE_TIMEOUT environment variable
-.\" environment variable: MTR_SUITE_TIMEOUT
-.\" MTR_START_TIMEOUT environment variable
-.\" environment variable: MTR_START_TIMEOUT
-.\" MTR_SHUTDOWN_TIMEOUT environment variable
-.\" environment variable: MTR_SHUTDOWN_TIMEOUT
-.\" MTR_CTEST_TIMEOUT environment variable
-.\" environment variable: MTR_CTEST_TIMEOUT
-.\" MYSQL_CONFIG_EDITOR environment variable
-.\" environment variable: MYSQL_CONFIG_EDITOR
-.\" MYSQL_TEST environment variable
-.\" environment variable: MYSQL_TEST
-.\" MYSQL_TEST_LOGIN_FILE environment variable
-.\" environment variable: MYSQL_TEST_LOGIN_FILE
-.\" MYSQLD_BOOTSTRAP environment variable
-.\" environment variable: MYSQLD_BOOTSTRAP
-.\" MYSQLD_BOOTSTRAP_CMD environment variable
-.\" environment variable: MYSQLD_BOOTSTRAP_CMD
-.\" MYSQLD environment variable
-.\" environment variable: MYSQLD
-.\" MYSQLD_CMD environment variable
-.\" environment variable: MYSQLD_CMD
-.\" MYSQLTEST_VARDIR environment variable
-.\" environment variable: MYSQLTEST_VARDIR
-.\" MYSQL_TEST_DIR environment variable
-.\" environment variable: MYSQL_TEST_DIR
-.\" MYSQL_TMP_DIR environment variable
-.\" environment variable: MYSQL_TMP_DIR
.TS
allbox tab(:);
lB lB.
l l
l l
l l
+l l
l l.
T{
+MTR_BUILD_THREAD
+T}:T{
+If set, defines which port number range is used for the server
+T}
+T{
MTR_MEM
T}:T{
If set to anything, will run tests with files in "memory" using tmpfs or
\fB\-\-mem\fR option
T}
T{
-MTR_PARALLEL
-T}:T{
-If set, defines number of parallel threads executing tests\&. Same as
- \fB\-\-parallel\fR option
-T}
-T{
-MTR_BUILD_THREAD
-T}:T{
-If set, defines which port number range is used for the server
-T}
-T{
-MTR_PORT_BASE
+MTR_MAX_PARALLEL
T}:T{
-If set, defines which port number range is used for the server
+If set, defines maximum number of parallel threads if
+ \fB\-\-parallel=auto\fR is given
T}
T{
MTR_\fINAME\fR_TIMEOUT
MySQL 5\&.8\&.0\&.
T}
T{
+MTR_PARALLEL
+T}:T{
+If set, defines number of parallel threads executing tests\&. Same as
+ \fB\-\-parallel\fR option
+T}
+T{
+MTR_PORT_BASE
+T}:T{
+If set, defines which port number range is used for the server
+T}
+T{
MYSQL_CONFIG_EDITOR
T}:T{
Path name to \fBmysql_config_editor\fR binary\&. Supported as
Path name to \fBmysqltest\fR binary
T}
T{
+MYSQL_TEST_DIR
+T}:T{
+Full path to the mysql\-test directory where tests
+ are being run from
+T}
+T{
MYSQL_TEST_LOGIN_FILE
T}:T{
Path name to login file used by \fBmysql_config_editor\fR\&.
Windows\&. Supported as of MySQL 5\&.6\&.6\&.
T}
T{
+MYSQL_TMP_DIR
+T}:T{
+Path to temp directory used for temporary files during tests
+T}
+T{
+MYSQLD
+T}:T{
+Full path to server executable used in tests\&. Supported as of MySQL
+ 5\&.5\&.17\&.
+T}
+T{
MYSQLD_BOOTSTRAP
T}:T{
Full path name to \fBmysqld\fR that has all options enabled
Full command line used for initial database setup for this test batch
T}
T{
-MYSQLD
-T}:T{
-Full path to server executable used in tests\&. Supported as of MySQL
- 5\&.5\&.17\&.
-T}
-T{
MYSQLD_CMD
T}:T{
Command line for starting server as used in tests, with the minimum set
Path name to the var directory that is used for
logs, temporary files, and so forth
T}
-T{
-MYSQL_TEST_DIR
-T}:T{
-Full path to the mysql\-test directory where tests
- are being run from
-T}
-T{
-MYSQL_TMP_DIR
-T}:T{
-Path to temp directory used for temporary files during tests
-T}
.TE
.sp 1
.PP
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: help option
-.\" help option: mysql-test-run.pl
\fB\-\-help\fR,
\fB\-h\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: big-test option
-.\" big-test option: mysql-test-run.pl
\fB\-\-big\-test\fR
.sp
Allow tests marked as "big" to run\&. Tests can be thus marked by including the line
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: boot-dbx option
-.\" boot-dbx option: mysql-test-run.pl
\fB\-\-boot\-dbx\fR
.sp
Run the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: boot-ddd option
-.\" boot-ddd option: mysql-test-run.pl
\fB\-\-boot\-ddd\fR
.sp
Run the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: boot-gdb option
-.\" boot-gdb option: mysql-test-run.pl
\fB\-\-boot\-gdb\fR
.sp
Run the
server used for bootstrapping the database through the
\fBgdb\fR
debugger\&. This option is available from MySQL 5\&.5\&.17\&.
+.sp
+See also the
+\fB\-\-manual\-boot\-gdb\fR
+option\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: build-thread option
-.\" build-thread option: mysql-test-run.pl
\fB\-\-build\-thread=\fR\fB\fInumber\fR\fR
.sp
Specify a number to calculate port numbers from\&. The formula is 10 *
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: callgrind option
-.\" callgrind option: mysql-test-run.pl
\fB\-\-callgrind\fR
.sp
Instructs
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: check-testcases option
-.\" check-testcases option: mysql-test-run.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: clean-vardir option
-.\" clean-vardir option: mysql-test-run.pl
\fB\-\-clean\-vardir\fR
.sp
Clean up the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-bindir option
-.\" client-bindir option: mysql-test-run.pl
\fB\-\-client\-bindir=\fR\fB\fIpath\fR\fR
.sp
The path to the directory where client binaries are located\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-dbx option
-.\" client-dbx option: mysql-test-run.pl
\fB\-\-client\-dbx\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-ddd option
-.\" client-ddd option: mysql-test-run.pl
\fB\-\-client\-ddd\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-debugger option
-.\" client-debugger option: mysql-test-run.pl
\fB\-\-client\-debugger=\fR\fB\fIdebugger\fR\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-gdb option
-.\" client-gdb option: mysql-test-run.pl
\fB\-\-client\-gdb\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: client-libdir option
-.\" client-libdir option: mysql-test-run.pl
\fB\-\-client\-libdir=\fR\fB\fIpath\fR\fR
.sp
The path to the directory where client libraries are located\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: combination option
-.\" combination option: mysql-test-run.pl
\fB\-\-combination=\fR\fB\fIvalue\fR\fR
.sp
Extra option to pass to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: comment option
-.\" comment option: mysql-test-run.pl
\fB\-\-comment=\fR\fB\fIstr\fR\fR
.sp
Write
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: compress option
-.\" compress option: mysql-test-run.pl
\fB\-\-compress\fR
.sp
Compress all information sent between the client and the server if both support compression\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: cursor-protocol option
-.\" cursor-protocol option: mysql-test-run.pl
\fB\-\-cursor\-protocol\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: dbx option
-.\" gdb option: mysql-test-run.pl
\fB\-\-dbx\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: ddd option
-.\" ddd option: mysql-test-run.pl
\fB\-\-ddd\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debug option
-.\" debug option: mysql-test-run.pl
\fB\-\-debug\fR
.sp
Dump trace output for all clients and servers\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debugger option
-.\" debugger option: mysql-test-run.pl
\fB\-\-debugger=\fR\fB\fIdebugger\fR\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debug-common option
-.\" debug-common option: mysql-test-run.pl
\fB\-\-debug\-common\fR
.sp
This option works similar to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debug-server option
-.\" debug-server option: mysql-test-run.pl
\fB\-\-debug\-server\fR
.sp
Runs
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: debug-sync-timeout option
-.\" debug-sync-timeout option: mysql-test-run.pl
\fB\-\-debug\-sync\-timeout=\fR\fB\fIseconds\fR\fR
.sp
Controls whether the Debug Sync facility for testing and debugging is enabled\&. The option value is a timeout in seconds\&. The default value is 300\&. A value of 0 disables Debug Sync\&. The value of this option also becomes the default timeout for individual synchronization points\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: default-myisam option
-.\" default-myisam option: mysql-test-run.pl
\fB\-\-default\-myisam\fR
.sp
Use MyISAM as default engine for all except InnoDB\-specific tests\&. This option is on by default in MySQL 5\&.5 and 5\&.6 but it off by default from MySQL 5\&.7\&. See also
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: defaults-file option
-.\" default-file option: mysql-test-run.pl
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use the named file as fixed config file template for all tests\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: defaults_extra_file option
-.\" default_extra_file option: mysql-test-run.pl
\fB\-\-defaults_extra_file=\fR\fB\fIfile_name\fR\fR
.sp
Add setting from the named file to all generated configs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: do-test option
-.\" do-test option: mysql-test-run.pl
-\fB\-\-do\-test=\fR\fB\fIprefix\fR\fR
+\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
+\fIprefix\fR
+value or matches the regular expression\&. If the argument matches no existing suites,
+\fBmysql\-test\-run\&.pl\fR
+aborts\&.
+.sp
+The argument for the
+\fB\-\-do\-suite\fR
+option allows more flexible specification of which tests to perform\&. See the description of the
+\fB\-\-do\-test\fR
+option for details\&.
+.sp
+The
+\fB\-\-do\-suite\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\-\-do\-test=\fR\fB\fIprefix or regex\fR\fR
.sp
Run all test cases having a name that begins with the given
\fIprefix\fR
-value\&. This option provides a convenient way to run a family of similarly named tests\&.
+value or matches the regular expression\&. This option provides a convenient way to run a family of similarly named tests\&.
.sp
The argument for the
\fB\-\-do\-test\fR
-option also allows more flexible specification of which tests to perform\&. If the argument contains a pattern metacharacter other than a lone period, it is interpreted as a Perl regular expression and applies to test names that match the pattern\&. If the argument contains a lone period or does not contain any pattern metacharacters, it is interpreted the same way as previously and matches test names that begin with the argument value\&. For example,
+option allows more flexible specification of which tests to perform\&. If the argument contains a pattern metacharacter other than a lone period, it is interpreted as a Perl regular expression and applies to test names that match the pattern\&. If the argument contains a lone period or does not contain any pattern metacharacters, it is interpreted the same way as previously and matches test names that begin with the argument value\&. For example,
\fB\-\-do\-test=testa\fR
matches tests that begin with
testa,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: do-test-list option
-.\" do-test-list option: mysql-test-run.pl
\fB\-\-do\-testlist=\fR\fB\fIfile\fR\fR
.sp
Run all tests listed in the file
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: embedded-server option
-.\" embedded-server option: mysql-test-run.pl
\fB\-\-embedded\-server\fR
.sp
Use a version of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: enable-disabled option
-.\" enable-disabled option: mysql-test-run.pl
\fB\-\-enable\-disabled\fR
.sp
Ignore any
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: experimental option
-.\" experimental option: mysql-test-run.pl
\fB\-\-experimental=\fR\fB\fIfile_name\fR\fR
.sp
Specify a file that contains a list of test cases that should be displayed with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: explain-protocol option
-.\" explain-protocol option: mysql-test-run.pl
\fB\-\-explain\-protocol\fR,
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: extern option
-.\" extern option: mysql-test-run.pl
\fB\-\-extern\fR
\fIoption\fR=\fIvalue\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: fast option
-.\" fast option: mysql-test-run.pl
\fB\-\-fast\fR
.sp
Do not perform controlled shutdown when servers need to be restarted or at the end of the test run\&. This is equivalent to using
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: force option
-.\" force option: mysql-test-run.pl
\fB\-\-force\fR
.sp
Normally,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: force-restart option
-.\" force-restart option: mysql-test-run.pl
\fB\-\-force\-restart\fR
.sp
Always restart the server(s) between each tast case, whether it\*(Aqs needed or not\&. Will also restart between repeated runs of the same test case\&. This may be useful e\&.g\&. when looking for the source of a memory leak, as there will only have been one test run before the server exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: gcov option
-.\" gcov option: mysql-test-run.pl
\fB\-\-gcov\fR
.sp
Run tests with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: gdb option
-.\" gdb option: mysql-test-run.pl
\fB\-\-gdb\fR
.sp
Start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: gprof option
-.\" gprof option: mysql-test-run.pl
\fB\-\-gprof\fR
.sp
Run tests with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: include-ndbcluster option
-.\" include-ndbcluster option: mysql-test-run.pl
\fB\-\-include\-ndbcluster\fR,
-.\" mysql-test-run.pl: include-ndb option
-.\" include-ndb option: mysql-test-run.pl
\fB\-\-include\-ndb\fR
.sp
Run also tests that need Cluster\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: json-explain-protocol option
-.\" json-explain-protocol option: mysql-test-run.pl
\fB\-\-json\-explain\-protocol\fR,
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: manual-dbx option
-.\" manual-dbx option: mysql-test-run.pl
+\fB\-\-manual\-boot\-gdb\fR
+.sp
+This option is similar to
+\fB\-\-boot\-gdb\fR
+but attaches the debugger to the server during the bootstrapping process, permitting the use of a remote debugger\&. This option is available from MySQL 5\&.7\&.14\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
\fB\-\-manual\-dbx\fR
.sp
Use a server that has already been started by the user in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: manual-ddd option
-.\" manual-ddd option: mysql-test-run.pl
\fB\-\-manual\-ddd\fR
.sp
Use a server that has already been started by the user in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: manual-debug option
-.\" manual-debug option: mysql-test-run.pl
\fB\-\-manual\-debug\fR
.sp
Use a server that has already been started by the user in a debugger\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: manual-gdb option
-.\" manual-gdb option: mysql-test-run.pl
\fB\-\-manual\-gdb\fR
.sp
Use a server that has already been started by the user in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mark-progress option
-.\" mark-progress option: mysql-test-run.pl
\fB\-\-mark\-progress\fR
.sp
Marks progress with timing (in milliseconds) and line number in
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: max-connections option
-.\" max-connections option: mysql-test-run.pl
\fB\-\-max\-connections=\fR\fB\fInum\fR\fR
.sp
The maximum number of simultaneous server connections that may be used per test\&. If not set, the maximum is 128\&. Minimum allowed limit is 8, maximum is 5120\&. Corresponds to the same option for
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: max-save-core option
-.\" max-save-core option: mysql-test-run.pl
\fB\-\-max\-save\-core=\fR\fB\fIN\fR\fR
.sp
Limit the number of core files saved, to avoid filling up disks in case of a frequently crashing server\&. Defaults to 5, set to 0 for no limit\&. May also be set with the environment variable
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: max-save-datadir option
-.\" max-save-datadir option: mysql-test-run.pl
\fB\-\-max\-save\-datadir=\fR\fB\fIN\fR\fR
.sp
Limit the number of data directories saved after failed tests, to avoid filling up disks in case of frequent failures\&. Defaults to 20, set to 0 for no limit\&. May also be set with the environment variable
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: max-test-fail option
-.\" max-test-fail option: mysql-test-run.pl
\fB\-\-max\-test\-fail=\fR\fB\fIN\fR\fR
.sp
Stop execution after the specified number of tests have failed, to avoid using up resources (and time) in case of massive failures\&. retries are noe counted, nor are failures of tests marked experimental\&. Defaults to 10, set to 0 for no limit\&. May also be set with the environment variable
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mem option
-.\" mem option: mysql-test-run.pl
\fB\-\-mem\fR
.sp
This option is not supported on Windows\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mysqld option
-.\" mysqld option: mysql-test-run.pl
\fB\-\-mysqld=\fR\fB\fIvalue\fR\fR
.sp
Extra option to pass to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mysqld-env option
-.\" mysqld-env option: mysql-test-run.pl
\fB\-\-mysqld\-env=\fR\fB\fIvariable\fR\fR\fB=\fR\fB\fIvalue\fR\fR
.sp
Sets (or changes) an environment variable before starting
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: mysqltest option
-.\" mysqltest option: mysql-test-run.pl
\fB\-\-mysqltest=\fR\fB\fIoptions\fR\fR
.sp
Extra options to pass to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: ndb-connectstring option
-.\" ndb-connectstring option: mysql-test-run.pl
\fB\-\-ndb\-connectstring=\fR\fB\fIstr\fR\fR
.sp
Pass
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: nocheck-testcases option
-.\" nocheck-testcases option: mysql-test-run.pl
\fB\-\-nocheck\-testcases\fR
.sp
Disable the check for test case side effects; see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: nodefault-myisam option
-.\" nodefault-myisam option: mysql-test-run.pl
\fB\-\-nodefault\-myisam\fR
.sp
For MySQL 5\&.5 or 5\&.6, do not override the build\-in default engine to use MyISAM instead for non\-InnoDB tests\&. Since the existing collection of tests were originally adapted for MyISAM as default, many tests will fail when this option is used, because the test behaves differently or produces different output when the engine switches to InnoDB\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: noreorder option
-.\" noreorder option: mysql-test-run.pl
\fB\-\-noreorder\fR
.sp
Do not reorder tests to reduce number of restarts, but run them in exactly the order given\&. If a whole suite is to be run, the tests are run in alphabetic order, though similiar combinations will be grouped together\&. If more than one suite is listed, the tests are run one suite at a time, in the order listed\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: notimer option
-.\" notimer option: mysql-test-run.pl
\fB\-\-notimer\fR
.sp
Cause
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: nounit-tests option
-.\" nounit-tests option: mysql-test-run.pl
\fB\-\-nounit\-tests\fR
.sp
Do not run unit tests, overriding default behavior or setting of the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: nowarnings option
-.\" nowarnings option: mysql-test-run.pl
\fB\-\-nowarnings\fR
.sp
Do not look for and report errors and warning in the server logs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: parallel option
-.\" parallel option: mysql-test-run.pl
\fB\-\-parallel={\fR\fB\fIN\fR\fR\fB|auto}\fR
.sp
Run tests using
\fIN\fR
parallel threads\&. By default, 1 thread is used\&. Use
\fB\-\-parallel=auto\fR
-for auto\-setting of
-\fIN\fR\&.
+to set
+\fIN\fR
+automatically\&.
+.sp
+Setting the
+MTR_PARALLEL
+environment variable to
+\fIN\fR
+has the same effect as specifying
+\fB\-\-parallel=\fR\fB\fIN\fR\fR\&.
+.sp
+The
+MTR_MAX_PARALLEL
+environment variable, if set, specifies the maximum number of parallel workers that can be spawned when the
+\fB\-\-parallel=auto\fR
+option is specified\&. If
+\fB\-\-parallel=auto\fR
+is not specified,
+MTR_MAX_PARALLEL
+variable has no effect\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: port-base option
-.\" port-base option: mysql-test-run.pl
\fB\-\-port\-base=\fR\fB\fIP\fR\fR
.sp
Specify base of port numbers to be used; a block of 10 will be allocated\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: print-testcases option
-.\" print-testcases option: mysql-test-run.pl
\fB\-\-print\-testcases\fR
.sp
Do not run any tests, but print details about all tests, in the order they would have been run\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: ps-protocol option
-.\" ps-protocol option: mysql-test-run.pl
\fB\-\-ps\-protocol\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: record option
-.\" record option: mysql-test-run.pl
\fB\-\-record\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: reorder option
-.\" reorder option: mysql-test-run.pl
\fB\-\-reorder\fR
.sp
Reorder tests to minimize the number of server restarts needed\&. This is the default behavior\&. There is no guarantee that a particular set of tests will always end up in the same order\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: repeat option
-.\" repeat option: mysql-test-run.pl
\fB\-\-repeat=\fR\fB\fIN\fR\fR
.sp
Run each test
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: report-features option
-.\" report-features option: mysql-test-run.pl
\fB\-\-report\-features\fR
.sp
Display the output of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: report-times option
-.\" report-times option: mysql-test-run.pl
\fB\-\-report\-times\fR
.sp
At the end of the test run, write a summary of how much time was spent in various phases of execution\&. If you run with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: retry option
-.\" retry option: mysql-test-run.pl
\fB\-\-retry=\fR\fB\fIN\fR\fR
.sp
If a test fails, it is retried up to a maximum of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: retry-failure option
-.\" retry-failure option: mysql-test-run.pl
\fB\-\-retry\-failure=\fR\fB\fIN\fR\fR
.sp
Allow a failed and retried test to fail more than the default 2 times before giving it up\&. Setting it to 0 or 1 effectively turns off retries
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: shutdown-timeout option
-.\" shutdown-timeout option: mysql-test-run.pl
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-combinations option
-.\" skip-combinations option: mysql-test-run.pl
\fB\-\-skip\-combinations\fR
.sp
Do not apply combinations; ignore combinations file or option\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-ndbcluster option
-.\" skip-ndbcluster option: mysql-test-run.pl
\fB\-\-skip\-ndbcluster\fR,
-.\" mysql-test-run.pl: skip-ndb option
-.\" skip-ndb option: mysql-test-run.pl
\fB\-\-skip\-ndb\fR
.sp
Do not start NDB Cluster; skip Cluster test cases\&. This option only has effect if you do have NDB, if not it will have no effect as it cannot run those tests anyway\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-ndbcluster-slave option
-.\" skip-ndbcluster-slave option: mysql-test-run.pl
\fB\-\-skip\-ndbcluster\-slave\fR,
-.\" mysql-test-run.pl: skip-ndb-slave option
-.\" skip-ndb-slave option: mysql-test-run.pl
\fB\-\-skip\-ndb\-slave\fR
.sp
Do not start an NDB Cluster slave\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-rpl option
-.\" skip-rpl option: mysql-test-run.pl
\fB\-\-skip\-rpl\fR
.sp
Skip replication test cases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-ssl option
-.\" skip-ssl option: mysql-test-run.pl
\fB\-\-skip\-ssl\fR
.sp
Do not start
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-test option
-.\" skip-test option: mysql-test-run.pl
\fB\-\-skip\-test=\fR\fB\fIregex\fR\fR
.sp
Specify a regular expression to be applied to test case names\&. Cases with names that match the expression are skipped\&. tests to skip\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: skip-test-list option
-.\" skip-test-list option: mysql-test-run.pl
\fB\-\-skip\-test\-list=\fR\fB\fIfile\fR\fR
.sp
Specify a file listing tests that should be skipped (disabled)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: sleep option
-.\" sleep option: mysql-test-run.pl
\fB\-\-sleep=\fR\fB\fIN\fR\fR
.sp
Pass
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: sp-protocol option
-.\" sp-protocol option: mysql-test-run.pl
\fB\-\-sp\-protocol\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: ssl option
-.\" ssl option: mysql-test-run.pl
\fB\-\-ssl\fR
.sp
If
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: start option
-.\" start option: mysql-test-run.pl
\fB\-\-start\fR
.sp
Initialize and start servers with the startup settings for the specified test case\&. You can use this option to start a server to which you can connect later\&. For example, after building a source distribution you can start a server and connect to it with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: start-and-exit option
-.\" start-and-exit option: mysql-test-run.pl
\fB\-\-start\-and\-exit\fR
.sp
This is similar to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: start-dirty option
-.\" start-dirty option: mysql-test-run.pl
\fB\-\-start\-dirty\fR
.sp
This is similar to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: start-from option
-.\" start-from option: mysql-test-run.pl
\fB\-\-start\-from=\fR\fB\fItest_name\fR\fR
.sp
\fBmysql\-test\-run\&.pl\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: strace-client option
-.\" strace-client option: mysql-test-run.pl
\fB\-\-strace\-client\fR
.sp
Create
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: strace-server option
-.\" strace-server option: mysql-test-run.pl
\fB\-\-strace\-server\fR
.sp
Create
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: stress option
-.\" stress option: mysql-test-run.pl
\fB\-\-stress=\fR\fB\fIstress options\fR\fR
.sp
Start a server, but instead of running a test, run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: suite option
-.\" suite option: mysql-test-run.pl
\fB\-\-suite=\fR\fB\fIsuite_name\fR\fR
.sp
Run the named test suite\&. The default name is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: suite-timeout option
-.\" suite-timeout option: mysql-test-run.pl
\fB\-\-suite\-timeout=\fR\fB\fIminutes\fR\fR
.sp
Specify the maximum test suite runtime in minutes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: testcase-timeout option
-.\" testcase-timeout option: mysql-test-run.pl
\fB\-\-testcase\-timeout=\fR\fB\fIminutes\fR\fR
.sp
Specify the maximum test case runtime in minutes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: timediff option
-.\" timediff option: mysql-test-run.pl
\fB\-\-timediff\fR
.sp
Adds to each test report for a test case, the total time in sconds and milliseconds passed since the preceding test ended\&. This option can only be used together with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: timer option
-.\" timer option: mysql-test-run.pl
\fB\-\-timer\fR
.sp
Cause
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: timestamp option
-.\" timestamp option: mysql-test-run.pl
\fB\-\-timestamp\fR
.sp
Prints a timestamp before the test case name in each test report line, showing when the test ended\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: tmpdir option
-.\" tmpdir option: mysql-test-run.pl
\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR
.sp
The directory where temporary file are stored\&. The default location is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: unit-tests option
-.\" unit-tests option: mysql-test-run.pl
\fB\-\-unit\-tests\fR
.sp
Force running of unit tests, overriding default behavior or setting of the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: unit-tests-report option
-.\" unit-tests-report option: mysql-test-run.pl
\fB\-\-unit\-tests\-report\fR
.sp
Extend the unit test run by also outputting the log from the test run, independently of whether it succeeded or not\&. This option implies
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: user option
-.\" user option: mysql-test-run.pl
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The MySQL user name to use when connecting to the server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: user-args option
-.\" user-args option: mysql-test-run.pl
\fB\-\-user\-args\fR
.sp
Drops all non\-essential command line arguments to the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind option
-.\" valgrind option: mysql-test-run.pl
\fB\-\-valgrind\fR
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-clients option
-.\" valgrind-clients option: mysql-test-run.pl
\fB\-\-valgrind\-clients\fR
.sp
Run all clients started by
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-mysqld option
-.\" valgrind-mysqld option: mysql-test-run.pl
\fB\-\-valgrind\-mysqld\fR
.sp
Run the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-mysqltest option
-.\" valgrind-mysqltest option: mysql-test-run.pl
\fB\-\-valgrind\-mysqltest\fR
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-options option
-.\" valgrind-options option: mysql-test-run.pl
\fB\-\-valgrind\-option=\fR\fB\fIstr\fR\fR
.sp
Extra options to pass to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: valgrind-path option
-.\" valgrind-path option: mysql-test-run.pl
\fB\-\-valgrind\-path=\fR\fB\fIpath\fR\fR
.sp
Specify the path name to the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: vardir option
-.\" vardir option: mysql-test-run.pl
\fB\-\-vardir=\fR\fB\fIpath\fR\fR
.sp
Specify the path where files generated during the test run are stored\&. The default location is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: verbose option
-.\" verbose option: mysql-test-run.pl
\fB\-\-verbose\fR
.sp
Give more verbose output regarding test execution\&. Use the option twice to get even more output\&. Note that the output generated within each test case is not affected\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: verbose-restart option
-.\" verbose-restart option: mysql-test-run.pl
\fB\-\-verbose\-restart\fR
.sp
Write when and why servers are restarted between test cases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: view-protocol option
-.\" view-protocol option: mysql-test-run.pl
\fB\-\-view\-protocol\fR
.sp
Pass the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: vs-config option
-.\" vs-config option: mysql-test-run.pl
\fB\-\-vs\-config=\fR\fB\fIconfig_val\fR\fR
.sp
Specify the configuration used to build MySQL (for example,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: wait-all option
-.\" wait-all option: mysql-test-run.pl
\fB\-\-wait\-all\fR
.sp
If
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: warnings option
-.\" warnings option: mysql-test-run.pl
\fB\-\-warnings\fR
.sp
Search the server log for errors or warning after each test and report any suspicious ones; if any are found, the test will be marked as failed\&. This is the default behavior, it may be turned off with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql-test-run.pl: with-ndbcluster-only option
-.\" with-ndbcluster-only option: mysql-test-run.pl
\fB\-\-with\-ndbcluster\-only\fR
.sp
Run only test cases that have
'\" t
.\" Title: \fBmysql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql
-.\" command-line tool
-.\" tools: command-line
-.\" scripts: SQL
-.\" SQL scripts
-.\" batch SQL files
.SH "NAME"
mysql \- the MySQL command\-line tool
.SH "SYNOPSIS"
client logs statements executed interactively to a history file\&. See
the section called \(lqMYSQL LOGGING\(rq\&.
.SH "MYSQL OPTIONS"
-.\" mysql command options
-.\" command options: mysql
-.\" options: command-line: mysql
-.\" startup parameters: mysql
.PP
\fBmysql\fR
supports the following options, which can be specified on the command line or in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: help option
-.\" help option: mysql
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: auto-rehash option
-.\" auto-rehash option: mysql
\fB\-\-auto\-rehash\fR
.sp
Enable automatic rehashing\&. This option is on by default, which enables database, table, and column name completion\&. Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: auto-vertical-output option
-.\" auto-vertical-output option: mysql
\fB\-\-auto\-vertical\-output\fR
.sp
Cause result sets to be displayed vertically if they are too wide for the current window, and using normal tabular format otherwise\&. (This applies to statements terminated by
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: batch option
-.\" batch option: mysql
\fB\-\-batch\fR,
\fB\-B\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: binary-mode option
-.\" binary-mode option: mysql
\fB\-\-binary\-mode\fR
.sp
This option helps when processing
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: bind-address option
-.\" bind-address option: mysql
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: character-sets-dir option
-.\" character-sets-dir option: mysql
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: column-names option
-.\" column-names option: mysql
\fB\-\-column\-names\fR
.sp
Write column names in results\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: column-type-info option
-.\" column-type-info option: mysql
\fB\-\-column\-type\-info\fR
.sp
Display result set metadata\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: comments option
-.\" comments option: mysql
\fB\-\-comments\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: compress option
-.\" compress option: mysql
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: connect-expired-password option
-.\" connect-expired-password option: mysql
\fB\-\-connect\-expired\-password\fR
.sp
Indicate to the server that the client can handle sandbox mode if the account used to connect has an expired password\&. This can be useful for noninteractive invocations of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: database option
-.\" database option: mysql
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-D \fR\fB\fIdb_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: debug option
-.\" debug option: mysql
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: debug-check option
-.\" debug-check option: mysql
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: debug-info option
-.\" debug-info option: mysql
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: default-auth option
-.\" default-auth option: mysql
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: default-character-set option
-.\" default-character-set option: mysql
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
\fIcharset_name\fR
as the default character set for the client and connection\&.
.sp
-A common issue that can occur when the operating system uses
-utf8
-or another multibyte character set is that output from the
+This option can be useful if the operating system uses one character set and the
\fBmysql\fR
-client is formatted incorrectly, due to the fact that the MySQL client uses the
-latin1
-character set by default\&. You can usually fix such issues by using this option to force the client to use the system character set instead\&.
+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
-See
-Section\ \&10.5, \(lqCharacter Set Configuration\(rq, for more information\&.
+For more information, see
+Section\ \&10.1.5, \(lqConnection Character Sets and Collations\(rq, and
+Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: defaults-extra-file option
-.\" defaults-extra-file option: mysql
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: defaults-file option
-.\" defaults-file option: mysql
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: defaults-group-suffix option
-.\" defaults-group-suffix option: mysql
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: delimiter option
-.\" delimiter option: mysql
\fB\-\-delimiter=\fR\fB\fIstr\fR\fR
.sp
Set the statement delimiter\&. The default is the semicolon character (\(lq;\(rq)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: disable named commands
-.\" disable named command: mysql
\fB\-\-disable\-named\-commands\fR
.sp
Disable named commands\&. Use the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysql
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: execute option
-.\" execute option: mysql
\fB\-\-execute=\fR\fB\fIstatement\fR\fR,
\fB\-e \fR\fB\fIstatement\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: force option
-.\" force option: mysql
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: histignore option
-.\" histignore option: mysql
\fB\-\-histignore\fR
.sp
A colon\-separated list of one or more patterns specifying statements to ignore for logging purposes\&. These patterns are added to the default pattern list ("*IDENTIFIED*:*PASSWORD*")\&. The value specified for this option affects logging of statements written to the history file\&. For more information, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: host option
-.\" host option: mysql
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: html option
-.\" html option: mysql
\fB\-\-html\fR,
\fB\-H\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: ignore-spaces option
-.\" ignore-spaces option: mysql
\fB\-\-ignore\-spaces\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: init-command option
-.\" init-command option: mysql
\fB\-\-init\-command=str\fR
.sp
SQL statement to execute after connecting to the server\&. If auto\-reconnect is enabled, the statement is executed again after reconnection occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: line-numbers option
-.\" line-numbers option: mysql
\fB\-\-line\-numbers\fR
.sp
Write line numbers for errors\&. Disable this with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: local-infile option
-.\" local-infile option: mysql
\fB\-\-local\-infile[={0|1}]\fR
.sp
Enable or disable
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: login-path option
-.\" login-path option: mysql
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: named-commands option
-.\" named-commands option: mysql
\fB\-\-named\-commands\fR,
\fB\-G\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: no-auto-rehash option
-.\" no-auto-rehash option: mysql
\fB\-\-no\-auto\-rehash\fR,
\fB\-A\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: no-beep option
-.\" no-beep option: mysql
\fB\-\-no\-beep\fR,
\fB\-b\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: no-defaults option
-.\" no-defaults option: mysql
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: one-database option
-.\" one-database option: mysql
\fB\-\-one\-database\fR,
\fB\-o\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: pager option
-.\" pager option: mysql
\fB\-\-pager[=\fR\fB\fIcommand\fR\fR\fB]\fR
.sp
Use the given command for paging query output\&. If the command is omitted, the default pager is the value of your
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: password option
-.\" password option: mysql
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: pipe option
-.\" pipe option: mysql
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: plugin-dir option
-.\" plugin-dir option: mysql
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: port option
-.\" port option: mysql
-.\" TCP/IP
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: print-defaults option
-.\" print-defaults option: mysql
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: prompt option
-.\" prompt option: mysql
\fB\-\-prompt=\fR\fB\fIformat_str\fR\fR
.sp
Set the prompt to the specified format\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: protocol option
-.\" protocol option: mysql
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: quick option
-.\" quick option: mysql
\fB\-\-quick\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: raw option
-.\" raw option: mysql
\fB\-\-raw\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: reconnect option
-.\" reconnect option: mysql
\fB\-\-reconnect\fR
.sp
If the connection to the server is lost, automatically try to reconnect\&. A single reconnect attempt is made each time the connection is lost\&. To suppress reconnection behavior, use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: safe-updates option
-.\" safe-updates option: mysql
-.\" mysql: i-am-a-dummy option
-.\" i-am-a-dummy option: mysql
\fB\-\-safe\-updates\fR,
\fB\-\-i\-am\-a\-dummy\fR,
\fB\-U\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: secure-auth option
-.\" secure-auth option: mysql
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. As of MySQL 5\&.6\&.7, this option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: server-public-key-path option
-.\" server-public-key-path option: mysql
\fB\-\-server\-public\-key\-path=\fR\fBfile_name\fR
.sp
The path name to a file containing the server RSA public key\&. The file must be in PEM format\&. The public key is used for RSA encryption of the client password for connections to the server made using accounts that authenticate with the
For additional discussion regarding use of the
sha256_password
plugin, including how to get the RSA public key, see
-Section\ \&6.4.1.4, \(lqThe SHA-256 Authentication Plugin\(rq\&.
+Section\ \&6.5.1.4, \(lqThe SHA-256 Authentication Plugin\(rq\&.
.sp
This option is available only if MySQL was built using OpenSSL\&. It was added in MySQL 5\&.6\&.6 under the name
\fB\-\-server\-public\-key\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: shared-memory-base-name option
-.\" shared-memory-base-name option: mysql
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: show-warnings option
-.\" show-warnings option: mysql
\fB\-\-show\-warnings\fR
.sp
Cause warnings to be shown after each statement if there are any\&. This option applies to interactive and batch mode\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: sigint-ignore option
-.\" sigint-ignore option: mysql
\fB\-\-sigint\-ignore\fR
.sp
Ignore
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: silent option
-.\" silent option: mysql
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: skip-column-names option
-.\" skip-column-names option: mysql
\fB\-\-skip\-column\-names\fR,
\fB\-N\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: skip-line-numbers option
-.\" skip-line-numbers option: mysql
\fB\-\-skip\-line\-numbers\fR,
\fB\-L\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: socket option
-.\" socket option: mysql
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: SSL options
-.\" SSL options: mysql
\fB\-\-ssl*\fR
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: table option
-.\" table option: mysql
\fB\-\-table\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: tee option
-.\" tee option: mysql
\fB\-\-tee=\fR\fB\fIfile_name\fR\fR
.sp
Append a copy of output to the given file\&. This option works only in interactive mode\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: unbuffered option
-.\" unbuffered option: mysql
\fB\-\-unbuffered\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: user option
-.\" user option: mysql
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: verbose option
-.\" verbose option: mysql
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: version option
-.\" version option: mysql
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: vertical option
-.\" vertical option: mysql
\fB\-\-vertical\fR,
\fB\-E\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: wait option
-.\" wait option: mysql
\fB\-\-wait\fR,
\fB\-w\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: xml option
-.\" xml option: mysql
\fB\-\-xml\fR,
\fB\-X\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" timeout: connect_timeout variable
-.\" connect_timeout variable
connect_timeout
.sp
The number of seconds before connection timeout\&. (Default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" max_allowed_packet variable
max_allowed_packet
.sp
The maximum size of the buffer for client/server communication\&. The default is 16MB, the maximum is 1GB\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" max_join_size variable
max_join_size
.sp
The automatic limit for rows in a join when using
.sp -1
.IP \(bu 2.3
.\}
-.\" net_buffer_length variable
net_buffer_length
.sp
The buffer size for TCP/IP and socket communication\&. (Default value is 16KB\&.)
.sp -1
.IP \(bu 2.3
.\}
-.\" select_limit variable
select_limit
.sp
The automatic limit for
at the
mysql>
prompt:
-.\" mysql commands: list of
.sp
.if n \{\
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: help command
-.\" help command: mysql
help [\fIarg\fR],
\eh [\fIarg\fR],
\e? [\fIarg\fR],
command,
\fBmysql\fR
uses it as a search string to access server\-side help from the contents of the MySQL Reference Manual\&. For more information, see
-the section called \(lqMYSQL SERVER-SIDE HELP\(rq\&.
+the section called \(lqMYSQL SERVER\-SIDE HELP\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: charset command
-.\" charset command: mysql
charset \fIcharset_name\fR,
\eC \fIcharset_name\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: clear command
-.\" clear command: mysql
clear,
\ec
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: connect command
-.\" connect command: mysql
connect [\fIdb_name\fR \fIhost_name\fR]],
\er [\fIdb_name\fR \fIhost_name\fR]]
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: delimiter command
-.\" delimiter command: mysql
delimiter \fIstr\fR,
\ed \fIstr\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: edit command
-.\" edit command: mysql
edit,
\ee
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: ego command
-.\" ego command: mysql
ego,
\eG
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: exit command
-.\" exit command: mysql
exit,
\eq
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: go command
-.\" go command: mysql
go,
\eg
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: nopager command
-.\" nopager command: mysql
nopager,
\en
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: notee command
-.\" notee command: mysql
notee,
\et
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: nowarning command
-.\" nowarning command: mysql
nowarning,
\ew
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: pager command
-.\" pager command: mysql
pager [\fIcommand\fR],
\eP [\fIcommand\fR]
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: print command
-.\" print command: mysql
print,
\ep
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: prompt command
-.\" prompt command: mysql
prompt [\fIstr\fR],
\eR [\fIstr\fR]
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: quit command
-.\" quit command: mysql
quit,
\eq
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: rehash command
-.\" rehash command: mysql
rehash,
\e#
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: source command
-.\" source command: mysql
source \fIfile_name\fR,
\e\&. \fIfile_name\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: status command
-.\" status command: mysql
status,
\es
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: system command
-.\" system command: mysql
system \fIcommand\fR,
\e! \fIcommand\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: tee command
-.\" tee command: mysql
tee [\fIfile_name\fR],
\eT [\fIfile_name\fR]
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: use command
-.\" use command: mysql
use \fIdb_name\fR,
\eu \fIdb_name\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql: warnings command
-.\" warnings command: mysql
warnings,
\eW
.sp
tee
file logging can be turned on and off interactively from within
\fBmysql\fR\&. This is useful when you want to log some queries to a file, but not others\&.
-.\" mysql prompt command
.PP
The
prompt
.\}
.RE
.SH "MYSQL LOGGING"
-.\" MYSQL_HISTFILE environment variable
-.\" environment variable: MYSQL_HISTFILE
-.\" MYSQL_HISTIGNORE environment variable
-.\" environment variable: MYSQL_HISTIGNORE
-.\" HOME environment variable
-.\" environment variable: HOME
-.\" mysql history file
-.\" command-line history: mysql
-.\" .mysql_history file
.PP
On Unix, the
\fBmysql\fR
.RE
.\}
.RE
-.SH "MYSQL SERVER-SIDE HELP"
+.SH "MYSQL SERVER\-SIDE HELP"
.sp
.if n \{\
.RS 4
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.10, \(lqServer-Side Help\(rq)\&.
+Section\ \&5.1.9, \(lqServer-Side Help\(rq)\&.
.PP
If there is no match for the search string, the search fails:
.sp
.RE
.\}
.SH "EXECUTING SQL STATEMENTS FROM A TEXT FILE"
-.\" executing SQL statements from text files
-.\" importing: data
-.\" data: importing
-.\" files: text
-.\" text files: importing
-.\" source (mysql client command)
-.\" \. (mysql client command)
-.\" mysql source (command for reading from text files)
-.\" mysql \. (command for reading from text files)
.PP
The
\fBmysql\fR
.RE
.\}
.SS "Using the \-\-safe\-updates Option"
-.\" safe-updates option
.PP
For beginners, a useful startup option is
\fB\-\-safe\-updates\fR
'\" t
.\" Title: \fBmysql.server\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL\&.SERVER\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL\&.SERVER\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql.server
.SH "NAME"
mysql.server \- MySQL server startup script
.SH "SYNOPSIS"
[mysql_server]
sections, but to be current you should rename such sections to
[mysql\&.server]\&.
-.\" changing: socket location
.PP
You can add options for
\fBmysql\&.server\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql.server: basedir option
-.\" basedir option: mysql.server
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL installation directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql.server: datadir option
-.\" datadir option: mysql.server
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL data directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql.server: pid-file option
-.\" pid-file option: mysql.server
\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
.sp
The path name of the file in which the server should write its process ID\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql.server: service-startup-timeout option
-.\" service-startup-timeout option: mysql.server
\fB\-\-service\-startup\-timeout=\fR\fB\fIseconds\fR\fR
.sp
How long in seconds to wait for confirmation of server startup\&. If the server does not start within this time,
'\" t
.\" Title: \fBmysql_client_test\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL
.\" Language: English
.\"
-.TH "\FBMYSQL_CLIENT_TEST" "1" "03/02/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQL_CLIENT_TEST" "1" "08/25/2016" "MySQL" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_client_test
-.\" mysql_client_test_embedded
.SH "NAME"
mysql_client_test \- test client API
.br
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: help option
-.\" help option: mysql_client_test
\fB\-\-help\fR,
\fB\-?\fR
.sp
.IP \(bu 2.3
.\}
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR,
-.\" mysql_client_test: basedir option
-.\" basedir option: mysql_client_test
\fB\-b \fR\fB\fIdir_name\fR\fR
.sp
The base directory for the tests\&.
.IP \(bu 2.3
.\}
\fB\-\-count=\fR\fB\fIcount\fR\fR,
-.\" mysql_client_test: count option
-.\" count option: mysql_client_test
\fB\-t \fR\fB\fIcount\fR\fR
.sp
The number of times to execute the tests\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: database option
-.\" database option: mysql_client_test
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-D \fR\fB\fIdb_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: debug option
-.\" debug option: mysql_client_test
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-#[\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.IP \(bu 2.3
.\}
\fB\-\-getopt\-ll\-test=\fR\fB\fIoption\fR\fR,
-.\" mysql_client_test: getopt-ll-test option
-.\" getopt-ll-test option: mysql_client_test
\fB\-g \fR\fB\fIoption\fR\fR
.sp
Option to use for testing bugs in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: host option
-.\" host option: mysql_client_test
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: password option
-.\" password option: mysql_client_test
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
have a space between the option and the password\&. If you omit the
\fIpassword\fR
value following the
-.\" mysql_client_test: password option
-.\" password option: mysql_client_test
\fB\-\-password\fR
or
\fB\-p\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: port option
-.\" port option: mysql_client_test
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.IP \(bu 2.3
.\}
\fB\-\-server\-arg=\fR\fB\fIarg\fR\fR,
-.\" mysql_client_test: server-arg option
-.\" server-arg option: mysql_client_test
\fB\-A \fR\fB\fIarg\fR\fR
.sp
Argument to send to the embedded server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: silent option
-.\" silent option: mysql_client_test
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: socket option
-.\" socket option: mysql_client_test
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_client_test: user option
-.\" user option: mysql_client_test
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.IP \(bu 2.3
.\}
\fB\-v \fR\fB\fIdir_name\fR\fR,
-.\" mysql_client_test: vardir option
-.\" vardir option: mysql_client_test
\fB\-\-vardir=\fR\fB\fIdir_name\fR\fR
.sp
The data directory for tests\&. The default is
-.so man/mysql_client_test.1
+.so mysql_client_test.1
'\" t
.\" Title: \fBmysql_config\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_CONFIG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONFIG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_config
.SH "NAME"
mysql_config \- display options for compiling clients
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: cflags option
-.\" cflags option: mysql_config
\fB\-\-cflags\fR
.sp
C Compiler flags to find include files and critical compiler flags and defines used when compiling the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: cxxflags option
-.\" cxxflags option: mysql_config
\fB\-\-cxxflags\fR
.sp
Like
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: include option
-.\" include option: mysql_config
\fB\-\-include\fR
.sp
Compiler options to find MySQL include files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: libmysqld-libs option
-.\" libmysqld-libs option: mysql_config
-.\" mysql_config: embedded option
-.\" embedded option: mysql_config
\fB\-\-libmysqld\-libs\fR,
\fB\-\-embedded\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: libs option
-.\" libs option: mysql_config
\fB\-\-libs\fR
.sp
Libraries and options required to link with the MySQL client library\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: libs_r option
-.\" libs_r option: mysql_config
\fB\-\-libs_r\fR
.sp
Libraries and options required to link with the thread\-safe MySQL client library\&. In MySQL 5\&.6, all client libraries are thread\-safe, so this option need not be used\&. The
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: plugindir option
-.\" plugindir option: mysql_config
\fB\-\-plugindir\fR
.sp
The default plugin directory path name, defined when configuring MySQL\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: port option
-.\" port option: mysql_config
-.\" TCP/IP
\fB\-\-port\fR
.sp
The default TCP/IP port number, defined when configuring MySQL\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: socket option
-.\" socket option: mysql_config
\fB\-\-socket\fR
.sp
The default Unix socket file, defined when configuring MySQL\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: variable option
-.\" variable option: mysql_config
\fB\-\-variable=\fR\fB\fIvar_name\fR\fR
.sp
Display the value of the named configuration variable\&. Permitted
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config: version option
-.\" version option: mysql_config
\fB\-\-version\fR
.sp
Version number for the MySQL distribution\&.
'\" t
.\" Title: \fBmysql_config_editor\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_CONFIG_EDIT" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONFIG_EDIT" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_config_editor
-.\" .mylogin.cnf file
.SH "NAME"
mysql_config_editor \- configure authentication information for connecting to MySQL server
.SH "SYNOPSIS"
\&.mylogin\&.cnf
in conjunction with other option files\&. Its precedence is higher than other option files, but less than options specified explicitly on the client command line\&. For information about the order in which option files are used, see
Section\ \&4.2.6, \(lqUsing Option Files\(rq\&.
-.\" MYSQL_TEST_LOGIN_FILE environment variable
-.\" environment variable: MYSQL_TEST_LOGIN_FILE
.PP
To specify an alternate login path file name, set the
MYSQL_TEST_LOGIN_FILE
.\}
With a
\fB\-\-login\-path\fR
-option, client programs additionally read the named login path from the login path ile\&. The option groups read from other option files remain the same\&. Consider this command:
+option, client programs additionally read the named login path from the login path file\&. The option groups read from other option files remain the same\&. Consider this command:
.sp
.if n \{\
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config_editor: help option
-.\" help option: mysql_config_editor
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config_editor: debug option
-.\" debug option: mysql_config_editor
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# \fR\fB\fIdebug_options\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config_editor: verbose option
-.\" verbose option: mysql_config_editor
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_config_editor: version option
-.\" version option: mysql_config_editor
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysql_convert_table_format\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_CONVERT_TAB" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_CONVERT_TAB" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_convert_table_format
.SH "NAME"
mysql_convert_table_format \- convert tables to use a given storage engine
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: help option
-.\" help option: mysql_convert_table_format
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: force option
-.\" force option: mysql_convert_table_format
\fB\-\-force\fR
.sp
Continue even if errors occur\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: host option
-.\" host option: mysql_convert_table_format
\fB\-\-host=\fR\fB\fIhost_name\fR\fR
.sp
Connect to the MySQL server on the given host\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: password option
-.\" password option: mysql_convert_table_format
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: port option
-.\" port option: mysql_convert_table_format
\fB\-\-port=\fR\fB\fIport_num\fR\fR
.sp
The TCP/IP port number to use for the connection\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: socket option
-.\" socket option: mysql_convert_table_format
\fB\-\-socket=\fR\fB\fIpath\fR\fR
.sp
For connections to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: type option
-.\" type option: mysql_convert_table_format
\fB\-\-type=\fR\fB\fIengine_name\fR\fR
.sp
Specify the storage engine that the tables should be converted to use\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: user option
-.\" user option: mysql_convert_table_format
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The MySQL user name to use when connecting to the server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: verbose option
-.\" verbose option: mysql_convert_table_format
\fB\-\-verbose\fR
.sp
Verbose mode\&. Print more information about what the program does\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_convert_table_format: version option
-.\" version option: mysql_convert_table_format
\fB\-\-version\fR
.sp
Display version information and exit\&.
'\" t
.\" Title: \fBmysql_find_rows\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_FIND_ROWS\F" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_FIND_ROWS\F" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_find_rows
.SH "NAME"
mysql_find_rows \- extract SQL statements from files
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: help option
-.\" help option: mysql_find_rows
\fB\-\-help\fR,
\fB\-\-Information\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: regexp option
-.\" regexp option: mysql_find_rows
\fB\-\-regexp=\fR\fB\fIpattern\fR\fR
.sp
Display queries that match the pattern\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: rows option
-.\" rows option: mysql_find_rows
\fB\-\-rows=\fR\fB\fIN\fR\fR
.sp
Quit after displaying
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: skip-use-db option
-.\" skip-use-db option: mysql_find_rows
\fB\-\-skip\-use\-db\fR
.sp
Do not include
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_find_rows: start_row option
-.\" start_row option: mysql_find_rows
\fB\-\-start_row=\fR\fB\fIN\fR\fR
.sp
Start output from this row\&.
'\" t
.\" Title: \fBmysql_fix_extensions\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_FIX_EXTENSI" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_FIX_EXTENSI" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_fix_extensions
.SH "NAME"
mysql_fix_extensions \- normalize table file name extensions
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysql_install_db\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_INSTALL_DB\" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_INSTALL_DB\" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_install_db
.SH "NAME"
mysql_install_db \- initialize MySQL data directory
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: help option
-.\" help option: mysql_install_db
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: basedir option
-.\" basedir option: mysql_install_db
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL installation directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: builddir option
-.\" builddir option: mysql_install_db
\fB\-\-builddir=\fR\fB\fIdir_name\fR\fR
.sp
For use with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: cross-bootstrap option
-.\" cross-bootstrap option: mysql_install_db
\fB\-\-cross\-bootstrap\fR
.sp
For internal use\&. This option is used for building system tables on one host intended for another\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: datadir option
-.\" datadir option: mysql_install_db
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL data directory\&. Beginning with MySQL 5\&.6\&.8,
.sp -1
.IP \(bu 2.3
.\}
-.\" defaults-extra-file option
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" defaults-file option
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: force option
-.\" force option: mysql_install_db
\fB\-\-force\fR
.sp
Cause
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: keep-my-cnf option
-.\" keep-my-cnf option: mysql_install_db
\fB\-\-keep\-my\-cnf\fR
.sp
Tell
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: ldata option
-.\" ldata option: mysql_install_db
\fB\-\-ldata=\fR\fB\fIdir_name\fR\fR
.sp
A synonym for
.sp -1
.IP \(bu 2.3
.\}
-.\" no-defaults option
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: random-passwords option
-.\" random-passwords option: mysql_install_db
\fB\-\-random\-passwords\fR
.sp
On Unix platforms, this option provides for more secure MySQL installation\&. Invoking
.sp -1
.IP \(bu 2.3
.\}
-.\" .mysql_secret file
The initial random
root
password is written to the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: rpm option
-.\" rpm option: mysql_install_db
\fB\-\-rpm\fR
.sp
For internal use\&. This option is used during the MySQL installation process for install operations performed using RPM packages\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: skip-name-resolve option
-.\" skip-name-resolve option: mysql_install_db
\fB\-\-skip\-name\-resolve\fR
.sp
Use IP addresses rather than host names when creating grant table entries\&. This option can be useful if your DNS does not work\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: srcdir option
-.\" srcdir option: mysql_install_db
\fB\-\-srcdir=\fR\fB\fIdir_name\fR\fR
.sp
For internal use\&. This option specifies the directory under which
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: user option
-.\" user option: mysql_install_db
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The system (login) user name to use for running
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: verbose option
-.\" verbose option: mysql_install_db
\fB\-\-verbose\fR
.sp
Verbose mode\&. Print more information about what the program does\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_install_db: windows option
-.\" windows option: mysql_install_db
\fB\-\-windows\fR
.sp
For internal use\&. This option is used for creating Windows distributions\&.
'\" t
.\" Title: \fBmysql_plugin\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_PLUGIN\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_PLUGIN\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_plugin
.SH "NAME"
mysql_plugin \- configure MySQL server plugins
.SH "SYNOPSIS"
automatically\&. For additional control over plugin activation, use
\fB\-\-\fR\fB\fIplugin_name\fR\fR
options named for specific plugins, as described in
-Section\ \&5.1.8.1, \(lqInstalling and Uninstalling Plugins\(rq\&.
+Section\ \&5.5.2, \(lqInstalling and Uninstalling Plugins\(rq\&.
.PP
Each invocation of
\fBmysql_plugin\fR
-reads a configuration file to determine how to configure the plugins contained in a single plugin library object file\&. To invoke
+reads a configuration file to determine how to configure the plugins contained in a single plugin library file\&. To invoke
\fBmysql_plugin\fR, use this syntax:
.sp
.if n \{\
.PP
The first line in the
myplugins\&.ini
-file is the name of the library object file, without any extension such as
+file is the name of the library file, without any extension such as
\&.so
or
\&.dll\&. The remaining lines are the names of the components to be enabled or disabled\&. Each value in the file should be on a separate line\&. Lines on which the first character is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: help option
-.\" help option: mysql_plugin
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: basedir option
-.\" basedir option: mysql_plugin
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR,
\fB\-b \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: datadir option
-.\" datadir option: mysql_plugin
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR,
\fB\-d \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: my-print-defaults option
-.\" my-print-defaults option: mysql_plugin
\fB\-\-my\-print\-defaults=\fR\fB\fIfile_name\fR\fR,
\fB\-b \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: mysqld option
-.\" mysqld option: mysql_plugin
\fB\-\-mysqld=\fR\fB\fIfile_name\fR\fR,
\fB\-b \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: no-defaults option
-.\" no-defaults option: mysql_plugin
\fB\-\-no\-defaults\fR,
\fB\-p\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: plugin-dir option
-.\" plugin-dir option: mysql_plugin
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR,
\fB\-p \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: plugin-ini option
-.\" plugin-ini option: mysql_plugin
\fB\-\-plugin\-ini=\fR\fB\fIfile_name\fR\fR,
\fB\-i \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: print-defaults option
-.\" print-defaults option: mysql_plugin
\fB\-\-print\-defaults\fR,
\fB\-P\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: verbose option
-.\" verbose option: mysql_plugin
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_plugin: version option
-.\" version option: mysql_plugin
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysql_secure_installation\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_SECURE_INST" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_SECURE_INST" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_secure_installation
.SH "NAME"
mysql_secure_installation \- improve MySQL installation security
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysql_setpermission\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_SETPERMISSI" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_SETPERMISSI" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_setpermission
.SH "NAME"
mysql_setpermission \- interactively set permissions in grant tables
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: help option
-.\" help option: mysql_setpermission
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: host option
-.\" host option: mysql_setpermission
\fB\-\-host=\fR\fB\fIhost_name\fR\fR
.sp
Connect to the MySQL server on the given host\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: password option
-.\" password option: mysql_setpermission
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: port option
-.\" port option: mysql_setpermission
\fB\-\-port=\fR\fB\fIport_num\fR\fR
.sp
The TCP/IP port number to use for the connection\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: socket option
-.\" socket option: mysql_setpermission
\fB\-\-socket=\fR\fB\fIpath\fR\fR
.sp
For connections to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_setpermission: user option
-.\" user option: mysql_setpermission
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The MySQL user name to use when connecting to the server\&.
'\" t
.\" Title: \fBmysql_tzinfo_to_sql\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_TZINFO_TO_S" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_TZINFO_TO_S" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_tzinfo_to_sql
-.\" time zone tables
.SH "NAME"
mysql_tzinfo_to_sql \- load the time zone tables
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysql_upgrade\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_UPGRADE\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_UPGRADE\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_upgrade
-.\" upgrading MySQL
-.\" MySQL: upgrading
.SH "NAME"
mysql_upgrade \- check and upgrade MySQL tables
.SH "SYNOPSIS"
All checked and repaired tables are marked with the current MySQL version number\&. This ensures that next time you run
\fBmysql_upgrade\fR
with the same version of the server, it can tell whether there is any need to check or repair the table again\&.
-.\" mysql_upgrade_info file: mysql_upgrade
-.\" mysql_upgrade: mysql_upgrade_info file
-.\" data directory: mysql_upgrade_info file
.PP
\fBmysql_upgrade\fR
also saves the MySQL version number in a file named
.PP
\fBmysql_upgrade\fR
does not upgrade the contents of the help tables\&. For upgrade instructions, see
-Section\ \&5.1.10, \(lqServer-Side Help\(rq\&.
+Section\ \&5.1.9, \(lqServer-Side Help\(rq\&.
.PP
By default,
\fBmysql_upgrade\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: help option
-.\" help option: mysql_upgrade
\fB\-\-help\fR
.sp
Display a short help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: basedir option
-.\" basedir option: mysql_upgrade
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL installation directory\&. This option is accepted for backward compatibility but ignored\&. It is removed in MySQL 5\&.7\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: character-sets-dir option
-.\" character-sets-dir option: mysql_upgrade
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: compress option
-.\" compress option: mysql_upgrade
\fB\-\-compress\fR
.sp
Compress all information sent between the client and the server if both support compression\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: datadir option
-.\" datadir option: mysql_upgrade
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the data directory\&. This option is accepted for backward compatibility but ignored\&. It is removed in MySQL 5\&.7\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: debug option
-.\" debug option: mysql_upgrade
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: debug-check option
-.\" debug-check option: mysql_upgrade
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: debug-info option
-.\" debug-info option: mysql_upgrade
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: default-auth option
-.\" default-auth option: mysql_upgrade
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: default-character-set option
-.\" default-character-set option: mysql_upgrade
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: defaults-extra-file option
-.\" defaults-extra-file option: mysql_upgrade
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: defaults-file option
-.\" defaults-file option: mysql_upgrade
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: defaults-group-suffix option
-.\" defaults-group-suffix option: mysql_upgrade
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: force option
-.\" force option: mysql_upgrade
\fB\-\-force\fR
.sp
Ignore the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: host option
-.\" host option: mysql_upgrade
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: login-path option
-.\" login-path option: mysql_upgrade
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: no-defaults option
-.\" no-defaults option: mysql_upgrade
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: password option
-.\" password option: mysql_upgrade
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: pipe option
-.\" pipe option: mysql_upgrade
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: plugin-dir option
-.\" plugin-dir option: mysql_upgrade
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: port option
-.\" port option: mysql_upgrade
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: print-defaults option
-.\" print-defaults option: mysql_upgrade
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: protocol option
-.\" protocol option: mysql_upgrade
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: shared-memory-base-name option
-.\" shared-memory-base-name option: mysql_upgrade
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: socket option
-.\" socket option: mysql_upgrade
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: SSL options
-.\" SSL options: mysql_upgrade
\fB\-\-ssl*\fR
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: tmpdir option
-.\" tmpdir option: mysql_upgrade
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR,
\fB\-t \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: upgrade-system-tables option
-.\" upgrade-system-tables option: mysql_upgrade
\fB\-\-upgrade\-system\-tables\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: user option
-.\" user option: mysql_upgrade
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: verbose option
-.\" verbose option: mysql_upgrade
\fB\-\-verbose\fR
.sp
Verbose mode\&. Print more information about what the program does\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: version-check option
-.\" version-check option: mysql_upgrade
\fB\-\-version\-check\fR,
\fB\-k\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_upgrade: write-binlog option
-.\" write-binlog option: mysql_upgrade
\fB\-\-write\-binlog\fR
.sp
Cause binary logging to be enabled while
'\" t
.\" Title: \fBmysql_waitpid\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_WAITPID\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_WAITPID\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_waitpid
.SH "NAME"
mysql_waitpid \- kill process and wait for its termination
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_waitpid: help option
-.\" help option: mysql_waitpid
\fB\-\-help\fR,
\fB\-?\fR,
\fB\-I\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_waitpid: verbose option
-.\" verbose option: mysql_waitpid
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysql_waitpid: version option
-.\" version option: mysql_waitpid
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysql_zap\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQL_ZAP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQL_ZAP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysql_zap
.SH "NAME"
mysql_zap \- kill processes that match a pattern
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysqlaccess\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLACCESS\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLACCESS\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlaccess
.SH "NAME"
mysqlaccess \- client for checking access privileges
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: help option
-.\" help option: mysqlaccess
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: brief option
-.\" brief option: mysqlaccess
\fB\-\-brief\fR,
\fB\-b\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: commit option
-.\" commit option: mysqlaccess
\fB\-\-commit\fR
.sp
Copy the new access privileges from the temporary tables to the original grant tables\&. The grant tables must be flushed for the new privileges to take effect\&. (For example, execute a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: copy option
-.\" copy option: mysqlaccess
\fB\-\-copy\fR
.sp
Reload the temporary grant tables from original ones\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: db option
-.\" db option: mysqlaccess
\fB\-\-db=\fR\fB\fIdb_name\fR\fR,
\fB\-d \fR\fB\fIdb_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: debug option
-.\" debug option: mysqlaccess
\fB\-\-debug=\fR\fB\fIN\fR\fR
.sp
Specify the debug level\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: host option
-.\" host option: mysqlaccess
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: howto option
-.\" howto option: mysqlaccess
\fB\-\-howto\fR
.sp
Display some examples that show how to use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: old_server option
-.\" old_server option: mysqlaccess
\fB\-\-old_server\fR
.sp
Assume that the server is an old MySQL server (before MySQL 3\&.21) that does not yet know how to handle full
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: password option
-.\" password option: mysqlaccess
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: plan option
-.\" plan option: mysqlaccess
\fB\-\-plan\fR
.sp
Display suggestions and ideas for future releases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: preview option
-.\" preview option: mysqlaccess
\fB\-\-preview\fR
.sp
Show the privilege differences after making changes to the temporary grant tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: relnotes option
-.\" relnotes option: mysqlaccess
\fB\-\-relnotes\fR
.sp
Display the release notes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: rhost option
-.\" rhost option: mysqlaccess
\fB\-\-rhost=\fR\fB\fIhost_name\fR\fR,
\fB\-H \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: rollback option
-.\" rollback option: mysqlaccess
\fB\-\-rollback\fR
.sp
Undo the most recent changes to the temporary grant tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: spassword option
-.\" spassword option: mysqlaccess
\fB\-\-spassword[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-P[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: superuser option
-.\" superuser option: mysqlaccess
\fB\-\-superuser=\fR\fB\fIuser_name\fR\fR,
\fB\-U \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: table option
-.\" table option: mysqlaccess
\fB\-\-table\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: user option
-.\" user option: mysqlaccess
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlaccess: version option
-.\" version option: mysqlaccess
\fB\-\-version\fR,
\fB\-v\fR
.sp
'\" t
.\" Title: \fBmysqladmin\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLADMIN\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLADMIN\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqladmin
-.\" administration: server
-.\" server administration
.SH "NAME"
mysqladmin \- client for administering a MySQL server
.SH "SYNOPSIS"
.if n \{\
.RE
.\}
-.sp
-.\" status command: results
.PP
The
\fBmysqladmin status\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" uptime
Uptime
.sp
The number of seconds the MySQL server has been running\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" threads
Threads
.sp
The number of active threads (clients)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" questions
Questions
.sp
The number of questions (queries) from clients since the server was started\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" slow queries
Slow queries
.sp
The number of queries that have taken more than
long_query_time
seconds\&. See
-Section\ \&5.2.5, \(lqThe Slow Query Log\(rq\&.
+Section\ \&5.4.5, \(lqThe Slow Query Log\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" opens
Opens
.sp
The number of tables the server has opened\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" flush tables
-.\" tables: flush
Flush tables
.sp
The number of
.sp -1
.IP \(bu 2.3
.\}
-.\" open tables
Open tables
.sp
The number of tables that currently are open\&.
when connecting to a local server using a Unix socket file,
\fBmysqladmin\fR
waits until the server\*(Aqs process ID file has been removed, to ensure that the server has stopped properly\&.
-.\" mysqladmin command options
-.\" command options: mysqladmin
-.\" options: command-line: mysqladmin
-.\" startup parameters: mysqladmin
.PP
\fBmysqladmin\fR
supports the following options, which can be specified on the command line or in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: help option
-.\" help option: mysqladmin
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: bind-address option
-.\" bind-address option: mysqladmin
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: character-sets-dir option
-.\" character-sets-dir option: mysqladmin
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: compress option
-.\" compress option: mysqladmin
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: count option
-.\" count option: mysqladmin
\fB\-\-count=\fR\fB\fIN\fR\fR,
\fB\-c \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: debug option
-.\" debug option: mysqladmin
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: debug-check option
-.\" debug-check option: mysqladmin
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: debug-info option
-.\" debug-info option: mysqladmin
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: default-auth option
-.\" default-auth option: mysqladmin
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: default-character-set option
-.\" default-character-set option: mysqladmin
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: defaults-extra-file option
-.\" defaults-extra-file option: mysqladmin
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: defaults-file option
-.\" defaults-file option: mysqladmin
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqladmin
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqladmin
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: force option
-.\" force option: mysqladmin
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: host option
-.\" host option: mysqladmin
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: login-path option
-.\" login-path option: mysqladmin
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: no-beep option
-.\" no-beep option: mysqladmin
\fB\-\-no\-beep\fR,
\fB\-b\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: no-defaults option
-.\" no-defaults option: mysqladmin
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: password option
-.\" password option: mysqladmin
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: pipe option
-.\" pipe option: mysqladmin
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: plugin-dir option
-.\" plugin-dir option: mysqladmin
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: port option
-.\" port option: mysqladmin
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: print-defaults option
-.\" print-defaults option: mysqladmin
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: protocol option
-.\" protocol option: mysqladmin
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: relative option
-.\" relative option: mysqladmin
\fB\-\-relative\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: secure-auth option
-.\" secure-auth option: mysqladmin
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqladmin
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: silent option
-.\" silent option: mysqladmin
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: sleep option
-.\" sleep option: mysqladmin
\fB\-\-sleep=\fR\fB\fIdelay\fR\fR,
\fB\-i \fR\fB\fIdelay\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: socket option
-.\" socket option: mysqladmin
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: SSL options
-.\" SSL options: mysqladmin
\fB\-\-ssl*\fR
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: user option
-.\" user option: mysqladmin
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: verbose option
-.\" verbose option: mysqladmin
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: version option
-.\" version option: mysqladmin
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: vertical option
-.\" vertical option: mysqladmin
\fB\-\-vertical\fR,
\fB\-E\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqladmin: wait option
-.\" wait option: mysqladmin
\fB\-\-wait[=\fR\fB\fIcount\fR\fR\fB]\fR,
\fB\-w[\fR\fB\fIcount\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" connect_timeout variable
-.\" timeout: connect_timeout variable
connect_timeout
.sp
The maximum number of seconds before connection timeout\&. The default value is 43200 (12 hours)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" shutdown_timeout variable
-.\" timeout: shutdown_timeout variable
shutdown_timeout
.sp
The maximum number of seconds to wait for server shutdown\&. The default value is 3600 (1 hour)\&.
'\" t
.\" Title: \fBmysqlbinlog\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLBINLOG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLBINLOG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlbinlog
.SH "NAME"
mysqlbinlog \- utility for processing binary log files
.SH "SYNOPSIS"
utility\&. You can also use
\fBmysqlbinlog\fR
to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs\&. The binary log and relay log are discussed further in
-Section\ \&5.2.4, \(lqThe Binary Log\(rq, and
+Section\ \&5.4.4, \(lqThe Binary Log\(rq, and
Section\ \&17.2.2, \(lqReplication Relay and Status Logs\(rq\&.
.PP
Invoke
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: help option
-.\" help option: mysqlbinlog
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: base64-output option
-.\" base64-output option: mysqlbinlog
\fB\-\-base64\-output=\fR\fB\fIvalue\fR\fR
.sp
This option determines when events should be displayed encoded as base\-64 strings using
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: bind-address option
-.\" bind-address option: mysqlbinlog
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: binlog-row-event-max-size option
-.\" binlog-row-event-max-size option: mysqlbinlog
\fB\-\-binlog\-row\-event\-max\-size=\fR\fB\fIN\fR\fR
.TS
allbox tab(:);
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: character-sets-dir option
-.\" character-sets-dir option: mysqlbinlog
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: connection-server-id option
-.\" connection-server-id option: mysqlbinlog
\fB\-\-connection\-server\-id=\fR\fB\fIserver_id\fR\fR
.sp
This option is used to test a MySQL server for support of the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: database option
-.\" database option: mysqlbinlog
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-d \fR\fB\fIdb_name\fR\fR
.sp
statements following
USE db2\&.
.PP
-\fBRow-based logging\fR.
-\fBmysqlbinlog\fR
+\fBRow-based logging\fR. \fBmysqlbinlog\fR
outputs only entries that change tables belonging to
\fIdb_name\fR\&. The default database has no effect on this\&. Suppose that the binary log just described was created using row\-based logging rather than statement\-based logging\&.
\fBmysqlbinlog \-\-database=test\fR
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: debug option
-.\" debug option: mysqlbinlog
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: debug-check option
-.\" debug-check option: mysqlbinlog
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: debug-info option
-.\" debug-info option: mysqlbinlog
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: default-auth option
-.\" default-auth option: mysqlbinlog
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: defaults-extra-file option
-.\" defaults-extra-file option: mysqlbinlog
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: defaults-file option
-.\" defaults-file option: mysqlbinlog
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlbinlog
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: disable-log-bin option
-.\" disable-log-bin option: mysqlbinlog
\fB\-\-disable\-log\-bin\fR,
\fB\-D\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: exclude-gtids option
-.\" exclude-gtids option: mysqlbinlog
\fB\-\-exclude\-gtids=\fR\fB\fIgtid_set\fR\fR
.sp
Do not display any of the groups listed in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: force-if-open option
-.\" force-if-open option: mysqlbinlog
\fB\-\-force\-if\-open\fR,
\fB\-F\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: force-read option
-.\" force-read option: mysqlbinlog
\fB\-\-force\-read\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: hexdump option
-.\" hexdump option: mysqlbinlog
\fB\-\-hexdump\fR,
\fB\-H\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: host option
-.\" host option: mysqlbinlog
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: include-gtids option
-.\" include-gtids option: mysqlbinlog
\fB\-\-include\-gtids=\fR\fB\fIgtid_set\fR\fR
.sp
Display only the groups listed in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: local-load option
-.\" local-load option: mysqlbinlog
\fB\-\-local\-load=\fR\fB\fIdir_name\fR\fR,
\fB\-l \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: login-path option
-.\" login-path option: mysqlbinlog
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: no-defaults option
-.\" no-defaults option: mysqlbinlog
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: offset option
-.\" offset option: mysqlbinlog
\fB\-\-offset=\fR\fB\fIN\fR\fR,
\fB\-o \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: password option
-.\" password option: mysqlbinlog
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: plugin-dir option
-.\" plugin-dir option: mysqlbinlog
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: port option
-.\" port option: mysqlbinlog
-.\" TCP/IP
-.\" ports
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: print-defaults option
-.\" print-defaults option: mysqlbinlog
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: protocol option
-.\" protocol option: mysqlbinlog
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: raw option
-.\" raw option: mysqlbinlog
\fB\-\-raw\fR
.sp
By default,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: read-from-remote-master option
-.\" read-from-remote-master option: mysqlbinlog
\fB\-\-read\-from\-remote\-master=\fR\fB\fItype\fR\fR
.sp
Read binary logs from a MySQL server with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: read-from-remote-server option
-.\" read-from-remote-server option: mysqlbinlog
\fB\-\-read\-from\-remote\-server\fR,
\fB\-R\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: result-file option
-.\" result-file option: mysqlbinlog
\fB\-\-result\-file=\fR\fB\fIname\fR\fR,
\fB\-r \fR\fB\fIname\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: secure-auth option
-.\" secure-auth option: mysqlbinlog
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: server-id option
-.\" server-id option: mysqlbinlog
\fB\-\-server\-id=\fR\fB\fIid\fR\fR
.sp
Display only those events created by the server having the given server ID\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: server-id-bits option
-.\" server-id-bits option: mysqlbinlog
\fB\-\-server\-id\-bits=\fR\fB\fIN\fR\fR
.sp
Use only the first
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: set-charset option
-.\" set-charset option: mysqlbinlog
\fB\-\-set\-charset=\fR\fB\fIcharset_name\fR\fR
.sp
Add a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlbinlog
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: short-form option
-.\" short-form option: mysqlbinlog
\fB\-\-short\-form\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: skip-gtids option
-.\" skip-gtids option: mysqlbinlog
\fB\-\-skip\-gtids[=(true|false)]\fR
.sp
Do not display any GTIDs in the output\&. This is needed when writing to a dump file from one or more binary logs containing GTIDs, as shown in this example:
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: socket option
-.\" socket option: mysqlbinlog
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: start-datetime option
-.\" start-datetime option: mysqlbinlog
\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
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: start-position option
-.\" start-position option: mysqlbinlog
\fB\-\-start\-position=\fR\fB\fIN\fR\fR,
\fB\-j \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: stop-datetime option
-.\" stop-datetime option: mysqlbinlog
\fB\-\-stop\-datetime=\fR\fB\fIdatetime\fR\fR
.sp
Stop reading the binary log at the first event having a timestamp equal to or later than the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: stop-never option
-.\" stop-never option: mysqlbinlog
\fB\-\-stop\-never\fR
.sp
This option is used with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: stop-never-slave-server-id option
-.\" stop-never-slave-server-id option: mysqlbinlog
\fB\-\-stop\-never\-slave\-server\-id=\fR\fB\fIid\fR\fR
.sp
With
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: stop-position option
-.\" stop-position option: mysqlbinlog
\fB\-\-stop\-position=\fR\fB\fIN\fR\fR
.sp
Stop reading the binary log at the first event having a position equal to or greater than
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: to-last-log option
-.\" to-last-log option: mysqlbinlog
\fB\-\-to\-last\-log\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: user option
-.\" user option: mysqlbinlog
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: verbose option
-.\" verbose option: mysqlbinlog
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: verify-binlog-checksum option
-.\" verify-binlog-checksum option: mysqlbinlog
\fB\-\-verify\-binlog\-checksum\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlbinlog: version option
-.\" version option: mysqlbinlog
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" open_files_limit variable
open_files_limit
.sp
Specify the number of open file descriptors to reserve\&.
.sp 1
.RE
.SH "MYSQLBINLOG ROW EVENT DISPLAY"
-.\" BINLOG statement: mysqlbinlog output
.PP
The following examples illustrate how
\fBmysqlbinlog\fR
'\" t
.\" Title: \fBmysqlbug\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLBUG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLBUG\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlbug
.SH "NAME"
mysqlbug \- generate bug report
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysqlcheck\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLCHECK\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLCHECK\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlcheck
-.\" maintenance: tables
-.\" repair: tables
-.\" tables: maintenance
-.\" tables: repair
.SH "NAME"
mysqlcheck \- a table maintenance program
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: help option
-.\" help option: mysqlcheck
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: all-databases option
-.\" all-databases option: mysqlcheck
\fB\-\-all\-databases\fR,
\fB\-A\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: all-in-1 option
-.\" all-in-1 option: mysqlcheck
\fB\-\-all\-in\-1\fR,
\fB\-1\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: analyze option
-.\" analyze option: mysqlcheck
\fB\-\-analyze\fR,
\fB\-a\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: auto-repair option
-.\" auto-repair option: mysqlcheck
\fB\-\-auto\-repair\fR
.sp
If a checked table is corrupted, automatically fix it\&. Any necessary repairs are done after all tables have been checked\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: bind-address option
-.\" bind-address option: mysqlcheck
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: character-sets-dir option
-.\" character-sets-dir option: mysqlcheck
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: check option
-.\" check option: mysqlcheck
\fB\-\-check\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: check-only-changed option
-.\" check-only-changed option: mysqlcheck
\fB\-\-check\-only\-changed\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: check-upgrade option
-.\" check-upgrade option: mysqlcheck
\fB\-\-check\-upgrade\fR,
\fB\-g\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: compress option
-.\" compress option: mysqlcheck
\fB\-\-compress\fR
.sp
Compress all information sent between the client and the server if both support compression\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: databases option
-.\" databases option: mysqlcheck
\fB\-\-databases\fR,
\fB\-B\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: debug option
-.\" debug option: mysqlcheck
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: debug-check option
-.\" debug-check option: mysqlcheck
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: debug-info option
-.\" debug-info option: mysqlcheck
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: default-character-set option
-.\" default-character-set option: mysqlcheck
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: defaults-extra-file option
-.\" defaults-extra-file option: mysqlcheck
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: defaults-file option
-.\" defaults-file option: mysqlcheck
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlcheck
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: extended option
-.\" extended option: mysqlcheck
\fB\-\-extended\fR,
\fB\-e\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: default-auth option
-.\" default-auth option: mysqlcheck
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqlcheck
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
.sp
This option was added in MySQL 5\&.6\&.28\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: fast option
-.\" fast option: mysqlcheck
\fB\-\-fast\fR,
\fB\-F\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: fix-db-names option
-.\" fix-db-names option: mysqlcheck
\fB\-\-fix\-db\-names\fR
.sp
Convert database names to 5\&.1 format\&. Only database names that contain special characters are affected\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: fix-table-names option
-.\" fix-table-names option: mysqlcheck
\fB\-\-fix\-table\-names\fR
.sp
Convert table names to 5\&.1 format\&. Only table names that contain special characters are affected\&. This option also applies to views\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: force option
-.\" force option: mysqlcheck
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: host option
-.\" host option: mysqlcheck
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: login-path option
-.\" login-path option: mysqlcheck
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: medium-check option
-.\" medium-check option: mysqlcheck
\fB\-\-medium\-check\fR,
\fB\-m\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: no-defaults option
-.\" no-defaults option: mysqlcheck
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: optimize option
-.\" optimize option: mysqlcheck
\fB\-\-optimize\fR,
\fB\-o\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: password option
-.\" password option: mysqlcheck
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: pipe option
-.\" pipe option: mysql
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: plugin-dir option
-.\" plugin-dir option: mysqlcheck
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: port option
-.\" port option: mysqlcheck
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: print-defaults option
-.\" print-defaults option: mysqlcheck
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: protocol option
-.\" protocol option: mysqlcheck
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: quick option
-.\" quick option: mysqlcheck
\fB\-\-quick\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: repair option
-.\" repair option: mysqlcheck
\fB\-\-repair\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: secure-auth option
-.\" secure-auth option: mysqlcheck
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlcheck
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: silent option
-.\" silent option: mysqlcheck
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: skip-database option
-.\" skip-database option: mysqlcheck
\fB\-\-skip\-database=\fR\fB\fIdb_name\fR\fR
.sp
Do not include the named database (case sensitive) in the operations performed by
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: socket option
-.\" socket option: mysqlcheck
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: SSL options
-.\" SSL options: mysqlcheck
\fB\-\-ssl*\fR
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: tables option
-.\" tables option: mysqlcheck
\fB\-\-tables\fR
.sp
Override the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: use-frm option
-.\" use-frm option: mysqlcheck
\fB\-\-use\-frm\fR
.sp
For repair operations on
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: user option
-.\" user option: mysqlcheck
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: verbose option
-.\" verbose option: mysqlcheck
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: version option
-.\" version option: mysqlcheck
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlcheck: write-binlog option
-.\" write-binlog option: mysqlcheck
\fB\-\-write\-binlog\fR
.sp
This option is enabled by default, so that
'\" t
.\" Title: \fBmysqld\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLD\FR" "8" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD\FR" "8" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqld: MySQL server
-.\" MySQL server: mysqld
.SH "NAME"
mysqld \- the MySQL server
.SH "SYNOPSIS"
'\" t
.\" Title: \fBmysqld_multi\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLD_MULTI\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD_MULTI\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqld_multi
-.\" tools: mysqld_multi
-.\" scripts
-.\" multi mysqld
.SH "NAME"
mysqld_multi \- manage multiple MySQL servers
.SH "SYNOPSIS"
group used for starting
\fBmysqld\fR\&. (See, for example,
Section\ \&2.10.5, \(lqStarting and Stopping MySQL Automatically\(rq\&.) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&. For more information on which options must be unique per server in a multiple\-server environment, see
-Section\ \&5.3, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&.
+Section\ \&5.6, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&.
.PP
To invoke
\fBmysqld_multi\fR, use the following syntax:
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: no-defaults option
-.\" no-defaults option: mysqld_multi
With
\fB\-\-no\-defaults\fR, no option files are read\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: defaults-file option
-.\" defaults-file option: mysqld_multi
With
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR, only the named file is read\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: defaults-extra-file option
-.\" defaults-extra-file option: mysqld_multi
Otherwise, option files in the standard list of locations are read, including any file named by the
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
option, if one is given\&. (If the option is given multiple times, the last value is used\&.)
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: help option
-.\" help option: mysqld_multi
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: example option
-.\" example option: mysqld_multi
\fB\-\-example\fR
.sp
Display a sample option file\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: log option
-.\" log option: mysqld_multi
\fB\-\-log=\fR\fB\fIfile_name\fR\fR
.sp
Specify the name of the log file\&. If the file exists, log output is appended to it\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: mysqladmin option
-.\" mysqladmin option: mysqld_multi
\fB\-\-mysqladmin=\fR\fB\fIprog_name\fR\fR
.sp
The
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: mysqld option
-.\" mysqld option: mysqld_multi
\fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
.sp
The
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: no-log option
-.\" no-log option: mysqld_multi
\fB\-\-no\-log\fR
.sp
Print log information to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: password option
-.\" password option: mysqld_multi
\fB\-\-password=\fR\fB\fIpassword\fR\fR
.sp
The password of the MySQL account to use when invoking
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: silent option
-.\" silent option: mysqld_multi
\fB\-\-silent\fR
.sp
Silent mode; disable warnings\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: tcp-ip option
-.\" tcp-ip option: mysqld_multi
\fB\-\-tcp\-ip\fR
.sp
Connect to each MySQL server through the TCP/IP port instead of the Unix socket file\&. (If a socket file is missing, the server might still be running, but accessible only through the TCP/IP port\&.) By default, connections are made using the Unix socket file\&. This option affects
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: user option
-.\" user option: mysqld_multi
\fB\-\-user=\fR\fB\fIuser_name\fR\fR
.sp
The user name of the MySQL account to use when invoking
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: verbose option
-.\" verbose option: mysqld_multi
\fB\-\-verbose\fR
.sp
Be more verbose\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_multi: version option
-.\" version option: mysqld_multi
\fB\-\-version\fR
.sp
Display version information and exit\&.
what you are doing\&. Starting multiple servers with the same data directory does
\fInot\fR
give you extra performance in a threaded system\&. See
-Section\ \&5.3, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&.
+Section\ \&5.6, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&.
.RE
.sp
.RS 4
'\" t
.\" Title: \fBmysqld_safe\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLD_SAFE\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLD_SAFE\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqld_safe
-.\" tools: mysqld_safe
-.\" scripts
.SH "NAME"
mysqld_safe \- MySQL server startup script
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: help option
-.\" help option: mysqld_safe
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: basedir option
-.\" basedir option: mysqld_safe
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the MySQL installation directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: core-file-size option
-.\" core-file-size option: mysqld_safe
\fB\-\-core\-file\-size=\fR\fB\fIsize\fR\fR
.sp
The size of the core file that
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: datadir option
-.\" datadir option: mysqld_safe
\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR
.sp
The path to the data directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: defaults-extra-file option
-.\" defaults-extra-file option: mysqld_safe
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: defaults-file option
-.\" defaults-file option: mysqld_safe
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: ledir option
-.\" ledir option: mysqld_safe
\fB\-\-ledir=\fR\fB\fIdir_name\fR\fR
.sp
If
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: log-error option
-.\" log-error option: mysqld_safe
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
.sp
Write the error log to the given file\&. See
-Section\ \&5.2.2, \(lqThe Error Log\(rq\&.
+Section\ \&5.4.2, \(lqThe Error Log\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: malloc-lib option
-.\" mysqld option: malloc-lib
\fB\-\-malloc\-lib=[\fR\fB\fIlib_name\fR\fR\fB]\fR
-.\" memory allocation library
-.\" tcmalloc: memory allocation library
The name of the library to use for memory allocation instead of the system
malloc()
-library\&. Any library can be used by specifying its path name, but there is a shortcut form to enable use of the
+library\&. As of MySQL 5\&.6\&.33, the option value must be one of the directories
+/usr/lib,
+/usr/lib64,
+/usr/lib/i386\-linux\-gnu, or
+/usr/lib/x86_64\-linux\-gnu\&. Prior to MySQL 5\&.6\&.33, any library can be used by specifying its path name, but there is a shortcut form to enable use of the
tcmalloc
library that is shipped with binary MySQL distributions for Linux in MySQL 5\&.6\&. It is possible that the shortcut form will not work under certain configurations, in which case you should specify a path name instead\&.
+.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
+As of MySQL 5\&.6\&.31, MySQL distributions no longer include a
+tcmalloc
+library\&.
+.sp .5v
+.RE
The
\fB\-\-malloc\-lib\fR
option works by modifying the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: mysqld option
-.\" mysqld option: mysqld_safe
\fB\-\-mysqld=\fR\fB\fIprog_name\fR\fR
.sp
The name of the server program (in the
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\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: mysqld-version option
-.\" mysqld-version option: mysqld_safe
\fB\-\-mysqld\-version=\fR\fB\fIsuffix\fR\fR
.sp
This option is similar to the
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\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: nice option
-.\" nice option: mysqld_safe
\fB\-\-nice=\fR\fB\fIpriority\fR\fR
.sp
Use the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: no-defaults option
-.\" no-defaults option: mysqld_safe
\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\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: open-files-limit option
-.\" open-files-limit option: mysqld_safe
\fB\-\-open\-files\-limit=\fR\fB\fIcount\fR\fR
.sp
The number of files that
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: pid-file option
-.\" pid-file option: mysqld_safe
\fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR
.sp
The path name of the process ID file\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: plugin-dir option
-.\" plugin-dir option: mysqld_safe
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The path name of the plugin directory\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: port option
-.\" port option: mysqld_safe
-.\" TCP/IP
\fB\-\-port=\fR\fB\fIport_num\fR\fR
.sp
The port number that the server should use when listening for TCP/IP connections\&. The port number must be 1024 or higher unless the server is started by the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: skip-kill-mysqld option
-.\" skip-kill-mysqld option: mysqld_safe
\fB\-\-skip\-kill\-mysqld\fR
.sp
Do not try to kill stray
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: socket option
-.\" socket option: mysqld_safe
\fB\-\-socket=\fR\fB\fIpath\fR\fR
.sp
The Unix socket file that the server should use when listening for local connections\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: syslog option
-.\" syslog option: mysqld_safe
-.\" mysqld_safe: skip-syslog option
-.\" skip-syslog option: mysqld_safe
\fB\-\-syslog\fR,
\fB\-\-skip\-syslog\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: syslog-tag option
-.\" syslog-tag option: mysqld_safe
\fB\-\-syslog\-tag=\fR\fB\fItag\fR\fR
.sp
For logging to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: timezone option
-.\" timezone option: mysqld_safe
\fB\-\-timezone=\fR\fB\fItimezone\fR\fR
.sp
Set the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqld_safe: user option
-.\" user option: mysqld_safe
\fB\-\-user={\fR\fB\fIuser_name\fR\fR\fB|\fR\fB\fIuser_id\fR\fR\fB}\fR
.sp
Run the
'\" t
.\" Title: \fBmysqldump\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLDUMP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLDUMP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqldump
-.\" dumping: databases and tables
-.\" backups: databases and tables
-.\" databases: dumping
-.\" tables: dumping
.SH "NAME"
mysqldump \- a database backup program
.SH "SYNOPSIS"
.\}
.PP
However, UTF\-16 is not permitted as a connection character set (see
-Section\ \&10.1.4, \(lqConnection Character Sets and Collations\(rq), so the dump file will not load correctly\&. To work around this issue, use the
+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
\fB\-\-result\-file\fR
option, which creates the output in ASCII format:
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: bind-address option
-.\" bind-address option: mysqldump
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: compress option
-.\" compress option: mysqldump
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: default-auth option
-.\" default-auth option: mysqldump
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqldump
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
.sp
This option was added in MySQL 5\&.6\&.28\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: host option
-.\" host option: mysqldump
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: login-path option
-.\" login-path option: mysqldump
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: password option
-.\" password option: mysqldump
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: pipe option
-.\" pipe option: mysqldump
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: plugin-dir option
-.\" plugin-dir option: mysqldump
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: port option
-.\" port option: mysqldump
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: protocol option
-.\" protocol option: mysqldump
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: secure-auth option
-.\" secure-auth option: mysqldump
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: socket option
-.\" socket option: mysqldump
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: SSL options
-.\" SSL options: mysqldump
\fB\-\-ssl*\fR
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: user option
-.\" user option: mysqldump
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: defaults-extra-file option
-.\" defaults-extra-file option: mysqldump
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: defaults-file option
-.\" defaults-file option: mysqldump
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqldump
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-defaults option
-.\" no-defaults option: mysqldump
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: print-defaults option
-.\" print-defaults option: mysqldump
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: add-drop-database option
-.\" add-drop-database option: mysqldump
\fB\-\-add\-drop\-database\fR
.sp
Write a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: add-drop-table option
-.\" add-drop-table option: mysqldump
\fB\-\-add\-drop\-table\fR
.sp
Write a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: add-drop-trigger option
-.\" add-drop-trigger option: mysqldump
\fB\-\-add\-drop\-trigger\fR
.sp
Write a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: all-tablespaces option
-.\" all-tablespaces option: mysqldump
\fB\-\-all\-tablespaces\fR,
\fB\-Y\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-create-db option
-.\" no-create-db option: mysqldump
\fB\-\-no\-create\-db\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-create-info option
-.\" no-create-info option: mysqldump
\fB\-\-no\-create\-info\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-tablespaces option
-.\" no-tablespaces option: mysqldump
\fB\-\-no\-tablespaces\fR,
\fB\-y\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: replace option
-.\" replace option: mysqldump
\fB\-\-replace\fR
.sp
Write
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: allow-keywords option
-.\" allow-keywords option: mysqldump
\fB\-\-allow\-keywords\fR
.sp
Permit creation of column names that are keywords\&. This works by prefixing each column name with the table name\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: comments option
-.\" comments option: mysqldump
\fB\-\-comments\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: debug option
-.\" debug option: mysqldump
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: debug-check option
-.\" debug-check option: mysqldump
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: debug-info option
-.\" debug-info option: mysqldump
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: dump-date option
-.\" dump-date option: mysqldump
\fB\-\-dump\-date\fR
.sp
If the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: force option
-.\" force option: mysqldump
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: log-error option
-.\" log-error option: mysqldump
\fB\-\-log\-error=\fR\fB\fIfile_name\fR\fR
.sp
Log warnings and errors by appending them to the named file\&. The default is to do no logging\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: skip-comments option
-.\" skip-comments option: mysqldump
\fB\-\-skip\-comments\fR
.sp
See the description for the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: verbose option
-.\" verbose option: mysqldump
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: help option
-.\" help option: mysqldump
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: version option
-.\" version option: mysqldump
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: character-sets-dir option
-.\" character-sets-dir option: mysqldump
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: default-character-set option
-.\" default-character-set option: mysqldump
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-set-names option
-.\" no-set-names option: mysqldump
\fB\-\-no\-set\-names\fR,
\fB\-N\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: set-charset option
-.\" set-charset option: mysqldump
\fB\-\-set\-charset\fR
.sp
Write
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: apply-slave-statements option
-.\" apply-slave-statements option: mysqldump
\fB\-\-apply\-slave\-statements\fR
.sp
For a slave dump produced with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: delete-master-logs option
-.\" delete-master-logs option: mysqldump
\fB\-\-delete\-master\-logs\fR
.sp
On a master replication server, delete the binary logs by sending a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: dump-slave option
-.\" dump-slave option: mysqldump
\fB\-\-dump\-slave[=\fR\fB\fIvalue\fR\fR\fB]\fR
.sp
This option is similar to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: include-master-host-port option
-.\" include-master-host-port option: mysqldump
\fB\-\-include\-master\-host\-port\fR
.sp
For the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: master-data option
-.\" master-data option: mysqldump
\fB\-\-master\-data[=\fR\fB\fIvalue\fR\fR\fB]\fR
.sp
Use this option to dump a master replication server to produce a dump file that can be used to set up another server as a slave of the master\&. It causes the dump output to include a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: set-gtid-purged option
-.\" set-gtid-purged option: mysqldump
\fB\-\-set\-gtid\-purged=\fR\fB\fIvalue\fR\fR
.sp
This option enables control over global transaction ID (GTID) information written to the dump file, by indicating whether to add a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: compact option
-.\" compact option: mysqldump
\fB\-\-compact\fR
.sp
Produce more compact output\&. This option enables the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: compatible option
-.\" compatible option: mysqldump
\fB\-\-compatible=\fR\fB\fIname\fR\fR
.sp
Produce output that is more compatible with other database systems or with older MySQL servers\&. The value of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: complete-insert option
-.\" complete-insert option: mysqldump
\fB\-\-complete\-insert\fR,
\fB\-c\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: create-options option
-.\" create-options option: mysqldump
\fB\-\-create\-options\fR
.sp
Include all MySQL\-specific table options in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: fields-terminated-by option
-.\" fields-terminated-by option: mysqldump
\fB\-\-fields\-terminated\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-enclosed-by option
-.\" fields-enclosed-by option: mysqldump
\fB\-\-fields\-enclosed\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-optionally-enclosed-by option
-.\" fields-optionally-enclosed-by option: mysqldump
\fB\-\-fields\-optionally\-enclosed\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-escaped-by option
-.\" fields-escaped-by option: mysqldump
\fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
.sp
These options are used with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: hex-blob option
-.\" hex-blob option: mysqldump
\fB\-\-hex\-blob\fR
.sp
Dump binary columns using hexadecimal notation (for example,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: lines-terminated-by option
-.\" lines-terminated-by option: mysqldump
\fB\-\-lines\-terminated\-by=\&.\&.\&.\fR
.sp
This option is used with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: quote-names option
-.\" quote-names option: mysqldump
\fB\-\-quote\-names\fR,
\fB\-Q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: result-file option
-.\" result-file option: mysqldump
\fB\-\-result\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-r \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: tab option
-.\" tab option: mysqldump
\fB\-\-tab=\fR\fB\fIdir_name\fR\fR,
\fB\-T \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: tz-utc option
-.\" tz-utc option: mysqldump
\fB\-\-tz\-utc\fR
.sp
This option enables
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: xml option
-.\" xml option: mysqldump
\fB\-\-xml\fR,
\fB\-X\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: all-databases option
-.\" all-databases option: mysqldump
\fB\-\-all\-databases\fR,
\fB\-A\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: databases option
-.\" databases option: mysqldump
\fB\-\-databases\fR,
\fB\-B\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: events option
-.\" events option: mysqldump
\fB\-\-events\fR,
\fB\-E\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: ignore-table option
-.\" ignore-table option: mysqldump
\fB\-\-ignore\-table=\fR\fB\fIdb_name\&.tbl_name\fR\fR
.sp
Do not dump the given table, which must be specified using both the database and table names\&. To ignore multiple tables, use this option multiple times\&. This option also can be used to ignore views\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-data option
-.\" no-data option: mysqldump
\fB\-\-no\-data\fR,
\fB\-d\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: routines option
-.\" routines option: mysqldump
\fB\-\-routines\fR,
\fB\-R\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: tables option
-.\" tables option: mysqldump
\fB\-\-tables\fR
.sp
Override the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: triggers option
-.\" triggers option: mysqldump
\fB\-\-triggers\fR
.sp
Include triggers for each dumped table in the output\&. This option is enabled by default; disable it with
\fB\-\-skip\-triggers\fR\&.
+.sp
+To be able to dump a table\*(Aqs triggers, you must have the
+TRIGGER
+privilege for the table\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: where option
-.\" where option: mysqldump
\fB\-\-where=\*(Aq\fR\fB\fIwhere_condition\fR\fR\fB\*(Aq\fR,
\fB\-w \*(Aq\fR\fB\fIwhere_condition\fR\fR\fB\*(Aq\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: delayed-insert option
-.\" delayed-insert option: mysqldump
\fB\-\-delayed\-insert\fR
.sp
For those nontransactional tables that support the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: disable-keys option
-.\" disable-keys option: mysqldump
\fB\-\-disable\-keys\fR,
\fB\-K\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: extended-insert option
-.\" extended-insert option: mysqldump
\fB\-\-extended\-insert\fR,
\fB\-e\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: insert-ignore option
-.\" insert-ignore option: mysqldump
\fB\-\-insert\-ignore\fR
.sp
Write
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: opt option
-.\" opt option: mysqldump
\fB\-\-opt\fR
.sp
This option, enabled by default, is shorthand for the combination of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: quick option
-.\" quick option: mysqldump
\fB\-\-quick\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: skip-opt option
-.\" skip-opt option: mysqldump
\fB\-\-skip\-opt\fR
.sp
See the description for the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: add-locks option
-.\" add-locks option: mysqldump
\fB\-\-add\-locks\fR
.sp
Surround each table dump with
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: flush-logs option
-.\" flush-logs option: mysqldump
\fB\-\-flush\-logs\fR,
\fB\-F\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: flush-privileges option
-.\" flush-privileges option: mysqldump
\fB\-\-flush\-privileges\fR
.sp
Add a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: lock-all-tables option
-.\" lock-all-tables option: mysqldump
\fB\-\-lock\-all\-tables\fR,
\fB\-x\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: lock-tables option
-.\" lock-tables option: mysqldump
\fB\-\-lock\-tables\fR,
\fB\-l\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: no-autocommit option
-.\" no-autocommit option: mysqldump
\fB\-\-no\-autocommit\fR
.sp
Enclose the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: order-by-primary option
-.\" order-by-primary option: mysqldump
\fB\-\-order\-by\-primary\fR
.sp
Dump each table\*(Aqs rows sorted by its primary key, or by its first unique index, if such an index exists\&. This is useful when dumping a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqldump
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: single-transaction option
-.\" single-transaction option: mysqldump
\fB\-\-single\-transaction\fR
.sp
This option sets the transaction isolation mode to
For point\-in\-time recovery (also known as
\(lqroll\-forward,\(rq
when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the binary log (see
-Section\ \&5.2.4, \(lqThe Binary Log\(rq) or at least know the binary log coordinates to which the dump corresponds:
+Section\ \&5.4.4, \(lqThe Binary Log\(rq) or at least know the binary log coordinates to which the dump corresponds:
.sp
.if n \{\
.RS 4
\fB\-\-disable\-keys\fR
\fB\-\-lock\-tables\fR\&.
.RE
-Restrictions.\" mysqldump: views
-.\" mysqldump: problems
-.\" mysqldump: workarounds
-.PP
+Restrictions.PP
\fBmysqldump\fR
does not dump the
INFORMATION_SCHEMA
'\" t
.\" Title: \fBmysqldumpslow\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLDUMPSLOW\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLDUMPSLOW\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqldumpslow
.SH "NAME"
mysqldumpslow \- Summarize slow query log files
.SH "SYNOPSIS"
.SH "DESCRIPTION"
.PP
The MySQL slow query log contains information about queries that take a long time to execute (see
-Section\ \&5.2.5, \(lqThe Slow Query Log\(rq)\&.
+Section\ \&5.4.5, \(lqThe Slow Query Log\(rq)\&.
\fBmysqldumpslow\fR
parses MySQL slow query log files and prints a summary of their contents\&.
.PP
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldumpslow: help option
-.\" help option: mysqldumpslow
\fB\-\-help\fR
.sp
Display a help message and exit\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldumpslow: debug option
-.\" debug option: mysqldumpslow
\fB\-\-debug\fR,
\fB\-d\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldumpslow: verbose option
-.\" verbose option: mysqldumpslow
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
'\" t
.\" Title: \fBmysqlhotcopy\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLHOTCOPY\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLHOTCOPY\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlhotcopy
-.\" dumping: databases and tables
-.\" backups: databases and tables
-.\" databases: dumping
-.\" tables: dumping
.SH "NAME"
mysqlhotcopy \- a database backup program
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: help option
-.\" help option: mysqlhotcopy
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: addtodest option
-.\" addtodest option: mysqlhotcopy
\fB\-\-addtodest\fR
.sp
Do not rename target directory (if it exists); merely add files to it\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: allowold option
-.\" allowold option: mysqlhotcopy
\fB\-\-allowold\fR
.sp
Do not abort if a target exists; rename it by adding an
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: checkpoint option
-.\" checkpoint option: mysqlhotcopy
\fB\-\-checkpoint=\fR\fB\fIdb_name\fR\fR\fB\&.\fR\fB\fItbl_name\fR\fR
.sp
Insert checkpoint entries into the specified database
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: chroot option
-.\" chroot option: mysqlhotcopy
\fB\-\-chroot=\fR\fB\fIdir_name\fR\fR
.sp
Base directory of the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: debug option
-.\" debug option: mysqlhotcopy
\fB\-\-debug\fR
.sp
Enable debug output\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: dryrun option
-.\" dryrun option: mysqlhotcopy
\fB\-\-dryrun\fR,
\fB\-n\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: flushlog option
-.\" flushlog option: mysqlhotcopy
\fB\-\-flushlog\fR
.sp
Flush logs after all tables are locked\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: host option
-.\" host option: mysqlhotcopy
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: keepold option
-.\" keepold option: mysqlhotcopy
\fB\-\-keepold\fR
.sp
Do not delete previous (renamed) target when done\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: method option
-.\" method option: mysqlhotcopy
\fB\-\-method=\fR\fB\fIcommand\fR\fR
.sp
The method for copying files (cp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: noindices option
-.\" noindices option: mysqlhotcopy
\fB\-\-noindices\fR
.sp
Do not include full index files for
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: password option
-.\" password option: mysqlhotcopy
\fB\-\-password=\fR\fB\fIpassword\fR\fR,
\fB\-p\fR\fB\fIpassword\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: port option
-.\" port option: mysqlhotcopy
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: old_server option
-.\" old_server option: mysqlhotcopy
\fB\-\-old_server\fR
.sp
In MySQL 5\&.6,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: quiet option
-.\" quiet option: mysqlhotcopy
\fB\-\-quiet\fR,
\fB\-q\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: record_log_pos option
-.\" record_log_pos option: mysqlhotcopy
\fB\-\-record_log_pos=\fR\fB\fIdb_name\fR\fR\fB\&.\fR\fB\fItbl_name\fR\fR
.sp
Record master and slave status in the specified database
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: regexp option
-.\" regexp option: mysqlhotcopy
\fB\-\-regexp=\fR\fB\fIexpr\fR\fR
.sp
Copy all databases with names that match the given regular expression\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: resetmaster option
-.\" resetmaster option: mysqlhotcopy
\fB\-\-resetmaster\fR
.sp
Reset the binary log after locking all the tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: resetslave option
-.\" resetslave option: mysqlhotcopy
\fB\-\-resetslave\fR
.sp
Reset the master info repository file or table after locking all the tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: socket option
-.\" socket option: mysqlhotcopy
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: suffix option
-.\" suffix option: mysqlhotcopy
\fB\-\-suffix=\fR\fB\fIstr\fR\fR
.sp
The suffix to use for names of copied databases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: tmpdir option
-.\" tmpdir option: mysqlhotcopy
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR
.sp
The temporary directory\&. The default is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlhotcopy: user option
-.\" user option: mysqlhotcopy
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
'\" t
.\" Title: \fBmysqlimport\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLIMPORT\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLIMPORT\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlimport
-.\" importing: data
-.\" data: importing
-.\" files: text
-.\" text files: importing
.SH "NAME"
mysqlimport \- a data import program
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: help option
-.\" help option: mysqlimport
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: bind-address option
-.\" bind-address option: mysqlimport
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: character-sets-dir option
-.\" character-sets-dir option: mysqlimport
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: columns option
-.\" columns option: mysqlimport
\fB\-\-columns=\fR\fB\fIcolumn_list\fR\fR,
\fB\-c \fR\fB\fIcolumn_list\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: compress option
-.\" compress option: mysqlimport
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: debug option
-.\" debug option: mysqlimport
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: debug-check option
-.\" debug-check option: mysqlimport
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: debug-info option
-.\" debug-info option: mysqlimport
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: default-character-set option
-.\" default-character-set option: mysqlimport
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: default-auth option
-.\" default-auth option: mysqlimport
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: defaults-extra-file option
-.\" defaults-extra-file option: mysqlimport
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: defaults-file option
-.\" defaults-file option: mysqlimport
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlimport
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: delete option
-.\" delete option: mysqlimport
\fB\-\-delete\fR,
\fB\-D\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqlimport
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
.sp
This option was added in MySQL 5\&.6\&.28\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: fields-terminated-by option
-.\" fields-terminated-by option: mysqldump
\fB\-\-fields\-terminated\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-enclosed-by option
-.\" fields-enclosed-by option: mysqldump
\fB\-\-fields\-enclosed\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-optionally-enclosed-by option
-.\" fields-optionally-enclosed-by option: mysqldump
\fB\-\-fields\-optionally\-enclosed\-by=\&.\&.\&.\fR,
-.\" mysqldump: fields-escaped-by option
-.\" fields-escaped-by option: mysqldump
\fB\-\-fields\-escaped\-by=\&.\&.\&.\fR
.sp
These options have the same meaning as the corresponding clauses for
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: force option
-.\" force option: mysqlimport
\fB\-\-force\fR,
\fB\-f\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: host option
-.\" host option: mysqlimport
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: ignore option
-.\" ignore option: mysqlimport
\fB\-\-ignore\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: ignore-lines option
-.\" ignore-lines option: mysqlimport
\fB\-\-ignore\-lines=\fR\fB\fIN\fR\fR
.sp
Ignore the first
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqldump: lines-terminated-by option
-.\" lines-terminated-by option: mysqldump
\fB\-\-lines\-terminated\-by=\&.\&.\&.\fR
.sp
This option has the same meaning as the corresponding clause for
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: local option
-.\" local option: mysqlimport
\fB\-\-local\fR,
\fB\-L\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: lock-tables option
-.\" lock-tables option: mysqlimport
\fB\-\-lock\-tables\fR,
\fB\-l\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: login-path option
-.\" login-path option: mysqlimport
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: low-priority option
-.\" low-priority option: mysqlimport
\fB\-\-low\-priority\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: no-defaults option
-.\" no-defaults option: mysqlimport
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: password option
-.\" password option: mysqlimport
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: pipe option
-.\" pipe option: mysqlimport
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: plugin-dir option
-.\" plugin-dir option: mysqlimport
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: port option
-.\" port option: mysqlimport
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: print-defaults option
-.\" print-defaults option: mysqlimport
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: protocol option
-.\" protocol option: mysqlimport
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: replace option
-.\" replace option: mysqlimport
\fB\-\-replace\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: secure-auth option
-.\" secure-auth option: mysqlimport
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlimport
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: silent option
-.\" silent option: mysqlimport
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: socket option
-.\" socket option: mysqlimport
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: SSL options
-.\" SSL options: mysqlimport
\fB\-\-ssl*\fR
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: user option
-.\" user option: mysqlimport
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: use-threads option
-.\" use-threads option: mysqlimport
\fB\-\-use\-threads=\fR\fB\fIN\fR\fR
.sp
Load files in parallel using
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: verbose option
-.\" verbose option: mysqlimport
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlimport: version option
-.\" version option: mysqlimport
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysqlshow\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLSHOW\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLSHOW\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlshow
-.\" databases: displaying
-.\" displaying: database information
-.\" tables: displaying
-.\" columns: displaying
-.\" showing: database information
.SH "NAME"
mysqlshow \- display database, table, and column information
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: help option
-.\" help option: mysqlshow
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: bind-address option
-.\" bind-address option: mysqlshow
\fB\-\-bind\-address=\fR\fB\fIip_address\fR\fR
.sp
On a computer having multiple network interfaces, use this option to select which interface to use for connecting to the MySQL server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: character-sets-dir option
-.\" character-sets-dir option: mysqlshow
\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory where character sets are installed\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: compress option
-.\" compress option: mysqlshow
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: count option
-.\" count option: mysqlshow
\fB\-\-count\fR
.sp
Show the number of rows per table\&. This can be slow for non\-MyISAM
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: debug option
-.\" debug option: mysqlshow
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: debug-check option
-.\" debug-check option: mysqlshow
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: debug-info option
-.\" debug-info option: mysqlshow
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: default-character-set option
-.\" default-character-set option: mysqlshow
\fB\-\-default\-character\-set=\fR\fB\fIcharset_name\fR\fR
.sp
Use
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: default-auth option
-.\" default-auth option: mysqlshow
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: defaults-extra-file option
-.\" defaults-extra-file option: mysqlshow
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: defaults-file option
-.\" defaults-file option: mysqlshow
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlshow
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqlshow
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.)
.sp
This option was added in MySQL 5\&.6\&.28\&.
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: host option
-.\" host option: mysqlshow
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: keys option
-.\" keys option: mysqlshow
\fB\-\-keys\fR,
\fB\-k\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: login-path option
-.\" login-path option: mysqlshow
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: no-defaults option
-.\" no-defaults option: mysqlshow
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: password option
-.\" password option: mysqlshow
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: pipe option
-.\" pipe option: mysqlshow
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: plugin-dir option
-.\" plugin-dir option: mysqlshow
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: port option
-.\" port option: mysqlshow
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: print-defaults option
-.\" print-defaults option: mysqlshow
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: protocol option
-.\" protocol option: mysqlshow
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: secure-auth option
-.\" secure-auth option: mysqlshow
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlshow
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. The default value is
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: show-table-type option
-.\" show-table-type option: mysqlshow
\fB\-\-show\-table\-type\fR,
\fB\-t\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: socket option
-.\" socket option: mysqlshow
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: SSL options
-.\" SSL options: mysqlshow
\fB\-\-ssl*\fR
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: status option
-.\" status option: mysqlshow
\fB\-\-status\fR,
\fB\-i\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: user option
-.\" user option: mysqlshow
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: verbose option
-.\" verbose option: mysqlshow
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlshow: version option
-.\" version option: mysqlshow
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysqlslap\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBMYSQLSLAP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBMYSQLSLAP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqlslap
-.\" load emulation
.SH "NAME"
mysqlslap \- load emulation client
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: help option
-.\" help option: mysqlslap
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql option
-.\" auto-generate-sql option: mysqlslap
\fB\-\-auto\-generate\-sql\fR,
\fB\-a\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-add-autoincrement option
-.\" auto-generate-sql-add-autoincrement option: mysqlslap
\fB\-\-auto\-generate\-sql\-add\-autoincrement\fR
.sp
Add an
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-execute-number option
-.\" auto-generate-sql-execute-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-execute\-number=\fR\fB\fIN\fR\fR
.sp
Specify how many queries to generate automatically\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-guid-primary option
-.\" auto-generate-sql-guid-primary option: mysqlslap
\fB\-\-auto\-generate\-sql\-guid\-primary\fR
.sp
Add a GUID\-based primary key to automatically generated tables\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-load-type option
-.\" auto-generate-sql-load-type option: mysqlslap
\fB\-\-auto\-generate\-sql\-load\-type=\fR\fB\fItype\fR\fR
.sp
Specify the test load type\&. The permissible values are
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-secondary-indexes option
-.\" auto-generate-sql-secondary-indexes option: mysqlslap
\fB\-\-auto\-generate\-sql\-secondary\-indexes=\fR\fB\fIN\fR\fR
.sp
Specify how many secondary indexes to add to automatically generated tables\&. By default, none are added\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-unique-query-number option
-.\" auto-generate-sql-unique-query-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-unique\-query\-number=\fR\fB\fIN\fR\fR
.sp
How many different queries to generate for automatic tests\&. For example, if you run a
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-unique-write-number option
-.\" auto-generate-sql-unique-write-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-unique\-write\-number=\fR\fB\fIN\fR\fR
.sp
How many different queries to generate for
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: auto-generate-sql-write-number option
-.\" auto-generate-sql-write-number option: mysqlslap
\fB\-\-auto\-generate\-sql\-write\-number=\fR\fB\fIN\fR\fR
.sp
-How many row inserts to perform on each thread\&. The default is 100\&.
+How many row inserts to perform\&. The default is 100\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: commit option
-.\" commit option: mysqlslap
\fB\-\-commit=\fR\fB\fIN\fR\fR
.sp
How many statements to execute before committing\&. The default is 0 (no commits are done)\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: compress option
-.\" compress option: mysqlslap
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: concurrency option
-.\" concurrency option: mysqlslap
\fB\-\-concurrency=\fR\fB\fIN\fR\fR,
\fB\-c \fR\fB\fIN\fR\fR
.sp
-The number of clients to simulate when issuing the
-SELECT
-statement\&.
+The number of parallel clients to simulate\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: create option
-.\" create option: mysqlslap
\fB\-\-create=\fR\fB\fIvalue\fR\fR
.sp
The file or string containing the statement to use for creating the table\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: create-schema option
-.\" create-schema option: mysqlslap
\fB\-\-create\-schema=\fR\fB\fIvalue\fR\fR
.sp
The schema in which to run the tests\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: csv option
-.\" csv option: mysqlslap
\fB\-\-csv[=\fR\fB\fIfile_name\fR\fR\fB]\fR
.sp
Generate output in comma\-separated values format\&. The output goes to the named file, or to the standard output if no file is given\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: debug option
-.\" debug option: mysqlslap
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-# [\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: debug-check option
-.\" debug-check option: mysqlslap
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: debug-info option
-.\" debug-info option: mysqlslap
\fB\-\-debug\-info\fR,
\fB\-T\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: default-auth option
-.\" default-auth option: mysqlslap
\fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR
.sp
A hint about the client\-side authentication plugin to use\&. See
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: defaults-extra-file option
-.\" defaults-extra-file option: mysqlslap
\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR
.sp
Read this option file after the global option file but (on Unix) before the user option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: defaults-file option
-.\" defaults-file option: mysqlslap
\fB\-\-defaults\-file=\fR\fB\fIfile_name\fR\fR
.sp
Use only the given option file\&. If the file does not exist or is otherwise inaccessible, an error occurs\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: defaults-group-suffix option
-.\" defaults-group-suffix option: mysqlslap
\fB\-\-defaults\-group\-suffix=\fR\fB\fIstr\fR\fR
.sp
Read not only the usual option groups, but also groups with the usual names and a suffix of
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: delimiter option
-.\" delimiter option: mysqlslap
\fB\-\-delimiter=\fR\fB\fIstr\fR\fR,
\fB\-F \fR\fB\fIstr\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: detach option
-.\" detach option: mysqlslap
\fB\-\-detach=\fR\fB\fIN\fR\fR
.sp
Detach (close and reopen) each connection after each
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: enable-cleartext-plugin option
-.\" enable-cleartext-plugin option: mysqlslap
\fB\-\-enable\-cleartext\-plugin\fR
.sp
Enable the
mysql_clear_password
cleartext authentication plugin\&. (See
-Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
+Section\ \&6.5.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: engine option
-.\" engine option: mysqlslap
\fB\-\-engine=\fR\fB\fIengine_name\fR\fR,
\fB\-e \fR\fB\fIengine_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: host option
-.\" host option: mysqlslap
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: iterations option
-.\" iterations option: mysqlslap
\fB\-\-iterations=\fR\fB\fIN\fR\fR,
\fB\-i \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: login-path option
-.\" login-path option: mysqlslap
\fB\-\-login\-path=\fR\fB\fIname\fR\fR
.sp
Read options from the named login path in the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: no-drop option
-.\" no-drop option: mysqlslap
\fB\-\-no\-drop\fR
.sp
Prevent
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: no-defaults option
-.\" no-defaults option: mysqlslap
\fB\-\-no\-defaults\fR
.sp
Do not read any option files\&. If program startup fails due to reading unknown options from an option file,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: number-char-cols option
-.\" number-char-cols option: mysqlslap
\fB\-\-number\-char\-cols=\fR\fB\fIN\fR\fR,
\fB\-x \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: number-int-cols option
-.\" number-int-cols option: mysqlslap
\fB\-\-number\-int\-cols=\fR\fB\fIN\fR\fR,
\fB\-y \fR\fB\fIN\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: number-of-queries option
-.\" number-of-queries option: mysqlslap
\fB\-\-number\-of\-queries=\fR\fB\fIN\fR\fR
.sp
Limit each client to approximately this many queries\&. Query counting takes into account the statement delimiter\&. For example, if you invoke
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: only-print option
-.\" only-print option: mysqlslap
\fB\-\-only\-print\fR
.sp
Do not connect to databases\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: password option
-.\" password option: mysqlslap
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: pipe option
-.\" pipe option: mysqlslap
\fB\-\-pipe\fR,
\fB\-W\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: plugin-dir option
-.\" plugin-dir option: mysqlslap
\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR
.sp
The directory in which to look for plugins\&. Specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: port option
-.\" port option: mysqlslap
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: post-query option
-.\" post-query option: mysqlslap
\fB\-\-post\-query=\fR\fB\fIvalue\fR\fR
.sp
The file or string containing the statement to execute after the tests have completed\&. This execution is not counted for timing purposes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: post-system option
-.\" post-system option: mysqlslap
\fB\-\-post\-system=\fR\fB\fIstr\fR\fR
.sp
The string to execute using
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: pre-query option
-.\" pre-query option: mysqlslap
\fB\-\-pre\-query=\fR\fB\fIvalue\fR\fR
.sp
The file or string containing the statement to execute before running the tests\&. This execution is not counted for timing purposes\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: pre-system option
-.\" pre-system option: mysqlslap
\fB\-\-pre\-system=\fR\fB\fIstr\fR\fR
.sp
The string to execute using
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: print-defaults option
-.\" print-defaults option: mysqlslap
\fB\-\-print\-defaults\fR
.sp
Print the program name and all options that it gets from option files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: protocol option
-.\" protocol option: mysqlslap
\fB\-\-protocol={TCP|SOCKET|PIPE|MEMORY}\fR
.sp
The connection protocol to use for connecting to the server\&. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want\&. For details on the permissible values, see
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: query option
-.\" query option: mysqlslap
\fB\-\-query=\fR\fB\fIvalue\fR\fR,
\fB\-q \fR\fB\fIvalue\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: secure-auth option
-.\" secure-auth option: mysqlslap
\fB\-\-secure\-auth\fR
.sp
Do not send passwords to the server in old (pre\-4\&.1) format\&. This prevents connections except for servers that use the newer password format\&. This option is enabled by default; use
.ps -1
.br
Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see
-Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+Section\ \&6.5.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&.
+.sp .5v
+.RE
+.if n \{\
+.sp
+.\}
+.RS 4
+.it 1 an-trap
+.nr an-no-space-flag 1
+.nr an-break-flag 1
+.br
+.ps +1
+\fBNote\fR
+.ps -1
+.br
+This option is deprecated and will be removed in a future release\&. As of MySQL 5\&.7\&.5, it is always enabled and attempting to disable it produces an error\&.
.sp .5v
.RE
.RE
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: shared-memory-base-name option
-.\" shared-memory-base-name option: mysqlslap
\fB\-\-shared\-memory\-base\-name=\fR\fB\fIname\fR\fR
.sp
On Windows, the shared\-memory name to use, for connections made using shared memory to a local server\&. This option applies only if the server supports shared\-memory connections\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: silent option
-.\" silent option: mysqlslap
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: socket option
-.\" socket option: mysqlslap
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: SSL options
-.\" SSL options: mysqlslap
\fB\-\-ssl*\fR
.sp
Options that begin with
\fB\-\-ssl\fR
specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See
-Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&.
+Section\ \&6.4.5, \(lqCommand Options for Secure Connections\(rq\&.
.RE
.sp
.RS 4
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: user option
-.\" user option: mysqlslap
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: verbose option
-.\" verbose option: mysqlslap
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqlslap: version option
-.\" version option: mysqlslap
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBmysqltest\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL
.\" Language: English
.\"
-.TH "\FBMYSQLTEST\FR" "1" "03/02/2016" "MySQL" "MySQL Database System"
+.TH "\FBMYSQLTEST\FR" "1" "08/25/2016" "MySQL" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" mysqltest
-.\" mysqltest_embedded
.SH "NAME"
mysqltest \- program to run test cases
.br
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: help option
-.\" help option: mysqltest
\fB\-\-help\fR,
\fB\-?\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: basedir option
-.\" basedir option: mysqltest
\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR,
\fB\-b \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: character-sets-dir option
-.\" character-sets-dir option: mysqltest
\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR
.sp
The directory where character sets are installed\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: compress option
-.\" compress option: mysqltest
\fB\-\-compress\fR,
\fB\-C\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: currsor-protocol option
-.\" cursor-protocol option: mysqltest
\fB\-\-cursor\-protocol\fR
.sp
Use cursors for prepared statements\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: database option
-.\" database option: mysqltest
\fB\-\-database=\fR\fB\fIdb_name\fR\fR,
\fB\-D \fR\fB\fIdb_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: debug option
-.\" debug option: mysqltest
\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR,
\fB\-#[\fR\fB\fIdebug_options\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: debug-check option
-.\" debug-check option: mysqltest
\fB\-\-debug\-check\fR
.sp
Print some debugging information when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: debug-info option
-.\" debug-info option: mysqltest
\fB\-\-debug\-info\fR
.sp
Print debugging information and memory and CPU usage statistics when the program exits\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: explain-protocol option
-.\" explain-protocol option: mysqltest
\fB\-\-explain\-protocol\fR,
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: host option
-.\" host option: mysqltest
\fB\-\-host=\fR\fB\fIhost_name\fR\fR,
\fB\-h \fR\fB\fIhost_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: include option
-.\" include option: mysqltest
\fB\-\-include=\fR\fB\fIfile_name\fR\fR,
\fB\-i \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: json-explain-protocol option
-.\" json-explain-protocol option: mysqltest
\fB\-\-json\-explain\-protocol\fR,
.sp
Run
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: logdir option
-.\" logdir option: mysqltest
\fB\-\-logdir=\fR\fB\fIdir_name\fR\fR
.sp
The directory to use for log files\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: mark-progress option
-.\" mark-progress option: mysqltest
\fB\-\-mark\-progress\fR
.sp
Write the line number and elapsed time to
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: max-connect-retries option
-.\" max-connect-retries option: mysqltest
\fB\-\-max\-connect\-retries=\fR\fB\fInum\fR\fR
.sp
The maximum number of connection attempts when connecting to server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: max-connections option
-.\" max-connections option: mysqltest
\fB\-\-max\-connections=\fR\fB\fInum\fR\fR
.sp
The maximum number of simultaneous server connections per client (that is, per test)\&. If not set, the maximum is 128\&. Minimum allowed limit is 8, maximum is 5120\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: no-defaults option
-.\" no-defaults option: mysqltest
\fB\-\-no\-defaults\fR
.sp
Do not read default options from any option files\&. If used, this must be the first option\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: plugin-dir option
-.\" plugin-dir option: mysqltest
\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR
.sp
The directory in which to look for plugins\&. It may be necessary to specify this option if the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: password option
-.\" password option: mysqltest
\fB\-\-password[=\fR\fB\fIpassword\fR\fR\fB]\fR,
\fB\-p[\fR\fB\fIpassword\fR\fR\fB]\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: port option
-.\" port option: mysqltest
\fB\-\-port=\fR\fB\fIport_num\fR\fR,
\fB\-P \fR\fB\fIport_num\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: protocol option
-.\" protocol option: mysqltest
\fB\-\-protocol=\fR\fB{TCP|SOCKET|PIPE|MEMORY}\fR
.sp
Choose the protocol for communication with the server\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: ps-protocol option
-.\" ps-protocol option: mysqltest
\fB\-\-ps\-protocol\fR
.sp
Use the prepared\-statement protocol for communication\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: quiet option
-.\" quiet option: mysqltest
\fB\-\-quiet\fR
.sp
Suppress all normal output\&. This is a synonym for
-.\" mysqltest: silent option
-.\" silent option: mysqltest
\fB\-\-silent\fR\&.
.RE
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: record option
-.\" record option: mysqltest
\fB\-\-record\fR,
\fB\-r\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: result-file option
-.\" result-file option: mysqltest
\fB\-\-result\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-R \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: server-arg option
-.\" server-arg option: mysqltest
\fB\-\-server\-arg=\fR\fB\fIvalue\fR\fR,
\fB\-A \fR\fB\fIvalue\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: server-file option
-.\" server-file option: mysqltest
\fB\-\-server\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-F \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: server-public-key-path option
-.\" server-public-key-path option: mysqltest
\fB\-\-server\-public\-key\-path=\fR\fBfile_name\fR
.sp
The path name to a file containing the server RSA public key\&. The file must be in PEM format\&. The public key is used for RSA encryption of the client password for connections to the server made using accounts that authenticate with the
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: silent option
-.\" silent option: mysqltest
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: skip-safemalloc option
-.\" skip-safemalloc option: mysqltest
\fB\-\-skip\-safemalloc\fR
.sp
Do not use memory allocation checking\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: sleep option
-.\" sleep option: mysqltest
\fB\-\-sleep=\fR\fB\fInum\fR\fR,
\fB\-T \fR\fB\fInum\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: socket option
-.\" socket option: mysqltest
\fB\-\-socket=\fR\fB\fIpath\fR\fR,
\fB\-S \fR\fB\fIpath\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: sp-protocol option
-.\" sp-protocol option: mysqltest
\fB\-\-sp\-protocol\fR
.sp
Execute DML statements within a stored procedure\&. For every DML statement,
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: tail-lines option
-.\" tail-lines option: mysqltest
\fB\-\-tail\-lines=\fR\fB\fInn\fR\fR
.sp
Specify how many lines of the result to include in the output if the test fails because an SQL statement fails\&. The default is 0, meaning no lines of result printed\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: test-file option
-.\" test-file option: mysqltest
\fB\-\-test\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-x \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: timer-file option
-.\" timer-file option: mysqltest
\fB\-\-timer\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-m \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: tls-version option
-.\" tls-version option: mysqltest
\fB\-\-tls\-version=\fR\fB\fIprotocol_list\fR\fR
.sp
The protocols permitted by the client for encrypted connections\&. The value is a comma\-separated list containing one or more of these protocols: TLSv1, TLSv1\&.1, TLSv1\&.2\&. (TLSv1\&.2 is supported only if MySQL was compiled using OpenSSL 1\&.0\&.1 or higher\&. It is not supported if MySQL was compiled using yaSSL\&.)
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: tmpdir option
-.\" tmpdir option: mysqltest
\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR,
\fB\-t \fR\fB\fIdir_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: trace-exec option
-.\" trace-exec option: mysqltest
\fB\-\-trace\-exec\fR
.sp
If enabled, this option causes
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: user option
-.\" user option: mysqltest
\fB\-\-user=\fR\fB\fIuser_name\fR\fR,
\fB\-u \fR\fB\fIuser_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: verbose option
-.\" verbose option: mysqltest
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: version option
-.\" version option: mysqltest
\fB\-\-version\fR,
\fB\-V\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" mysqltest: view-protocol option
-.\" view-protocol option: mysqltest
\fB\-\-view\-protocol\fR
.sp
Every
-.so man/mysqltest.1
+.so mysqltest.1
'\" t
.\" Title: \fBperror\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBPERROR\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBPERROR\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" perror
-.\" error messages: displaying
-.\" errno
-.\" Errcode
.SH "NAME"
perror \- explain error codes
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: help option
-.\" help option: perror
\fB\-\-help\fR,
\fB\-\-info\fR,
\fB\-I\fR,
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: ndb option
-.\" ndb option: perror
\fB\-\-ndb\fR
.sp
Print the error message for a MySQL Cluster error code\&.
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: silent option
-.\" silent option: perror
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: verbose option
-.\" verbose option: perror
\fB\-\-verbose\fR,
\fB\-v\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" perror: version option
-.\" version option: perror
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBreplace\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBREPLACE\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBREPLACE\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" replace utility
-.\" string replacement: replace utility
.SH "NAME"
replace \- a string\-replacement utility
.SH "SYNOPSIS"
'\" t
.\" Title: \fBresolve_stack_dump\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBRESOLVE_STACK_DUM" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBRESOLVE_STACK_DUM" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" resolve_stack_dump
.SH "NAME"
resolve_stack_dump \- resolve numeric stack trace dump to symbols
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" resolve_stack_dump: help option
-.\" help option: resolve_stack_dump
\fB\-\-help\fR,
\fB\-h\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" resolve_stack_dump: numeric-dump-file option
-.\" numeric-dump-file option: resolve_stack_dump
\fB\-\-numeric\-dump\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-n \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" resolve_stack_dump: symbols-file option
-.\" symbols-file option: resolve_stack_dump
\fB\-\-symbols\-file=\fR\fB\fIfile_name\fR\fR,
\fB\-s \fR\fB\fIfile_name\fR\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" resolve_stack_dump: version option
-.\" version option: resolve_stack_dump
\fB\-\-version\fR,
\fB\-V\fR
.sp
'\" t
.\" Title: \fBresolveip\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 03/02/2016
+.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+.\" Date: 08/25/2016
.\" Manual: MySQL Database System
.\" Source: MySQL 5.6
.\" Language: English
.\"
-.TH "\FBRESOLVEIP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System"
+.TH "\FBRESOLVEIP\FR" "1" "08/25/2016" "MySQL 5\&.6" "MySQL Database System"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
-.\" resolveip
.SH "NAME"
resolveip \- resolve host name to IP address or vice versa
.SH "SYNOPSIS"
.sp -1
.IP \(bu 2.3
.\}
-.\" resolveip: help option
-.\" help option: resolveip
\fB\-\-help\fR,
\fB\-\-info\fR,
\fB\-?\fR,
.sp -1
.IP \(bu 2.3
.\}
-.\" resolveip: silent option
-.\" silent option: resolveip
\fB\-\-silent\fR,
\fB\-s\fR
.sp
.sp -1
.IP \(bu 2.3
.\}
-.\" resolveip: version option
-.\" version option: resolveip
\fB\-\-version\fR,
\fB\-V\fR
.sp
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
- is not null;
+ is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval select
@a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR
# they are declared without DEFAULT clause.
sync_slave_with_master;
+ --replace_column 4 CURRENT_TIMESTAMP
select * from t9;
+ # Bug #22916743 RBR DOES NOT USE DEFAULT CURRENT_TIMESTAMP FOR EXTRA COLUMN
+ # ON SLAVE
+ --let $assert_text= The values of column 'd' should have non-zero timetsamp.
+ --let $assert_cond= [SELECT COUNT(*) AS Val FROM t9 WHERE d = "0000-00-00 00:00:00", Val, 1] = 0
+ --source include/assert.inc
+ # End of test for Bug #22916743
+
# todo: fix Bug #43992 slave sql thread can't tune own sql_mode ...
# and add/restore waiting for stop test
--- /dev/null
+# Following test first creates two databases (d1 and d2) and setup slave to use
+# two parallel workers. The test case then insert on the slave a tuple that will
+# block writes on d2 and generate gaps.
+
+--let $slave_stop_wait=5
+
+--echo #### I. Initialize ####
+
+--source include/rpl_connection_slave.inc
+--source include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+--eval set @@global.innodb_lock_wait_timeout=$slave_stop_wait + 1000
+
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+
+--echo #### II. Prepare test scenario ####
+
+--source include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local'); # Hold T3
+INSERT INTO d1.t VALUES (3, 'Slave local'); # Hold T6
+
+--source include/rpl_connection_master.inc
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3'); # This will be a gap when executed on slave
+INSERT INTO d2.t VALUES (3, 'T4'); # This will be a gap when executed on slave
+INSERT INTO d1.t VALUES (2, 'T5');
+
+--source include/rpl_connection_slave1.inc
+--let $table=d1.t
+--let $count=2
+--source include/wait_until_rows_count.inc
+
+--echo # Now d1.t has two rows and d2.t has one row.
+
+# Wait for coordinator to populate worker's queues.
+--let $show_statement= SHOW PROCESSLIST
+--let $field= State
+--let $condition= = 'Slave has read all relay log; waiting for the slave I/O thread to update it'
+--source include/wait_show_condition.inc
--- /dev/null
+###############################################################################
+# Bug#21507981: REPLICATION POSITION LOST AFTER CRASH ON MTS CONFIGURED SLAVE
+#
+# Problem:
+# ========
+# Enable MTS along with crash-safe replication tables. Make sure that the server
+# is busily inserting data with multiple threads in parallel. Shutdown mysqld
+# uncleanly (kill -9 or power off server without notice).
+#
+# Now users are restarting the server with --relay-log-recovery=1 to recover the
+# crashed slave.
+#
+# This results in following error:
+# ================================
+# 2015-06-24 13:49:03 3895 [ERROR] --relay-log-recovery cannot
+# be executed when the slave was stopped with an error or
+# killed in MTS mode; consider using RESET SLAVE or restart
+# the server with --relay-log-recovery = 0 followed by
+# START SLAVE UNTIL SQL_AFTER_MTS_GAPS.
+#
+# i.e relay-log-recovery will not work in MTS mode.
+###############################################################################
+# Following test demonstrates that when gaps are generated due to MTS crash
+# but not due to an error then recovery should be successful with
+# --relay-log-recovery=1 option.
+#
+# ==== Usage ====
+# --let $skip_slave_start_var= BOOL [ TRUE / FALSE ]
+# --source extra/rpl_tests/rpl_mts_relay_log_recovery.test
+#
+# Parameters:
+#
+# $skip_slave_start_var
+# Boolean that specifies if 'skip_slave_start' server parameter should be
+# TRUE or FALSE.
+#
+# Testing Method:
+# ===============
+# It first creates two databases (d1 and d2) and setup slave to use two parallel
+# workers. The test case then insert on the slave a tuple that will block
+# writes on d2 and generate gaps. Crash the slave server at this point and
+# bring it back with --relay-log-recovery=1 and crash safe tables. Recovery
+# should be successful.
+
+--source extra/rpl_tests/rpl_generate_mts_gap.test
+
+--source include/rpl_connection_slave.inc
+CALL mtr.add_suppression("Recovery from master pos");
+# Kill the slave server
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+let PID_FILE= `SELECT @@pid_file`;
+perl;
+use strict;
+my $file= $ENV{'PID_FILE'} or die "Pid file not set";
+open(FILE, "$file") or die("Unable to open $file: $!\n");
+my $pid=0;
+while (<FILE>) {
+ $pid = $_;
+}
+close(FILE);
+kill 9, $pid;
+EOF
+
+# Restart the slave server
+--let $rpl_server_number= 2
+--let $rpl_server_parameters= --skip_slave_start=$skip_slave_start_var --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1
+--source include/rpl_start_server.inc
+
+--exec echo "After restart gaps should be filled."
+
+--let $assert_text= Table d1.t should contain 2 rows.
+--let $assert_cond= [select count(*) from d1.t] = 2
+--source include/assert.inc
+
+--let $assert_text= Table d2.t should contain 3 rows.
+--let $assert_cond= [select count(*) from d2.t] = 3
+--source include/assert.inc
+
+--source include/start_slave.inc
+
+# Check consistency
+--source include/rpl_connection_master.inc
+--source include/sync_slave_sql_with_master.inc
+--let $diff_tables= master:d1.t, slave:d1.t
+--source include/diff_tables.inc
+
+--let $diff_tables= master:d2.t, slave:d2.t
+--source include/diff_tables.inc
+
+#
+# Cleanup
+#
+--source include/rpl_connection_master.inc
+DROP DATABASE d1;
+DROP DATABASE d2;
}
}
--eval EXPLAIN FORMAT=JSON $query;
-if ($validation) {
---disable_query_log
---replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--disable_result_log
--exec $MYSQL -S $MASTER_MYSOCK -u root -r test -e "EXPLAIN FORMAT=JSON $query;" > $MYSQLTEST_VARDIR/tmp/explain.json
---replace_regex /[-]*// /FILE.[\/\\:_\.0-9A-Za-z]*/Validation:/
---exec python $MYSQL_TEST_DIR/suite/opt_trace/validate_json.py $MYSQLTEST_VARDIR/tmp/explain.json
+--exec perl $MYSQL_TEST_DIR/suite/opt_trace/validate_json.pl $MYSQLTEST_VARDIR/tmp/explain.json
--remove_file '$MYSQLTEST_VARDIR/tmp/explain.json'
---enable_query_log
-}
+--enable_result_log
}
if ($select) {
}
}
--eval EXPLAIN FORMAT=JSON $select;
-if ($validation) {
---disable_query_log
---replace_result $MASTER_MYSOCK MASTER_MYSOCK
+--disable_result_log
--exec $MYSQL -S $MASTER_MYSOCK -u root -r test -e "EXPLAIN FORMAT=JSON $select;" > $MYSQLTEST_VARDIR/tmp/explain.json
---replace_regex /[-]*// /FILE.[\/\\:_\.0-9A-Za-z]*/Validation:/
---exec python $MYSQL_TEST_DIR/suite/opt_trace/validate_json.py $MYSQLTEST_VARDIR/tmp/explain.json
+--exec perl $MYSQL_TEST_DIR/suite/opt_trace/validate_json.pl $MYSQLTEST_VARDIR/tmp/explain.json
--remove_file '$MYSQLTEST_VARDIR/tmp/explain.json'
---enable_query_log
-}
+--enable_result_log
}
}
-let $wait_timeout = 10;
let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'ON';
--source include/wait_condition.inc
--- Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+-- Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
("Changed limits: table_open_cache: *"),
("Could not increase number of max_open_files to more than *"),
+ /*
+ Warnings related to --secure-file-priv
+ */
+ ("Insecure configuration for --secure-file-priv:*"),
+
/*
Galera suppressions
*/
("WSREP: Failed to prepare for incremental state transfer: Local state seqno is undefined:"),
("WSREP: gcs_caused\\(\\) returned -107 \\(Transport endpoint is not connected\\)"),
("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)"),
- ("WSREP: Action message in non-primary configuration from member 0"),
+ ("Action message in non-primary configuration 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"),
+-- "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"),
+ ("install timer expired"),
+ ("Last Applied Action message in non-primary configuration from member"),
("THE_LAST_SUPPRESSION")||
# their paths may vary:
@skipvars=qw/basedir open-files-limit general-log-file plugin-dir
pid-file slow-query-log-file
- datadir slave-load-tmpdir tmpdir socket table-definition-cache table-open-cache wsrep-node-name/;
+ datadir slave-load-tmpdir tmpdir socket table-definition-cache table-open-cache secure-file-priv wsrep-node-name/;
# Plugins which may or may not be there:
@plugins=qw/innodb ndb ndbinfo archive blackhole federated partition ndbcluster debug temp-pool ssl des-key-file
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
--list_files $MYSQLD_DATADIR/hotcopy_save
--replace_result $MASTER_MYSOCK MASTER_MYSOCK
---error 9,11,110,2304
+--error 9,11,110,2304,255
--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
innodb_engine plugin/innodb_memcached/innodb_memcache INNODB_ENGINE
validate_password plugin/password_validation VALIDATE_PASSWORD validate_password
mysql_no_login plugin/mysql_no_login MYSQL_NO_LOGIN mysql_no_login
+test_udf_services plugin/udf_services TESTUDFSERVICES
+connection_control plugin/connection_control CONNECTION_CONTROL_PLUGIN connection_control
SELECT 1 FROM t1 WHERE a <> 'a' OR a <> "";
-DROP TABLE t1;
\ No newline at end of file
+DROP TABLE t1;
+
+--echo #
+--echo # Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+--echo # INDEX, EVEN THOUGH COST IS HIGHER
+--echo #
+
+CREATE TABLE `giant_table` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `one_id` int(11) NOT NULL,
+ `other_id` bigint(20) NOT NULL DEFAULT '0',
+ `some_other_id` int(11) DEFAULT 0 NOT NULL,
+ `something` double NOT NULL DEFAULT '0',
+ `comment` text COLLATE utf8_unicode_ci,
+ `flags` int(11) NOT NULL DEFAULT '0',
+ `time_created` int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ KEY `time_created` (`time_created`),
+ KEY `some_other_id` (`some_other_id`),
+ KEY `one_other_idx` (`one_id`,`other_id`),
+ KEY `other_id` (`other_id`,`time_created`)
+) ENGINE=InnoDB AUTO_INCREMENT=101651329
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
+
+CREATE TABLE t1 (c1 INT);
+INSERT INTO t1 VALUES (66136540), (68983250), (89627210), (77869520),
+ (82543190), (67538270), (77282760), (77908170),
+ (70923370), (68066360);
+DELIMITER $;
+CREATE PROCEDURE p()
+BEGIN
+SET @x = 1;
+REPEAT
+
+INSERT INTO giant_table(id,one_id)
+ SELECT c1 + @x, 0
+ FROM t1
+ WHERE c1 IN (66136540, 68985250, 89627210, 77869520 , 82543190, 67538270,
+ 77282760, 77908170, 70923370, 68066360);
+SET @x = @x + 1;
+
+UNTIL @x > 30 END REPEAT;
+END $
+DELIMITER ;$
+
+CALL p();
+SELECT count(*) FROM giant_table;
+
+INSERT INTO giant_table (id,one_id) VALUES (66136539, 0), (68983258,1),
+ (89628210,1), (77869520,2);
+INSERT INTO giant_table (id,one_id, some_other_id) VALUES(84673401, 0, 1),
+ (61069031, 1, 1);
+
+EXPLAIN SELECT id, something, comment, time_created, one_id, other_id,
+ some_other_id, flags
+FROM giant_table
+WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272,
+ 84673401, 61069031, 68214385, 77282865, 76991297, 64569216,
+ 89481638, 74534074, 70396537, 80076375, 63308530, 77908270,
+ 70923271, 68066180)
+ AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0;
+
+DROP PROCEDURE p;
+DROP TABLE giant_table, t1;
# New tests go here.
--echo # End of 5.6 tests
+
+--echo # Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+
+let $query=
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+ FROM t1
+ WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+ )
+ FROM t2
+ ) AS z;
+
+eval explain $query;
+eval $query;
+
+DROP TABLE t1, t2;
+
+# A test case containing two outer references from different query blocks
+# Debugging is needed to inspect correct transformation, unfortunately.
+
+CREATE TABLE t1(a INTEGER) engine=innodb;
+
+let $query=
+SELECT (SELECT a
+ FROM t1 AS t2
+ WHERE a IN (SELECT t1.a+t2.a
+ FROM t1 AS t3))
+FROM t1 AS t1;
+
+eval explain $query;
+eval $query;
+
+DROP TABLE t1;
+
+--echo # End of test for Bug#21139722
+
+--echo #
+--echo # Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+let $query=
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+ FROM t1
+ WHERE b)
+ FROM t2);
+eval EXPLAIN $query;
+eval $query;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+--echo # RESULTS IN 5.6
+--echo #
+
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+
+let query=
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+ FROM t AS t2
+ WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+ FROM t AS t3
+ WHERE t3.b=1));
+
+eval EXPLAIN extended $query;
+eval $query;
+
+DROP TABLE t;
let $wait_condition_reps= 0;
while ($wait_counter)
{
- --error 0,ER_NO_SUCH_TABLE,ER_LOCK_WAIT_TIMEOUT,ER_UNKNOWN_COM_ERROR
+ --error 0,ER_NO_SUCH_TABLE,ER_LOCK_WAIT_TIMEOUT,ER_UNKNOWN_COM_ERROR,ER_LOCK_DEADLOCK
let $success= `$wait_condition`;
inc $wait_condition_reps;
if ($success)
# -*- cperl -*-
-# Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
return undef;
}
+sub _sysctl {
+ my ($self)= @_;
+ my $ncpu= `sysctl hw.ncpu 2> /dev/null`;
+ if ($ncpu eq '') {
+ return undef;
+ }
+
+ my $cpuinfo= {};
+ $ncpu =~ s/\D//g;
+ my $list = `sysctl machdep.cpu | grep machdep\.cpu\.[^.]*: 2> /dev/null`;
+ my @lines= split('\n', $list);
+
+ foreach my $line (@lines) {
+ # Default value, the actual cpu values can be used to decrease this
+ # on slower cpus
+ $cpuinfo->{bogomips}= DEFAULT_BOGO_MIPS;
+
+ my ($statistic, $value)=
+ $line=~ /machdep\.cpu\.(.*):\s+(.*)/;
+ $cpuinfo->{$statistic}= $value;
+ }
+
+ for (1..$ncpu) {
+ my $temp_cpuinfo = $cpuinfo;
+ $temp_cpuinfo->{processor}= $_;
+ push(@{$self->{cpus}}, $temp_cpuinfo);
+ }
+
+ # At least one cpu should have been found
+ # if this method worked
+ if ( $self->{cpus} ) {
+ return $self;
+ }
+}
sub _unamex {
my ($self)= @_;
(
\&_cpuinfo,
\&_kstat,
+ \&_sysctl,
\&_unamex,
);
# Return the number of cpus found
sub num_cpus {
+ if (IS_WINDOWS) {
+ return $ENV{NUMBER_OF_PROCESSORS} || 1;
+ }
my ($self)= @_;
return int(@{$self->{cpus}}) or
confess "INTERNAL ERROR: No cpus in list";
#!/usr/bin/perl
# -*- cperl -*-
-# Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# If you add a new suite, please check TEST_DIRS in Makefile.am.
#
-my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,innodb,innodb_fts,innodb_zip,perfschema,funcs_1,opt_trace,parts,auth_sec";
+my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,innodb,innodb_fts,innodb_zip,perfschema,funcs_1,opt_trace,parts,auth_sec,connection_control";
my $opt_suites;
our $opt_verbose= 0; # Verbose output, enable with --verbose
for my $limit (2000, 1500, 1000, 500){
$opt_parallel-- if ($sys_info->min_bogomips() < $limit);
}
- my $max_par= $ENV{MTR_MAX_PARALLEL} || 8;
- $opt_parallel= $max_par if ($opt_parallel > $max_par);
- $opt_parallel= $num_tests if ($opt_parallel > $num_tests);
- $opt_parallel= 1 if (IS_WINDOWS and $sys_info->isvm());
+ if(defined $ENV{MTR_MAX_PARALLEL}) {
+ my $max_par= $ENV{MTR_MAX_PARALLEL};
+ $opt_parallel= $max_par if ($opt_parallel > $max_par);
+ }
$opt_parallel= 1 if ($opt_parallel < 1);
- mtr_report("Using parallel: $opt_parallel");
}
+ # Limit parallel workers to number of tests to avoid idle workers
+ $opt_parallel= $num_tests if ($num_tests > 0 and $opt_parallel > $num_tests);
$ENV{MTR_PARALLEL} = $opt_parallel;
+ mtr_report("Using parallel: $opt_parallel");
if ($opt_parallel > 1 && ($opt_start_exit || $opt_stress)) {
mtr_warning("Parallel cannot be used with --start-and-exit or --stress\n" .
if ( lc($opt_build_thread) eq 'auto' ) {
my $found_free = 0;
$build_thread = 300; # Start attempts from here
+
+ my $build_thread_upper = $build_thread + ($opt_parallel > 39
+ ? $opt_parallel + int($opt_parallel / 4)
+ : 49);
while (! $found_free)
{
- $build_thread= mtr_get_unique_id($build_thread, 349);
+ $build_thread= mtr_get_unique_id($build_thread, $build_thread_upper);
if ( !defined $build_thread ) {
mtr_error("Could not get a unique build thread id");
}
mtr_init_args(\$args);
mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--datadir=%s", mixed_path($tmpdir));
+ mtr_add_arg($args, "--secure-file-priv=\"\"");
mtr_add_arg($args, "--lc-messages-dir=%s", $path_language);
mtr_add_arg($args, "--skip-grant-tables");
mtr_add_arg($args, "--verbose");
mtr_add_arg($args, "--loose-skip-falcon");
mtr_add_arg($args, "--loose-skip-ndbcluster");
mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/");
+ mtr_add_arg($args, "--secure-file-priv=%s", "$opt_vardir");
mtr_add_arg($args, "--innodb-log-file-size=5M");
mtr_add_arg($args, "--core-file");
# over writing innodb_autoextend_increment to 8 for reducing the ibdata1 file size
$exe= "strace";
mtr_add_arg($args, "-o");
mtr_add_arg($args, "%s/log/mysqltest.strace", $opt_vardir);
+ mtr_add_arg($args, "-f");
mtr_add_arg($args, "$exe_mysqltest");
}
mtr_add_arg($args, "-o");
mtr_add_arg($args, "%s/log/%s.strace", $opt_vardir, $type);
+ mtr_add_arg($args, "-f");
mtr_add_arg($args, $$exe);
$$exe= "strace";
}
PRIMARY KEY (`fld1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
DROP TABLE t1;
+#
+# Bug#19635706
+# Verify that it is possible to add a unique key to a not-NULL POINT
+# column and that this key is promoted to primary key
+#
+CREATE TABLE t1(a INT NOT NULL, b POINT NOT NULL) ENGINE=INNODB;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` point NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD UNIQUE INDEX (b);
+# Note that SHOW CREATE TABLE does not list b as a primary key,
+# even though it was promoted. This appears to be the case also
+# for other column types.
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` point NOT NULL,
+ UNIQUE KEY `b` (`b`(25))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD UNIQUE INDEX (a);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` point NOT NULL,
+ UNIQUE KEY `b` (`b`(25)),
+ UNIQUE KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+# Verify that the expected indices have been created by Innodb
+SELECT T.NAME AS TABLE_NAME, I.NAME AS INDEX_NAME,
+CASE I.TYPE
+WHEN 0 THEN 'Secondary'
+WHEN 1 THEN 'Clustered'
+WHEN 2 THEN 'Unique'
+WHEN 3 THEN 'Primary'
+WHEN 32 THEN 'Full text'
+WHEN 64 THEN 'Spatial'
+ELSE 'Unknown'
+END AS INDEX_TYPE,
+F.NAME AS FIELD_NAME, F.POS AS FIELD_POS FROM
+INFORMATION_SCHEMA.INNODB_SYS_TABLES AS T JOIN
+INFORMATION_SCHEMA.INNODB_SYS_INDEXES AS I JOIN
+INFORMATION_SCHEMA.INNODB_SYS_FIELDS AS F
+ON I.INDEX_ID = F.INDEX_ID AND I.TABLE_ID = T.TABLE_ID
+WHERE T.NAME = 'test/t1';
+TABLE_NAME INDEX_NAME INDEX_TYPE FIELD_NAME FIELD_POS
+test/t1 b Primary b 0
+test/t1 a Unique a 0
+DROP TABLE t1;
drop database if exists events_test;
create database events_test;
use events_test;
-create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
+create event e_26 on schedule at '2038-01-19 03:14:07' disable do set @a = 5;
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion
-events_test e_26 set @a = 5 root@localhost 2017-01-01 00:00:00 DROP
+events_test e_26 set @a = 5 root@localhost 2038-01-19 03:14:07 DROP
drop event e_26;
create event e_26 on schedule at NULL disable do set @a = 5;
ERROR HY000: Incorrect AT value: 'NULL'
2 public data:
DROP TABLE t1;
#
+# Bug#22888420 CONCAT_WS: ASSERTION FAILED: !S.USES_BUFFER_OWNED_BY(THIS)
+#
+do concat('a',concat_ws('a', 0x2859, 'a' ,
+trim(period_add('a',1) from (1&''))
+)
+);
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: ''
+Warning 1292 Truncated incorrect INTEGER value: 'a'
+#
# End of 5.6 tests
#
UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
DROP TABLE t2, t1;
+#
+# BUG#22037930: INSERT IGNORE FAILS TO IGNORE FOREIGN
+# KEY CONSTRAINT
+CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= INNODB;
+CREATE TABLE t2 (fld1 VARCHAR(10), fld2 INT NOT NULL,
+CONSTRAINT fk FOREIGN KEY (fld2) REFERENCES t1(fld1)) ENGINE= INNODB;
+# Without patch, reports incorrect error.
+INSERT INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+REPLACE INTO t2 VALUES('abc', 2);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
+INSERT IGNORE INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
+Warnings:
+Warning 1452 `test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)
+DROP TABLE t2, t1;
--- /dev/null
+# Bug#22559575 "the statement (1) has no open cursor" pops sometimes with
+# prepared+query_cache
+#
+# Create relevent tables and call C API test cases
+# Setup
+select VARIABLE_VALUE into @qcache_hit_val1 from
+information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Qcache_hits';
+
+#Run C_API test case
+select VARIABLE_VALUE into @qcache_hit_val2 from
+information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Qcache_hits';
+SELECT @qcache_hit_val2 - @qcache_hit_val1;
+@qcache_hit_val2 - @qcache_hit_val1
+1
# normally.
mysqld is alive
#### End of test ####
+#
+# Bug #24557925: MYSQL_CONFIG_EDITOR CAN MAKE SERVER UNBOOTABLE
+#
+# Restarting the server. Should work
+# Cleanup
+# End of 5.6 tests
# Show the help.
#
mysql_plugin Ver V.V.VV Distrib XX.XX.XX
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
Enable or disable plugins.
FLUSH LOGS;
SELECT
(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
-IS NOT NULL;
-(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
-IS NOT NULL
+IS NOT NULL AS Loaded;
+Loaded
1
*** Unsigned server_id 4294967295 is found: 1 ***
SET @@global.server_id= 1;
rpl-stop-slave-timeout 31536000
safe-user-create FALSE
secure-auth TRUE
-secure-file-priv (No default value)
server-id 0
server-id-bits 32
show-old-temporals FALSE
wsrep-forced-binlog-format NONE
wsrep-load-data-splitting TRUE
wsrep-log-conflicts FALSE
-wsrep-max-ws-rows 131072
-wsrep-max-ws-size 1073741824
+wsrep-max-ws-rows 0
+wsrep-max-ws-size 2147483647
wsrep-mysql-replication-bundle 0
wsrep-node-address
wsrep-node-incoming-address AUTO
rpl-stop-slave-timeout 31536000
safe-user-create FALSE
secure-auth TRUE
-secure-file-priv (No default value)
server-id 0
server-id-bits 32
shared-memory FALSE
# test.t1 have partitions in mysqltest2-directory!
# user root:
CREATE USER mysqltest_1@localhost;
+# Need FILE permission to use external datadir or indexdir.
+GRANT FILE ON *.* TO mysqltest_1@localhost;
CREATE DATABASE mysqltest2;
USE mysqltest2;
CREATE TABLE t1 (a INT) ENGINE = MyISAM;
SELECT 1 FROM t1 WHERE a <> 'a' OR a <> "";
1
DROP TABLE t1;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE `giant_table` (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`one_id` int(11) NOT NULL,
+`other_id` bigint(20) NOT NULL DEFAULT '0',
+`some_other_id` int(11) DEFAULT 0 NOT NULL,
+`something` double NOT NULL DEFAULT '0',
+`comment` text COLLATE utf8_unicode_ci,
+`flags` int(11) NOT NULL DEFAULT '0',
+`time_created` int(11) NOT NULL DEFAULT '0',
+PRIMARY KEY (`id`),
+KEY `time_created` (`time_created`),
+KEY `some_other_id` (`some_other_id`),
+KEY `one_other_idx` (`one_id`,`other_id`),
+KEY `other_id` (`other_id`,`time_created`)
+) ENGINE=InnoDB AUTO_INCREMENT=101651329
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
+CREATE TABLE t1 (c1 INT);
+INSERT INTO t1 VALUES (66136540), (68983250), (89627210), (77869520),
+(82543190), (67538270), (77282760), (77908170),
+(70923370), (68066360);
+CREATE PROCEDURE p()
+BEGIN
+SET @x = 1;
+REPEAT
+INSERT INTO giant_table(id,one_id)
+SELECT c1 + @x, 0
+FROM t1
+WHERE c1 IN (66136540, 68985250, 89627210, 77869520 , 82543190, 67538270,
+77282760, 77908170, 70923370, 68066360);
+SET @x = @x + 1;
+UNTIL @x > 30 END REPEAT;
+END $
+CALL p();
+SELECT count(*) FROM giant_table;
+count(*)
+270
+INSERT INTO giant_table (id,one_id) VALUES (66136539, 0), (68983258,1),
+(89628210,1), (77869520,2);
+INSERT INTO giant_table (id,one_id, some_other_id) VALUES(84673401, 0, 1),
+(61069031, 1, 1);
+EXPLAIN SELECT id, something, comment, time_created, one_id, other_id,
+some_other_id, flags
+FROM giant_table
+WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272,
+84673401, 61069031, 68214385, 77282865, 76991297, 64569216,
+89481638, 74534074, 70396537, 80076375, 63308530, 77908270,
+70923271, 68066180)
+AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE giant_table range PRIMARY,some_other_id some_other_id 8 NULL 20 Using index condition; Using where; Using MRR
+DROP PROCEDURE p;
+DROP TABLE giant_table, t1;
set optimizer_switch=default;
SELECT 1 FROM t1 WHERE a <> 'a' OR a <> "";
1
DROP TABLE t1;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE `giant_table` (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`one_id` int(11) NOT NULL,
+`other_id` bigint(20) NOT NULL DEFAULT '0',
+`some_other_id` int(11) DEFAULT 0 NOT NULL,
+`something` double NOT NULL DEFAULT '0',
+`comment` text COLLATE utf8_unicode_ci,
+`flags` int(11) NOT NULL DEFAULT '0',
+`time_created` int(11) NOT NULL DEFAULT '0',
+PRIMARY KEY (`id`),
+KEY `time_created` (`time_created`),
+KEY `some_other_id` (`some_other_id`),
+KEY `one_other_idx` (`one_id`,`other_id`),
+KEY `other_id` (`other_id`,`time_created`)
+) ENGINE=InnoDB AUTO_INCREMENT=101651329
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
+CREATE TABLE t1 (c1 INT);
+INSERT INTO t1 VALUES (66136540), (68983250), (89627210), (77869520),
+(82543190), (67538270), (77282760), (77908170),
+(70923370), (68066360);
+CREATE PROCEDURE p()
+BEGIN
+SET @x = 1;
+REPEAT
+INSERT INTO giant_table(id,one_id)
+SELECT c1 + @x, 0
+FROM t1
+WHERE c1 IN (66136540, 68985250, 89627210, 77869520 , 82543190, 67538270,
+77282760, 77908170, 70923370, 68066360);
+SET @x = @x + 1;
+UNTIL @x > 30 END REPEAT;
+END $
+CALL p();
+SELECT count(*) FROM giant_table;
+count(*)
+270
+INSERT INTO giant_table (id,one_id) VALUES (66136539, 0), (68983258,1),
+(89628210,1), (77869520,2);
+INSERT INTO giant_table (id,one_id, some_other_id) VALUES(84673401, 0, 1),
+(61069031, 1, 1);
+EXPLAIN SELECT id, something, comment, time_created, one_id, other_id,
+some_other_id, flags
+FROM giant_table
+WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272,
+84673401, 61069031, 68214385, 77282865, 76991297, 64569216,
+89481638, 74534074, 70396537, 80076375, 63308530, 77908270,
+70923271, 68066180)
+AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE giant_table range PRIMARY,some_other_id some_other_id 8 NULL 20 Using index condition; Using where
+DROP PROCEDURE p;
+DROP TABLE giant_table, t1;
set optimizer_switch=default;
SELECT 1 FROM t1 WHERE a <> 'a' OR a <> "";
1
DROP TABLE t1;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE `giant_table` (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`one_id` int(11) NOT NULL,
+`other_id` bigint(20) NOT NULL DEFAULT '0',
+`some_other_id` int(11) DEFAULT 0 NOT NULL,
+`something` double NOT NULL DEFAULT '0',
+`comment` text COLLATE utf8_unicode_ci,
+`flags` int(11) NOT NULL DEFAULT '0',
+`time_created` int(11) NOT NULL DEFAULT '0',
+PRIMARY KEY (`id`),
+KEY `time_created` (`time_created`),
+KEY `some_other_id` (`some_other_id`),
+KEY `one_other_idx` (`one_id`,`other_id`),
+KEY `other_id` (`other_id`,`time_created`)
+) ENGINE=InnoDB AUTO_INCREMENT=101651329
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
+CREATE TABLE t1 (c1 INT);
+INSERT INTO t1 VALUES (66136540), (68983250), (89627210), (77869520),
+(82543190), (67538270), (77282760), (77908170),
+(70923370), (68066360);
+CREATE PROCEDURE p()
+BEGIN
+SET @x = 1;
+REPEAT
+INSERT INTO giant_table(id,one_id)
+SELECT c1 + @x, 0
+FROM t1
+WHERE c1 IN (66136540, 68985250, 89627210, 77869520 , 82543190, 67538270,
+77282760, 77908170, 70923370, 68066360);
+SET @x = @x + 1;
+UNTIL @x > 30 END REPEAT;
+END $
+CALL p();
+SELECT count(*) FROM giant_table;
+count(*)
+270
+INSERT INTO giant_table (id,one_id) VALUES (66136539, 0), (68983258,1),
+(89628210,1), (77869520,2);
+INSERT INTO giant_table (id,one_id, some_other_id) VALUES(84673401, 0, 1),
+(61069031, 1, 1);
+EXPLAIN SELECT id, something, comment, time_created, one_id, other_id,
+some_other_id, flags
+FROM giant_table
+WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272,
+84673401, 61069031, 68214385, 77282865, 76991297, 64569216,
+89481638, 74534074, 70396537, 80076375, 63308530, 77908270,
+70923271, 68066180)
+AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE giant_table range PRIMARY,some_other_id some_other_id 8 NULL 20 Using index condition; Using where; Using MRR
+DROP PROCEDURE p;
+DROP TABLE giant_table, t1;
set optimizer_switch=default;
SELECT 1 FROM t1 WHERE a <> 'a' OR a <> "";
1
DROP TABLE t1;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE `giant_table` (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`one_id` int(11) NOT NULL,
+`other_id` bigint(20) NOT NULL DEFAULT '0',
+`some_other_id` int(11) DEFAULT 0 NOT NULL,
+`something` double NOT NULL DEFAULT '0',
+`comment` text COLLATE utf8_unicode_ci,
+`flags` int(11) NOT NULL DEFAULT '0',
+`time_created` int(11) NOT NULL DEFAULT '0',
+PRIMARY KEY (`id`),
+KEY `time_created` (`time_created`),
+KEY `some_other_id` (`some_other_id`),
+KEY `one_other_idx` (`one_id`,`other_id`),
+KEY `other_id` (`other_id`,`time_created`)
+) ENGINE=InnoDB AUTO_INCREMENT=101651329
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
+CREATE TABLE t1 (c1 INT);
+INSERT INTO t1 VALUES (66136540), (68983250), (89627210), (77869520),
+(82543190), (67538270), (77282760), (77908170),
+(70923370), (68066360);
+CREATE PROCEDURE p()
+BEGIN
+SET @x = 1;
+REPEAT
+INSERT INTO giant_table(id,one_id)
+SELECT c1 + @x, 0
+FROM t1
+WHERE c1 IN (66136540, 68985250, 89627210, 77869520 , 82543190, 67538270,
+77282760, 77908170, 70923370, 68066360);
+SET @x = @x + 1;
+UNTIL @x > 30 END REPEAT;
+END $
+CALL p();
+SELECT count(*) FROM giant_table;
+count(*)
+270
+INSERT INTO giant_table (id,one_id) VALUES (66136539, 0), (68983258,1),
+(89628210,1), (77869520,2);
+INSERT INTO giant_table (id,one_id, some_other_id) VALUES(84673401, 0, 1),
+(61069031, 1, 1);
+EXPLAIN SELECT id, something, comment, time_created, one_id, other_id,
+some_other_id, flags
+FROM giant_table
+WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272,
+84673401, 61069031, 68214385, 77282865, 76991297, 64569216,
+89481638, 74534074, 70396537, 80076375, 63308530, 77908270,
+70923271, 68066180)
+AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE giant_table range PRIMARY,some_other_id some_other_id 8 NULL 20 Using where; Using MRR
+DROP PROCEDURE p;
+DROP TABLE giant_table, t1;
set optimizer_switch=default;
SELECT 1 FROM t1 WHERE a <> 'a' OR a <> "";
1
DROP TABLE t1;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE `giant_table` (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`one_id` int(11) NOT NULL,
+`other_id` bigint(20) NOT NULL DEFAULT '0',
+`some_other_id` int(11) DEFAULT 0 NOT NULL,
+`something` double NOT NULL DEFAULT '0',
+`comment` text COLLATE utf8_unicode_ci,
+`flags` int(11) NOT NULL DEFAULT '0',
+`time_created` int(11) NOT NULL DEFAULT '0',
+PRIMARY KEY (`id`),
+KEY `time_created` (`time_created`),
+KEY `some_other_id` (`some_other_id`),
+KEY `one_other_idx` (`one_id`,`other_id`),
+KEY `other_id` (`other_id`,`time_created`)
+) ENGINE=InnoDB AUTO_INCREMENT=101651329
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
+CREATE TABLE t1 (c1 INT);
+INSERT INTO t1 VALUES (66136540), (68983250), (89627210), (77869520),
+(82543190), (67538270), (77282760), (77908170),
+(70923370), (68066360);
+CREATE PROCEDURE p()
+BEGIN
+SET @x = 1;
+REPEAT
+INSERT INTO giant_table(id,one_id)
+SELECT c1 + @x, 0
+FROM t1
+WHERE c1 IN (66136540, 68985250, 89627210, 77869520 , 82543190, 67538270,
+77282760, 77908170, 70923370, 68066360);
+SET @x = @x + 1;
+UNTIL @x > 30 END REPEAT;
+END $
+CALL p();
+SELECT count(*) FROM giant_table;
+count(*)
+270
+INSERT INTO giant_table (id,one_id) VALUES (66136539, 0), (68983258,1),
+(89628210,1), (77869520,2);
+INSERT INTO giant_table (id,one_id, some_other_id) VALUES(84673401, 0, 1),
+(61069031, 1, 1);
+EXPLAIN SELECT id, something, comment, time_created, one_id, other_id,
+some_other_id, flags
+FROM giant_table
+WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272,
+84673401, 61069031, 68214385, 77282865, 76991297, 64569216,
+89481638, 74534074, 70396537, 80076375, 63308530, 77908270,
+70923271, 68066180)
+AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE giant_table range PRIMARY,some_other_id some_other_id 8 NULL 20 Using where
+DROP PROCEDURE p;
+DROP TABLE giant_table, t1;
set optimizer_switch=default;
SELECT 1 FROM t1 WHERE a <> 'a' OR a <> "";
1
DROP TABLE t1;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE `giant_table` (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`one_id` int(11) NOT NULL,
+`other_id` bigint(20) NOT NULL DEFAULT '0',
+`some_other_id` int(11) DEFAULT 0 NOT NULL,
+`something` double NOT NULL DEFAULT '0',
+`comment` text COLLATE utf8_unicode_ci,
+`flags` int(11) NOT NULL DEFAULT '0',
+`time_created` int(11) NOT NULL DEFAULT '0',
+PRIMARY KEY (`id`),
+KEY `time_created` (`time_created`),
+KEY `some_other_id` (`some_other_id`),
+KEY `one_other_idx` (`one_id`,`other_id`),
+KEY `other_id` (`other_id`,`time_created`)
+) ENGINE=InnoDB AUTO_INCREMENT=101651329
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
+CREATE TABLE t1 (c1 INT);
+INSERT INTO t1 VALUES (66136540), (68983250), (89627210), (77869520),
+(82543190), (67538270), (77282760), (77908170),
+(70923370), (68066360);
+CREATE PROCEDURE p()
+BEGIN
+SET @x = 1;
+REPEAT
+INSERT INTO giant_table(id,one_id)
+SELECT c1 + @x, 0
+FROM t1
+WHERE c1 IN (66136540, 68985250, 89627210, 77869520 , 82543190, 67538270,
+77282760, 77908170, 70923370, 68066360);
+SET @x = @x + 1;
+UNTIL @x > 30 END REPEAT;
+END $
+CALL p();
+SELECT count(*) FROM giant_table;
+count(*)
+270
+INSERT INTO giant_table (id,one_id) VALUES (66136539, 0), (68983258,1),
+(89628210,1), (77869520,2);
+INSERT INTO giant_table (id,one_id, some_other_id) VALUES(84673401, 0, 1),
+(61069031, 1, 1);
+EXPLAIN SELECT id, something, comment, time_created, one_id, other_id,
+some_other_id, flags
+FROM giant_table
+WHERE id IN (66136539, 68983258, 89628210, 77869520, 82543198, 67538272,
+84673401, 61069031, 68214385, 77282865, 76991297, 64569216,
+89481638, 74534074, 70396537, 80076375, 63308530, 77908270,
+70923271, 68066180)
+AND (giant_table.flags & 0x01) = 0 AND giant_table.some_other_id = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE giant_table range PRIMARY,some_other_id some_other_id 8 NULL 20 Using where
+DROP PROCEDURE p;
+DROP TABLE giant_table, t1;
set optimizer_switch=default;
DROP TRIGGER t1_ai;
DROP TABLE t1, t2;
End of 5.0 tests
+#
+# Bug#21142859: FUNCTION UPDATING A VIEW FAILS TO FIND TABLE THAT ACTUALLY EXISTS
+#
+CREATE TABLE t1 SELECT 1 AS fld1, 'A' AS fld2;
+CREATE TABLE t2 (fld3 INT, fld4 CHAR(1));
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TRIGGER t1_au AFTER UPDATE ON t1
+FOR EACH ROW INSERT INTO t2 VALUES (new.fld1, new.fld2);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+UPDATE v1 SET fld2='B' WHERE fld1=1;
+RETURN row_count();
+END !
+# Without the patch, an error was getting reported.
+SELECT f1();
+f1()
+1
+DROP FUNCTION f1;
+DROP VIEW v1;
+DROP TABLE t1,t2;
+#
+# Bug #16672723 "CAN'T FIND TEMPORARY TABLE".
+#
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE TEMPORARY TABLE tmp1(a INT);
+PREPARE stmt1 FROM "CREATE TEMPORARY TABLE tmp2 AS SELECT b FROM (SELECT f1() AS b FROM tmp1) AS t";
+# The below statement failed before the fix.
+EXECUTE stmt1;
+DROP TEMPORARY TABLES tmp1, tmp2;
+DEALLOCATE PREPARE stmt1;
+DROP FUNCTION f1;
--- /dev/null
+#
+# Bug#21920657: SSL-CA FAILS SILENTLY IF THE PATH CANNOT BE FOUND
+#
+# try to connect with wrong '--ssl-ca' path : should fail
+ERROR 2026 (HY000): SSL connection error: SSL_CTX_set_default_verify_paths failed
+# try to connect with correct '--ssl-ca' path : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+#
+# Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
+# PATH SUBSTITUTION
+#
+# try to connect with '--ssl-ca' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+# try to connect with '--ssl-key' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+# try to connect with '--ssl-cert' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
ssl_crlpath
ssl_key MYSQL_TEST_DIR/std_data/crl-server-key.pem
# try logging in with a certificate in the server's --ssl-crl : should fail
+#
+# Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
+# PATH SUBSTITUTION
+#
+# try to connect with '--ssl-crl' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
+# try to connect with '--ssl-crlpath' option using tilde home directoy
+# path substitution : should connect
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Start temporary; End temporary
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Start temporary; End temporary
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1); Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
#
# Bug#51457 Firstmatch semijoin strategy gives wrong results for
# certain query plans
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1); Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
#
# Bug#51457 Firstmatch semijoin strategy gives wrong results for
# certain query plans
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
#
# Bug#51457 Firstmatch semijoin strategy gives wrong results for
# certain query plans
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 FirstMatch(t2); Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1); Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
#
# Bug#51457 Firstmatch semijoin strategy gives wrong results for
# certain query plans
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Start temporary; End temporary
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Start temporary; End temporary
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (Block Nested Loop)
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t1`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t1`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Start temporary; End temporary
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where; Start temporary
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 End temporary; Using join buffer (Block Nested Loop)
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY <subquery2> eq_ref <auto_key> <auto_key> 5 test.t1.a 1 100.00 NULL
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` semi join (`test`.`t` `t2`) where ((`<subquery2>`.`a` = `test`.`t1`.`a`) and (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`a` from `test`.`t` `t2` where (not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on <auto_key> where ((`test`.`t1`.`a` = `materialized-subquery`.`a`)))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select 1 from `test`.`t` `t2` where ((not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select 1 from `test`.`t` `t2` where ((not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select 1 from `test`.`t` `t2` where ((not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
# End of test for Bug#21184091
set @@optimizer_switch=@old_opt_switch;
# End of 5.6 tests
+# Bug#21139722: Assertion failed: !(used_tables() & ((table_map) 1) ...
+CREATE TABLE t1(a INTEGER) engine=innodb;
+CREATE TABLE t2(b INTEGER) engine=innodb;
+explain SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 NULL
+2 DERIVED t2 ALL NULL NULL NULL NULL 1 NULL
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using where
+5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL
+SELECT 1
+FROM (SELECT 1 IN (SELECT 1
+FROM t1
+WHERE (SELECT 1 FROM t2 HAVING b) NOT IN (SELECT 1 FROM t2)
+)
+FROM t2
+) AS z;
+1
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INTEGER) engine=innodb;
+explain SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 NULL
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using where
+SELECT (SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+FROM t1 AS t1;
+(SELECT a
+FROM t1 AS t2
+WHERE a IN (SELECT t1.a+t2.a
+FROM t1 AS t3))
+DROP TABLE t1;
+# End of test for Bug#21139722
+#
+# Bug#21139402 ASSERTION FAILED: LENGTH > 0 && KEYPARTS != 0, CRASH IN JOIN::OPTIMIZE_KEYUSE
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a));
+CREATE TABLE t2 (c INT PRIMARY KEY);
+EXPLAIN SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT 1
+FROM t1
+WHERE 1 IN (SELECT (c IS NULL) IN (SELECT a
+FROM t1
+WHERE b)
+FROM t2);
+1
+DROP TABLE t1,t2;
+#
+# Bug #22305361: QUERY WITH MATERIALIZED TABLE RETURNS INCORRECT
+# RESULTS IN 5.6
+#
+CREATE TABLE t(a INT,b INT);
+INSERT INTO t VALUES (1,0),(1,0),(1,0),(1,0),(1,1);
+EXPLAIN extended SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t` `t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select 1 from `test`.`t` `t2` where ((not(<in_optimizer>(concat(`test`.`t2`.`a`,''),<exists>(/* select#3 */ select 1 from `test`.`t` `t3` where ((`test`.`t3`.`b` = 1) and <if>(outer_field_is_not_null, ((<cache>(concat(`test`.`t2`.`a`,'')) = `test`.`t3`.`a`) or isnull(`test`.`t3`.`a`)), true)) having <if>(outer_field_is_not_null, <is_not_null_test>(`test`.`t3`.`a`), true))))) and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))))
+SELECT *
+FROM t AS t1
+WHERE t1.a IN (SELECT t2.a
+FROM t AS t2
+WHERE CONCAT(t2.a,'') NOT IN (SELECT t3.a
+FROM t AS t3
+WHERE t3.b=1));
+a b
+DROP TABLE t;
set optimizer_switch=default;
set optimizer_switch=default;
--- /dev/null
+#
+# Bug #20085672: CRYPTIC ERROR WHEN FAILING TO UNLOAD A DYNAMIC LIBRARY
+#
+# Install the plugin
+INSTALL PLUGIN test_udf_services SONAME 'TESTUDFSERVICES';
+# Define the function
+CREATE FUNCTION test_udf_services_udf RETURNS INT
+SONAME "TESTUDFSERVICES";
+# Uninstall the plugin
+UNINSTALL PLUGIN test_udf_services;
+# Install the plugin again. Should not fail
+INSTALL PLUGIN test_udf_services SONAME 'TESTUDFSERVICES';
+# Cleanup
+DROP FUNCTION test_udf_services_udf;
+UNINSTALL PLUGIN test_udf_services;
# cleanup
DROP USER 'user1'@'localhost', 'user2'@'localhost';
SET @@global.validate_password_policy=DEFAULT;
+#
+# Bug#21616496: CREATE USER ACCEPTS PLUGIN AND PASSWORD HASH,
+# BUT IGNORES THE PASSWORD HASH
+#
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
+ERROR HY000: Your password does not satisfy the current policy requirements
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
+ERROR HY000: Your password does not satisfy the current policy requirements
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*0D3CED9BEC10A777AEC23CCC353A8C08A633045E';
+ERROR HY000: Your password does not satisfy the current policy requirements
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_old_password' AS '*0D3CED9BEC10A777AEC23CCC353A8C08A633045E';
+ERROR HY000: Your password does not satisfy the current policy requirements
# clean up after the test
UNINSTALL PLUGIN validate_password;
End of tests
--- /dev/null
+#
+# Bug #23747899: @@basedir sysvar value not normalized if set through
+# the command line/ini file
+# There should be no slashes in @@basedir and just backslashes
+# since it's normalized
+SELECT
+LOCATE('/', @@basedir) <> 0 AS have_slashes,
+LOCATE('\\', @@basedir) <> 0 AS have_backslashes;
+have_slashes have_backslashes
+0 1
+End of the 5.6 tests
--- /dev/null
+#-----------------------------------------------------------------------
+# Setup
+# Try to restart server with invalid value for --secure-file-priv
+# Search for : Failed to access directory for --secure-file-priv.
+# Search for : No such file or directory
+# Restart completed.
+# Restart
+#-----------------------------------------------------------------------
--- /dev/null
+#-----------------------------------------------------------------------
+# Setup
+#-----------------------------------------------------------------------
+# Search for : --secure-file-priv is set to NULL. Operations
+# related to importing and exporting data are
+# disabled
+show variables like 'secure_file_priv';
+Variable_name Value
+secure_file_priv null
+use test;
+drop table if exists secure_file_priv_test_null;
+create table secure_file_priv_test_null(c1 int);
+insert into secure_file_priv_test_null values (1), (2), (3), (4);
+select * from secure_file_priv_test_null into outfile 'blah';
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+select * from secure_file_priv_test_null into outfile 'null/blah';
+ERROR HY000: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
+drop table secure_file_priv_test_null;
+#-----------------------------------------------------------------------
+# Clean-up
+#-----------------------------------------------------------------------
--- /dev/null
+#-----------------------------------------------------------------------
+# Setup
+#-----------------------------------------------------------------------
+# Search for : Insecure configuration for --secure-file-priv: Current
+# value does not restrict location of generated files.
+# Consider setting it to a valid, non-empty path.
+SHOW VARIABLES LIKE 'secure_file_priv';
+Variable_name Value
+secure_file_priv
+#-----------------------------------------------------------------------
+# Restart completed.
+# Search for : Insecure configuration for --secure-file-priv: Plugin
+# directory is accessible through --secure-file-priv.
+# Consider choosing a different directory.
+#-----------------------------------------------------------------------
+# Clean-up
+#-----------------------------------------------------------------------
--- /dev/null
+#-----------------------------------------------------------------------
+# Search for : Insecure configuration for --secure-file-priv: Data
+# directory is accessible through --secure-file-priv.
+# Consider choosing a different directory.
+#-----------------------------------------------------------------------
+# Search for : Insecure configuration for --secure-file-priv: Location
+# is accessible to all OS users. Consider choosing a
+# different directory.
+#-----------------------------------------------------------------------
--- /dev/null
+#-----------------------------------------------------------------------
+# Test 2 : Restarting mysqld with :
+# --secure-file-priv=MYSQLTEST_VARDIR/mysqld.1/Data
+# Restart completed.
+# Search for : Insecure configuration for --secure-file-priv: Data
+# directory is accessible through --secure-file-priv.
+# Consider choosing a different directory.
+#-----------------------------------------------------------------------
--- /dev/null
+--source include/no_valgrind_without_big.inc
+--source include/not_embedded.inc
+
+--echo #-----------------------------------------------------------------------
+--echo # Setup
+let restart_log= $MYSQLTEST_VARDIR/log/my_restart.err;
+let SEARCH_FILE= $restart_log;
+let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+
+--echo # Try to restart server with invalid value for --secure-file-priv
+--exec echo "wait" > $restart_file
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--error 0,1
+--remove_file $restart_log
+# Following should fail
+--error 1
+--exec $MYSQLD_CMD --secure-file-priv=blahblahblah --loose-console > $restart_log 2>&1
+
+--echo # Search for : Failed to access directory for --secure-file-priv.
+let SEARCH_PATTERN= Failed to access directory for --secure-file-priv;
+--source include/search_pattern_in_file.inc
+
+--echo # Search for : No such file or directory
+let SEARCH_PATTERN= No such file or directory;
+--source include/search_pattern_in_file.inc
+
+--remove_file $restart_log
+
+--source include/wait_until_disconnected.inc
+# Dummy argument for restart
+--exec echo "restart: --ssl" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+--echo # Restart completed.
+
+--echo # Restart
+--disable_warnings
+--source include/force_restart.inc
+--enable_warnings
+--echo #-----------------------------------------------------------------------
--- /dev/null
+--source include/no_valgrind_without_big.inc
+--source include/not_embedded.inc
+
+--echo #-----------------------------------------------------------------------
+--echo # Setup
+let server_log= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_FILE= $server_log;
+let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+let $secure_file_priv_arg= \"null\";
+--echo #-----------------------------------------------------------------------
+
+--exec echo "wait" > $restart_file
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--remove_file $server_log
+--exec echo "restart:--secure-file-priv=$secure_file_priv_arg" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+--echo # Search for : --secure-file-priv is set to NULL. Operations
+--echo # related to importing and exporting data are
+--echo # disabled
+let SEARCH_PATTERN= --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled;
+--source include/search_pattern_in_file.inc
+
+connect(test4_con,localhost,root,,,,,);
+show variables like 'secure_file_priv';
+
+use test;
+--disable_warnings
+drop table if exists secure_file_priv_test_null;
+--enable_warnings
+create table secure_file_priv_test_null(c1 int);
+insert into secure_file_priv_test_null values (1), (2), (3), (4);
+--error 1290
+select * from secure_file_priv_test_null into outfile 'blah';
+--error 1290
+select * from secure_file_priv_test_null into outfile 'null/blah';
+drop table secure_file_priv_test_null;
+
+connection default;
+disconnect test4_con;
+
+--echo #-----------------------------------------------------------------------
+
+--echo # Clean-up
+--disable_warnings
+--source include/force_restart.inc
+--enable_warnings
+
+--echo #-----------------------------------------------------------------------
--- /dev/null
+--source include/no_valgrind_without_big.inc
+--source include/not_embedded.inc
+
+--echo #-----------------------------------------------------------------------
+--echo # Setup
+let server_log= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_FILE= $server_log;
+let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+let PLUGIN_DIR= $MYSQLTEST_VARDIR/tmp;
+let $secure_file_priv_arg=;
+--echo #-----------------------------------------------------------------------
+
+--exec echo "wait" > $restart_file
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--remove_file $server_log
+--exec echo "restart:--secure-file-priv=$secure_file_priv_arg" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+--echo # Search for : Insecure configuration for --secure-file-priv: Current
+--echo # value does not restrict location of generated files.
+--echo # Consider setting it to a valid, non-empty path.
+let SEARCH_PATTERN= Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.;
+--source include/search_pattern_in_file.inc
+
+# Must show empty string
+SHOW VARIABLES LIKE 'secure_file_priv';
+
+--echo #-----------------------------------------------------------------------
+
+let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+--exec echo "wait" > $restart_file
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--remove_file $server_log
+--exec echo "restart:--plugin-dir=$PLUGIN_DIR --secure-file-priv=$PLUGIN_DIR" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+--echo # Restart completed.
+
+--echo # Search for : Insecure configuration for --secure-file-priv: Plugin
+--echo # directory is accessible through --secure-file-priv.
+--echo # Consider choosing a different directory.
+let SEARCH_PATTERN= Insecure configuration for --secure-file-priv: Plugin directory is accessible through --secure-file-priv. Consider choosing a different directory.;
+--source include/search_pattern_in_file.inc
+
+--echo #-----------------------------------------------------------------------
+
+--echo # Clean-up
+--disable_warnings
+--source include/force_restart.inc
+--enable_warnings
+
+--echo #-----------------------------------------------------------------------
--- /dev/null
+--source include/no_valgrind_without_big.inc
+--source include/not_windows.inc
+--source include/not_embedded.inc
+
+let server_log= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_FILE= $server_log;
+
+--echo #-----------------------------------------------------------------------
+
+--echo # Search for : Insecure configuration for --secure-file-priv: Data
+--echo # directory is accessible through --secure-file-priv.
+--echo # Consider choosing a different directory.
+let SEARCH_PATTERN= Insecure configuration for --secure-file-priv: Data directory is accessible through --secure-file-priv. Consider choosing a different directory.;
+--source include/search_pattern_in_file.inc
+
+--echo #-----------------------------------------------------------------------
+
+--echo # Search for : Insecure configuration for --secure-file-priv: Location
+--echo # is accessible to all OS users. Consider choosing a
+--echo # different directory.
+let SEARCH_PATTERN= Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.;
+--source include/search_pattern_in_file.inc
+
+--echo #-----------------------------------------------------------------------
--- /dev/null
+--source include/no_valgrind_without_big.inc
+--source include/windows.inc
+--source include/not_embedded.inc
+
+let server_log= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_FILE= $server_log;
+
+--echo #-----------------------------------------------------------------------
+
+--echo # Test 2 : Restarting mysqld with :
+--echo # --secure-file-priv=MYSQLTEST_VARDIR/mysqld.1/Data
+
+let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+--exec echo "wait" > $restart_file
+--shutdown_server
+--source include/wait_until_disconnected.inc
+--error 0,1
+--remove_file $server_log
+--exec echo "restart: --secure-file-priv=$MYSQLTEST_VARDIR/mysqld.1/Data" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+--echo # Restart completed.
+
+--echo # Search for : Insecure configuration for --secure-file-priv: Data
+--echo # directory is accessible through --secure-file-priv.
+--echo # Consider choosing a different directory.
+let SEARCH_PATTERN= Insecure configuration for --secure-file-priv: Data directory is accessible through --secure-file-priv. Consider choosing a different directory.;
+--source include/search_pattern_in_file.inc
+
+--disable_warnings
+--source include/force_restart.inc
+--enable_warnings
+
+--echo #-----------------------------------------------------------------------
--- /dev/null
+DROP TABLE IF EXISTS t1 ;
+# READ_ONLY does nothing to SUPER users
+# so we use a non-SUPER one:
+GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
+connect con1,localhost,test,,test;
+connection default;
+SET GLOBAL READ_ONLY=1;
+connection con1;
+CREATE TEMPORARY TABLE t1 (a INT) ENGINE=INNODB;
+# Test INSERTS with autocommit being off and on.
+BEGIN;
+INSERT INTO t1 VALUES (10);
+COMMIT;
+INSERT INTO t1 VALUES (20);
+# Test UPDATES with autocommit being off and on.
+BEGIN;
+UPDATE t1 SET a=30 WHERE a=10;
+COMMIT;
+UPDATE t1 SET a=40 WHERE a=20;
+connection default;
+SET GLOBAL READ_ONLY=0;
+# Test scenario where global read_only is enabled in the middle of transaction.
+# Test INSERT operations on temporary tables, INSERTs should be successful even
+# when global read_only is enabled.
+connection con1;
+BEGIN;
+INSERT INTO t1 VALUES(50);
+connection default;
+SET GLOBAL READ_ONLY=1;
+connection con1;
+SELECT @@GLOBAL.READ_ONLY;
+@@GLOBAL.READ_ONLY
+1
+COMMIT;
+connection default;
+SET GLOBAL READ_ONLY=0;
+# Test UPDATE operations on temporary tables, UPDATEs should be successful even
+# when global read_only is enabled.
+connection con1;
+BEGIN;
+UPDATE t1 SET a=60 WHERE a=50;
+connection default;
+SET GLOBAL READ_ONLY=1;
+connection con1;
+SELECT @@GLOBAL.READ_ONLY;
+@@GLOBAL.READ_ONLY
+1
+COMMIT;
+SELECT * FROM t1;
+a
+30
+40
+60
+# Clean up
+connection default;
+SET GLOBAL READ_ONLY=0;
+disconnect con1;
+DROP USER test@localhost;
master-bin.000018 #
master-bin.000019 #
master-bin.000020 #
+# Test case11: Bug #20381055SERVER CRASHES IF INDEX FILE IS OPENED BY
+SET SESSION debug="d,force_index_file_delete_failure";
+call mtr.add_suppression("Failed to delete the existing index file");
+call mtr.add_suppression("failed to move crash safe index file to index file");
+call mtr.add_suppression("failed to update the index file");
+PURGE BINARY LOGS TO 'master-bin.000014';;
+ERROR HY000: I/O error reading log index file
+# Test the index file is complete, although is not purged successfully.
+# Also this will indicate that binary logging is not disabled.
+show binary logs;
+Log_name File_size
+master-bin.000012 #
+master-bin.000013 #
+master-bin.000014 #
+master-bin.000015 #
+master-bin.000016 #
+master-bin.000017 #
+master-bin.000018 #
+master-bin.000019 #
+master-bin.000020 #
+SET GLOBAL binlog_error_action='IGNORE_ERROR';
+FLUSH LOGS;
+ERROR HY000: Can't open file: 'master-bin.000021' (errno: 1 - Operation not permitted)
+SHOW BINARY LOGS;
+ERROR HY000: You are not using binary logging
+show binary logs;
+Log_name File_size
+master-bin.000012 #
+master-bin.000013 #
+master-bin.000014 #
+master-bin.000015 #
+master-bin.000016 #
+master-bin.000017 #
+master-bin.000018 #
+master-bin.000019 #
+master-bin.000020 #
+master-bin.000021 #
+CREATE TABLE t1(i INT);
+SET GLOBAL binlog_error_action='IGNORE_ERROR';
+SET SESSION debug="+d,force_index_file_delete_failure";
+SET SESSION debug="+d,force_rotate";
+INSERT INTO t1 VALUES (12);
+ERROR HY000: Can't open file: 'master-bin.000022' (errno: 1 - Operation not permitted)
+SHOW BINARY LOGS;
+ERROR HY000: You are not using binary logging
+show binary logs;
+Log_name File_size
+master-bin.000012 #
+master-bin.000013 #
+master-bin.000014 #
+master-bin.000015 #
+master-bin.000016 #
+master-bin.000017 #
+master-bin.000018 #
+master-bin.000019 #
+master-bin.000020 #
+master-bin.000021 #
+master-bin.000022 #
+DROP TABLE t1;
+# Test case11: Ends
SET SESSION debug="";
End of tests
*** a proof the query is binlogged with an error ***
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
select 0 /* must return 0 to mean the killed update is in */;
0
master-bin.000001 # Query # # COMMIT
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
select 0 /* must return 0 to mean the killed delete is in */;
0
update t1 set a=2 /* will be "killed" after work has been done */;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
select 1 /* must return 1 as query completed before got killed*/;
1
master-bin.000001 # Query # # COMMIT
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
select 0 /* must return 0 to mean the killed query is in */;
0
Check Result
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
-is not null
+is not null AS Loaded;
+Loaded
1
*** String sql_mode=0 is found: 0 ***
Clean Up
flush logs;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
-is not null;
-(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
-is not null
+is not null AS Loaded;
+Loaded
1
select
@a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR
--- /dev/null
+# ==== Purpose ====
+#
+# Check that DMLs are allowed on temporary tables, when server is in read only
+# mode and binary log is enabled with binlog-format being stmt/mixed mode.
+#
+# ==== Implementation ====
+#
+# Start the server with binary log being enabled. Mark the server as read only.
+# Create a non-SUPER user and let the user to create a temporary table and
+# perform DML operations on that temporary table. DMLs should not be blocked
+# with a 'server read-only mode' error.
+#
+# ==== References ====
+#
+# Bug#12818255: READ-ONLY OPTION DOES NOT ALLOW INSERTS/UPDATES ON TEMPORARY
+# TABLES
+# Bug#14294223: CHANGES NOT ALLOWED TO TEMPORARY TABLES ON READ-ONLY SERVERS
+###############################################################################
+--source include/have_log_bin.inc
+--disable_warnings
+DROP TABLE IF EXISTS t1 ;
+--enable_warnings
+
+--enable_connect_log
+--echo # READ_ONLY does nothing to SUPER users
+--echo # so we use a non-SUPER one:
+GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
+
+connect (con1,localhost,test,,test);
+
+connection default;
+SET GLOBAL READ_ONLY=1;
+
+connection con1;
+CREATE TEMPORARY TABLE t1 (a INT) ENGINE=INNODB;
+
+--echo # Test INSERTS with autocommit being off and on.
+BEGIN;
+INSERT INTO t1 VALUES (10);
+COMMIT;
+INSERT INTO t1 VALUES (20);
+
+--echo # Test UPDATES with autocommit being off and on.
+BEGIN;
+UPDATE t1 SET a=30 WHERE a=10;
+COMMIT;
+UPDATE t1 SET a=40 WHERE a=20;
+
+connection default;
+SET GLOBAL READ_ONLY=0;
+
+--echo # Test scenario where global read_only is enabled in the middle of transaction.
+--echo # Test INSERT operations on temporary tables, INSERTs should be successful even
+--echo # when global read_only is enabled.
+connection con1;
+BEGIN;
+INSERT INTO t1 VALUES(50);
+
+connection default;
+SET GLOBAL READ_ONLY=1;
+
+connection con1;
+SELECT @@GLOBAL.READ_ONLY;
+COMMIT;
+
+connection default;
+SET GLOBAL READ_ONLY=0;
+
+--echo # Test UPDATE operations on temporary tables, UPDATEs should be successful even
+--echo # when global read_only is enabled.
+connection con1;
+BEGIN;
+UPDATE t1 SET a=60 WHERE a=50;
+
+connection default;
+SET GLOBAL READ_ONLY=1;
+
+connection con1;
+SELECT @@GLOBAL.READ_ONLY;
+COMMIT;
+
+SELECT * FROM t1;
+
+--echo # Clean up
+connection default;
+SET GLOBAL READ_ONLY=0;
+
+disconnect con1;
+DROP USER test@localhost;
+--disable_connect_log
file_exists $MYSQLD_DATADIR/master-bin.000013;
file_exists $MYSQLD_DATADIR/master-bin.000014;
-eval SET SESSION debug="$old";
+-- echo # Test case11: Bug #20381055SERVER CRASHES IF INDEX FILE IS OPENED BY
+ # OTHER APPLICATION AND PURGE IS ISSUED.
+ # This test case test the server behaviour if index file cannot be
+ # deleted.
+SET SESSION debug="d,force_index_file_delete_failure";
+
+# Add supressions
+call mtr.add_suppression("Failed to delete the existing index file");
+call mtr.add_suppression("failed to move crash safe index file to index file");
+call mtr.add_suppression("failed to update the index file");
+
+# When index file cannot be recreated during purge binary logs command,
+# it should throw error but it should not disable binary logging.
+-- error ER_IO_ERR_LOG_INDEX_READ
+-- eval PURGE BINARY LOGS TO 'master-bin.000014';
+
+-- echo # Test the index file is complete, although is not purged successfully.
+-- echo # Also this will indicate that binary logging is not disabled.
+-- source include/show_binary_logs.inc
+file_exists $MYSQLD_DATADIR/master-bin.000012;
+file_exists $MYSQLD_DATADIR/master-bin.000013;
+file_exists $MYSQLD_DATADIR/master-bin.000014;
+
+# When index file cannot be recreated during FLUSH LOGS command,
+# it should throw error and binary logging should be disabled.
+SET GLOBAL binlog_error_action='IGNORE_ERROR';
+# normalize strerror message for solaris10-sparc-64bit as long as errno is OK
+--replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/
+--error ER_CANT_OPEN_FILE
+FLUSH LOGS;
+--error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+--source include/restart_mysqld.inc
+-- source include/show_binary_logs.inc
+CREATE TABLE t1(i INT);
+SET GLOBAL binlog_error_action='IGNORE_ERROR';
+SET SESSION debug="+d,force_index_file_delete_failure";
+SET SESSION debug="+d,force_rotate";
+
+# When index file cannot be recreated during DML command which
+# is trying to rotate the binary log, it should throw error and
+# binary logging should be disabled.
+# normalize strerror message for solaris10-sparc-64bit as long as errno is OK
+--replace_regex /\.[\\\/]master/master/ /errno: 1 - .*\)/errno: 1 - Operation not permitted)/
+--error ER_CANT_OPEN_FILE
+INSERT INTO t1 VALUES (12);
+
+--error ER_NO_BINARY_LOGGING
+SHOW BINARY LOGS;
+
+--source include/restart_mysqld.inc
+-- source include/show_binary_logs.inc
+DROP TABLE t1;
+-- echo # Test case11: Ends
+
+eval SET SESSION debug="$old";
--echo End of tests
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
+is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
eval select $error_code /* must return 0 to mean the killed update is in */;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
+is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
eval select $error_code /* must return 0 to mean the killed delete is in */;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
+is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
let $error_code= `select @a like "%#%error_code=0%" /* must return 1 */`;
eval select $error_code /* must return 1 as query completed before got killed*/;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
-is not null;
+is not null AS Loaded;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
eval select $error_code /* must return 0 to mean the killed query is in */;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
-is not null;
+is not null AS Loaded;
let $s_mode_unsigned= `select @a like "%@@session.sql_mode=0%" /* must return 0 */`;
echo *** String sql_mode=0 is found: $s_mode_unsigned ***;
--- /dev/null
+# Following variables should be set:
+# $USER Name of the user
+# $PASSWORD Password to be supplied
+# $SUCCESS Whether a successful connection is expected or not
+# $DELAY_STATS Expected value of Connection_control_delay_generated
+# $USE_AUTH_PLUGIN Whether an authentication plugin is to be used or not
+# $CLIENT_AUTH_PLUGIN Authentication plugin
+
+connection default;
+disable_query_log;
+disable_result_log;
+
+if ($SUCCESS == 0)
+{
+ --echo # Connection attempt should fail.
+ if ($USE_AUTH_PLUGIN == 0)
+ {
+ --error 1
+ --exec $MYSQL -u$USER -p$PASSWORD -e "SELECT 1;" 2>&1
+ }
+ if ($USE_AUTH_PLUGIN == 1)
+ {
+ --error 1
+ --exec $MYSQL -u$USER $CLIENT_AUTH_PLUGIN -p$PASSWORD -e "SELECT 1;" 2>&1
+ }
+}
+
+if ($SUCCESS != 0)
+{
+ --echo # Connection attempt should succeed.
+ if ($USE_AUTH_PLUGIN == 0)
+ {
+ --exec $MYSQL -u$USER -p$PASSWORD -e "SELECT 1;" 2>&1
+ }
+ if ($USE_AUTH_PLUGIN == 1)
+ {
+ --exec $MYSQL -u$USER $CLIENT_AUTH_PLUGIN -p$PASSWORD -e "SELECT 1;" 2>&1
+ }
+}
+
+enable_result_log;
+--echo Connection_control_delay_generated should be $DELAY_STATS
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+enable_query_log;
--- /dev/null
+disable_query_log;
+disable_result_log;
+# Revoke proxy grants
+REVOKE PROXY ON proxied@localhost FROM u1@localhost, u2@localhost, u3@localhost;
+
+# Drop proxy users
+DROP USER u1@localhost, u2@localhost, u3@localhost;
+
+# Drop proxied user
+DROP USER proxied@localhost;
+
+# Uninstall test_plugin_server
+UNINSTALL PLUGIN test_plugin_server;
+
+# Remove plugin library
+let $auth_plugin_path= `SELECT SUBSTR('$PLUGIN_AUTH_OPT/$PLUGIN_AUTH', 14)`;
+let $connection_control_plugin_path= `SELECT SUBSTR('$CONNECTION_CONTROL_PLUGIN_OPT/$PLUGIN_AUTH', 14)`;
+
+if ($auth_plugin_path != $connection_control_plugin_path)
+{
+ --remove_file $connection_control_plugin_path
+}
+enable_result_log;
+enable_query_log;
--- /dev/null
+disable_query_log;
+#
+# Check if server has support for loading plugin
+#
+if (`SELECT @@have_dynamic_loading != 'YES'`) {
+ --skip The connection_control plugin requires dynamic loading
+}
+
+#
+# Check if the variable CONNECTION_CONTROL_PLUGIN is set
+#
+if (!$CONNECTION_CONTROL_PLUGIN) {
+ --skip The connection_control plugin requires the environment variable \$CONNECTION_CONTROL_PLUGIN to be set (normally done by mtr)
+}
+
+#
+# Check if --plugin-dir was setup for null_audit_db
+#
+if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$CONNECTION_CONTROL_PLUGIN_OPT/'`) {
+ --skip The connection_control plugin requires that --plugin-dir is set to the connection_control plugin dir (either the .opt file does not contain \$CONNECTION_CONTROL_PLUGIN_OPT or another plugin is in use)
+}
+enable_query_log;
--- /dev/null
+disable_query_log;
+#
+# Check if server has support for loading plugin
+#
+if (`SELECT @@have_dynamic_loading != 'YES'`) {
+ --skip The connection_control plugin requires dynamic loading
+}
+
+#
+# Check if the variable PLUGIN_AUTH is set
+#
+if (!$PLUGIN_AUTH) {
+ --skip The connection_control plugin requires the environment variable \$PLUGIN_AUTH to be set (normally done by mtr)
+}
+
+enable_query_log;
--- /dev/null
+# Install connection_control plugin
+--replace_result $CONNECTION_CONTROL_PLUGIN CONNECTION_CONTROL_LIB
+eval INSTALL PLUGIN connection_control SONAME '$CONNECTION_CONTROL_PLUGIN';
+--replace_result $CONNECTION_CONTROL_PLUGIN CONNECTION_CONTROL_LIB
+eval INSTALL PLUGIN connection_control_failed_login_attempts SONAME '$CONNECTION_CONTROL_PLUGIN';
--- /dev/null
+# set after marker
+# $SERVER_RESPONSE_TIME [IN] Expected delay
+disable_query_log;
+disable_result_log;
+SET @after= TIMESTAMP(current_time());
+SET @server_response_time= TIMESTAMPDIFF(SECOND, @before, @after);
+enable_result_log;
+
+--eval SELECT @server_response_time >= $SERVER_RESPONSE_TIME
+enable_query_log;
--- /dev/null
+# Set before marker
+disable_query_log;
+disable_result_log;
+SET @before= TIMESTAMP(current_time());
+enable_result_log;
+enable_query_log;
--- /dev/null
+disable_query_log;
+disable_result_log;
+# Copy PLUGIN_AUTH library to CONNECTION_CONTROL_OPT location
+let $auth_plugin_path= `SELECT SUBSTR('$PLUGIN_AUTH_OPT/$PLUGIN_AUTH', 14)`;
+let $connection_control_plugin_path= `SELECT SUBSTR('$CONNECTION_CONTROL_PLUGIN_OPT/$PLUGIN_AUTH', 14)`;
+
+if ($auth_plugin_path != $connection_control_plugin_path)
+{
+ --error 0, 1
+ --remove_file $connection_control_plugin_path
+ --copy_file $auth_plugin_path $connection_control_plugin_path
+}
+# Install test_plugin_server
+eval INSTALL PLUGIN test_plugin_server SONAME '$PLUGIN_AUTH';
+
+# Create proxied@localhost
+CREATE USER proxied@localhost IDENTIFIED BY 'proxied_password';
+
+# Create u1@localhost, u2@localhost, u3@localhst
+CREATE USER u1@localhost IDENTIFIED WITH test_plugin_server AS 'proxied';
+CREATE USER u2@localhost IDENTIFIED WITH test_plugin_server AS 'proxied';
+CREATE USER u3@localhost IDENTIFIED WITH test_plugin_server AS 'proxied';
+
+GRANT PROXY ON proxied@localhost TO u1@localhost, u2@localhost, u3@localhost;
+enable_result_log;
+enable_query_log;
--- /dev/null
+# Uninstall connection_control plugin
+--disable_warnings
+UNINSTALL PLUGIN connection_control;
+--enable_warnings
+UNINSTALL PLUGIN connection_control_failed_login_attempts;
--- /dev/null
+# Connection delay tests for valid user accounts
+
+# ----------------------------------------------------------------------
+
+# Setup
+# Install connection_control plugin
+INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB';
+INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB';
+# Create anonymous user
+CREATE USER ''@'localhost';
+# Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+# Set small values for connection_control variables
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @global.connection_control_max_connection_delay = 1000;
+
+# ----------------------------------------------------------------------
+
+# Following attempts will not experience any delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+
+# Following attempts will experience delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 1
+Variable_name Value
+Connection_control_delay_generated 1
+# Connection attempt should fail.
+Connection_control_delay_generated should be 2
+Variable_name Value
+Connection_control_delay_generated 2
+# Connection attempt should fail.
+Connection_control_delay_generated should be 3
+Variable_name Value
+Connection_control_delay_generated 3
+
+# ----------------------------------------------------------------------
+
+# Cleanup
+# Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+# Drop anonymous user
+DROP USER ''@'localhost';
+# Uninstall connection_control plugin
+UNINSTALL PLUGIN connection_control;
+UNINSTALL PLUGIN connection_control_failed_login_attempts;
+
+# ----------------------------------------------------------------------
--- /dev/null
+# Connection delay tests for valid user accounts
+
+# ----------------------------------------------------------------------
+
+# Setup
+# Install connection_control plugin
+INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB';
+INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB';
+# Create user accounts for testing
+CREATE USER u1@localhost IDENTIFIED BY 'abcd';
+CREATE USER u2@localhost IDENTIFIED BY 'abcd';
+CREATE USER u3@localhost IDENTIFIED BY 'abcd';
+# Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+# Avoid triggering delay
+SET @@global.connection_control_failed_connections_threshold = 100;
+
+# ----------------------------------------------------------------------
+
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: YES)
+connect(localhost,u2,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
+# connection_control_failed_login_attempts should contain entries
+# for u1@localhost and u2@localhost
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 2
+'u2'@'localhost' 1
+connect(localhost,u3,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: NO)
+connect(localhost,u2,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+# connection_control_failed_login_attempts should contain entries
+# for u1@localhost, u2@localhost and u3@localhost
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 2
+'u2'@'localhost' 2
+'u3'@'localhost' 2
+connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: YES)
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+# failed connection counts should have increased for all users
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 3
+'u2'@'localhost' 3
+'u3'@'localhost' 3
+connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: YES)
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: YES)
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: YES)
+# Try various queries
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+WHERE USERHOST = '\'u1\'@\'localhost\'';
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 6
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+WHERE USERHOST LIKE '%u2%';
+USERHOST FAILED_ATTEMPTS
+'u2'@'localhost' 4
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+WHERE FAILED_ATTEMPTS > 4;
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 6
+'u3'@'localhost' 5
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+WHERE FAILED_ATTEMPTS > 5;
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 6
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+WHERE FAILED_ATTEMPTS < 5;
+USERHOST FAILED_ATTEMPTS
+'u2'@'localhost' 4
+# After successful login, corresponding entry should disappear
+# from the view
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+USERHOST FAILED_ATTEMPTS
+'u3'@'localhost' 5
+# A user without privileges should not be able to any information
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+USERHOST FAILED_ATTEMPTS
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
+connect(localhost,u3,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+connect(localhost,u2,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
+# Subsequent failed attempts should put entries back in the view
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 1
+'u2'@'localhost' 1
+'u3'@'localhost' 1
+connect(localhost,u4,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u4'@'localhost' (using password: NO)
+connect(localhost,u5,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u5'@'localhost' (using password: YES)
+connect(localhost,u6,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u6'@'localhost' (using password: YES)
+# Attempts by invalid accounts should be shown in the view
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 1
+'u2'@'localhost' 1
+'u3'@'localhost' 1
+'u4'@'localhost' 1
+'u5'@'localhost' 1
+'u6'@'localhost' 1
+
+# ----------------------------------------------------------------------
+
+# Cleanup
+# Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+# Remove user accounts created for the test
+DROP USER u1@localhost;
+DROP USER u2@localhost;
+DROP USER u3@localhost;
+# Uninstall connection_control plugin
+UNINSTALL PLUGIN connection_control;
+UNINSTALL PLUGIN connection_control_failed_login_attempts;
+
+# ----------------------------------------------------------------------
--- /dev/null
+# Connection delay tests for valid user accounts
+
+# ----------------------------------------------------------------------
+
+# Setup
+# Install connection_control plugin
+INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB';
+INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB';
+# Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+# Set small values for connection_control variables
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @@global.connection_control_max_connection_delay = 1000;
+
+# ----------------------------------------------------------------------
+
+# Following attempts will not experience any delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+# Connection attempt should fail.
+Connection_control_delay_generated should be 0
+Variable_name Value
+Connection_control_delay_generated 0
+
+# Following attempts will experience delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 1
+Variable_name Value
+Connection_control_delay_generated 1
+# Connection attempt should fail.
+Connection_control_delay_generated should be 2
+Variable_name Value
+Connection_control_delay_generated 2
+# Connection attempt should fail.
+Connection_control_delay_generated should be 3
+Variable_name Value
+Connection_control_delay_generated 3
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 4
+'u2'@'localhost' 4
+'u3'@'localhost' 4
+# Connection attempt should fail.
+Connection_control_delay_generated should be 4
+Variable_name Value
+Connection_control_delay_generated 4
+# Connection attempt should fail.
+Connection_control_delay_generated should be 5
+Variable_name Value
+Connection_control_delay_generated 5
+# Connection attempt should fail.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+USERHOST FAILED_ATTEMPTS
+'u1'@'localhost' 5
+'u2'@'localhost' 5
+'u3'@'localhost' 5
+
+# ----------------------------------------------------------------------
+
+# Cleanup
+# Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+# Uninstall connection_control plugin
+UNINSTALL PLUGIN connection_control;
+UNINSTALL PLUGIN connection_control_failed_login_attempts;
+
+# ----------------------------------------------------------------------
--- /dev/null
+# Connection delay tests for valid user accounts
+
+# ----------------------------------------------------------------------
+
+# Setup
+# Install connection_control plugin
+INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB';
+INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB';
+# Create user account for testing
+CREATE USER u1 IDENTIFIED BY 'abcd';
+# Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+SET @saved_min_delay = @@global.connection_control_min_connection_delay;
+# Set small values for connection_control variables
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @@global.connection_control_max_connection_delay = 4000;
+SET @@global.connection_control_min_connection_delay = 2000;
+
+# ----------------------------------------------------------------------
+
+# Make enough failed attempts to trigger delays
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+
+# Following attempts will experience delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 1
+Variable_name Value
+Connection_control_delay_generated 1
+@server_response_time >= 2
+1
+# Connection attempt should fail.
+Connection_control_delay_generated should be 2
+Variable_name Value
+Connection_control_delay_generated 2
+@server_response_time >= 2
+1
+# Connection attempt should fail.
+Connection_control_delay_generated should be 3
+Variable_name Value
+Connection_control_delay_generated 3
+@server_response_time >= 3
+1
+# Connection attempt should fail.
+Connection_control_delay_generated should be 4
+Variable_name Value
+Connection_control_delay_generated 4
+@server_response_time >= 4
+1
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 5
+Variable_name Value
+Connection_control_delay_generated 5
+@server_response_time >= 4
+1
+
+# Following attempts will not experience any delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 5
+Variable_name Value
+Connection_control_delay_generated 5
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 5
+Variable_name Value
+Connection_control_delay_generated 5
+
+# ----------------------------------------------------------------------
+
+# Cleanup
+# Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+SET @@global.connection_control_min_connection_delay = @saved_min_delay;
+# Remove user account created for the test
+DROP USER u1;
+# Uninstall connection_control plugin
+UNINSTALL PLUGIN connection_control;
+UNINSTALL PLUGIN connection_control_failed_login_attempts;
+
+# ----------------------------------------------------------------------
--- /dev/null
+#-----------------------------------------------------------------------
+# Setup
+# Install connection_control plugin
+INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB';
+INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB';
+# Do proxy setup
+CALL mtr.add_suppression("Plugin test_plugin_server reported: 'Wrong password supplied for proxied'");
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+SET @saved_min_delay= @@global.connection_control_min_connection_delay;
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @@global.connection_control_max_connection_delay = 4000;
+SET @@global.connection_control_min_connection_delay = 2000;
+#-----------------------------------------------------------------------
+# Case 1 : Testss for valid user accounts
+# Make enough failed attempts to trigger delays
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u2,efgh,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u3,,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u2,haha,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+# Following attempts will experience delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 1
+Variable_name Value
+Connection_control_delay_generated 1
+@server_response_time >= 2
+1
+# Connection attempt should fail.
+Connection_control_delay_generated should be 2
+Variable_name Value
+Connection_control_delay_generated 2
+@server_response_time >= 2
+1
+# Connection attempt should fail.
+Connection_control_delay_generated should be 3
+Variable_name Value
+Connection_control_delay_generated 3
+@server_response_time >= 2
+1
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 4
+Variable_name Value
+Connection_control_delay_generated 4
+@server_response_time >= 2
+1
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 5
+Variable_name Value
+Connection_control_delay_generated 5
+@server_response_time >= 2
+1
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+@server_response_time >= 2
+1
+# Following attempts will not experience any delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should fail.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should fail.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+#-----------------------------------------------------------------------
+# Cleanup
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+SET @@global.connection_control_min_connection_delay = @saved_min_delay;
+# Remove user accounts
+# Uninstall connection_control plugin
+UNINSTALL PLUGIN connection_control;
+UNINSTALL PLUGIN connection_control_failed_login_attempts;
+#-----------------------------------------------------------------------
--- /dev/null
+# Connection delay tests for valid user accounts
+
+# ----------------------------------------------------------------------
+
+# Setup
+# Install connection_control plugin
+INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB';
+INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB';
+# Create user accounts for testing
+CREATE USER u1 IDENTIFIED BY 'abcd';
+CREATE USER u2 IDENTIFIED BY 'abcd';
+CREATE USER u3 IDENTIFIED BY 'abcd';
+# Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+SET @saved_min_delay= @@global.connection_control_min_connection_delay;
+# Set small values for connection_control variables
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @@global.connection_control_max_connection_delay = 4000;
+SET @@global.connection_control_min_connection_delay = 2000;
+
+# ----------------------------------------------------------------------
+
+# Make enough failed attempts to trigger delays
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u2,efgh,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u3,,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u2,haha,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+
+# Following attempts will experience delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 1
+Variable_name Value
+Connection_control_delay_generated 1
+@server_response_time >= 2
+1
+# Connection attempt should fail.
+Connection_control_delay_generated should be 2
+Variable_name Value
+Connection_control_delay_generated 2
+@server_response_time >= 2
+1
+# Connection attempt should fail.
+Connection_control_delay_generated should be 3
+Variable_name Value
+Connection_control_delay_generated 3
+@server_response_time >= 2
+1
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 4
+Variable_name Value
+Connection_control_delay_generated 4
+@server_response_time >= 2
+1
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 5
+Variable_name Value
+Connection_control_delay_generated 5
+@server_response_time >= 2
+1
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+@server_response_time >= 2
+1
+
+# Following attempts will not experience any delay in server respose
+# Connection attempt should fail.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should fail.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should fail.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+# Connection attempt should succeed.
+Connection_control_delay_generated should be 6
+Variable_name Value
+Connection_control_delay_generated 6
+
+# ----------------------------------------------------------------------
+
+# Cleanup
+# Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+SET @@global.connection_control_min_connection_delay = @saved_min_delay;
+# Remove user accounts created for the test
+DROP USER u1;
+DROP USER u2;
+DROP USER u3;
+# Uninstall connection_control plugin
+UNINSTALL PLUGIN connection_control;
+UNINSTALL PLUGIN connection_control_failed_login_attempts;
+
+# ----------------------------------------------------------------------
--- /dev/null
+# Connection delay tests for valid user accounts
+
+# ----------------------------------------------------------------------
+
+# Setup
+# Install connection_control plugin
+INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB';
+INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB';
+# Create user accounts for testing
+CREATE USER u1@localhost IDENTIFIED BY 'abcd';
+CREATE USER u2@localhost IDENTIFIED BY 'abcd';
+CREATE USER u3@localhost IDENTIFIED BY 'abcd';
+# Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay= @@global.connection_control_max_connection_delay;
+# Set small threshold
+SET @@global.connection_control_failed_connections_threshold = 1;
+# Set small max delay
+SET @@global.connection_control_max_connection_delay = 1000;
+
+# ----------------------------------------------------------------------
+
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
+connect(localhost,u3,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+connect(localhost,u2,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
+# Check Connection_control_delay_generated - Should be 0
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+Variable_name Value
+Connection_control_delay_generated 0
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
+connect(localhost,u2,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: YES)
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+# Check Connection_control_delay_generated - Should be 6
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+Variable_name Value
+Connection_control_delay_generated 6
+connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
+connect(localhost,u1,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: YES)
+connect(localhost,u3,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+# Check Connection_control_delay_generated - Should be 9
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+Variable_name Value
+Connection_control_delay_generated 9
+# Successful connection but delays would still be generated
+# Should be 12
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+Variable_name Value
+Connection_control_delay_generated 12
+# Setting failed connection threshold should reset delay statistics
+SET @@global.connection_control_failed_connections_threshold = 1;
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
+connect(localhost,u3,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+connect(localhost,u2,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
+connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u1'@'localhost' (using password: NO)
+connect(localhost,u3,haha,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u3'@'localhost' (using password: YES)
+connect(localhost,u2,efgh,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
+# Check Connection_control_delay_generated - Should be 3
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+Variable_name Value
+Connection_control_delay_generated 3
+
+# ----------------------------------------------------------------------
+
+# Cleanup
+# Restore original values of conenction_control variables
+SET @@global.connection_control_max_connection_delay= @saved_max_delay;
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+# Remove user accounts created for the test
+DROP USER u1@localhost;
+DROP USER u2@localhost;
+DROP USER u3@localhost;
+# Uninstall connection_control plugin
+UNINSTALL PLUGIN connection_control;
+UNINSTALL PLUGIN connection_control_failed_login_attempts;
+
+# ----------------------------------------------------------------------
--- /dev/null
+#-----------------------------------------------------------------------
+# Setup
+# Install connection_control plugin
+INSTALL PLUGIN connection_control SONAME 'CONNECTION_CONTROL_LIB';
+INSTALL PLUGIN connection_control_failed_login_attempts SONAME 'CONNECTION_CONTROL_LIB';
+CREATE USER no_privs@localhost IDENTIFIED BY 'abcd';
+#-----------------------------------------------------------------------
+# Case 1 : connection_control_failed_connections_threshold
+SHOW GRANTS;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION
+SET @saved_value = @@global.connection_control_failed_connections_threshold;
+SELECT @saved_value;
+@saved_value
+3
+SET @@global.connection_control_failed_connections_threshold = @saved_value;
+# 1.1 : Setting connection_control_failed_connections_threshold to valid
+# value
+SET @@global.connection_control_failed_connections_threshold = 20;
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+20
+SET @@global.connection_control_failed_connections_threshold = 2000;
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+2000
+SET @@global.connection_control_failed_connections_threshold = 2147483647;
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+2147483647
+SET @@global.connection_control_failed_connections_threshold = DEFAULT;
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+# 1.2 : Setting connection_control_failed_connections_threshold to
+# invalid value
+SET @@global.connection_control_failed_connections_threshold = NULL;
+ERROR 42000: Incorrect argument type to variable 'connection_control_failed_connections_threshold'
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+SET @@global.connection_control_failed_connections_threshold = `SELECT * FROM mysql.user`;
+ERROR 42000: Incorrect argument type to variable 'connection_control_failed_connections_threshold'
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+SET @@global.connection_control_failed_connections_threshold = -20;
+ERROR 42000: Variable 'connection_control_failed_connections_threshold' can't be set to the value of '-20'
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+SET @@global.connection_control_failed_connections_threshold = 9223372036854775808;
+ERROR 42000: Variable 'connection_control_failed_connections_threshold' can't be set to the value of '9223372036854775808'
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+SET @@global.connection_control_failed_connections_threshold = -9223372036854775808;
+ERROR 42000: Variable 'connection_control_failed_connections_threshold' can't be set to the value of '-9223372036854775808'
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+# Switch to conn_no_privs
+# 1.3 : Use no_privs@localhost to set
+# connection_control_failed_connections_threshold to valid value
+SET @@global.connection_control_failed_connections_threshold = 2147483647;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+SET @@global.connection_control_failed_connections_threshold = DEFAULT;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+# 1.4 : Use no_privs@localhost to set
+# connection_control_failed_connections_threshold to invalid value
+SET @@global.connection_control_failed_connections_threshold = NULL;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+SET @@global.connection_control_failed_connections_threshold = 9223372036854775808;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+SET @@global.connection_control_failed_connections_threshold = @saved_value;
+SELECT @@global.connection_control_failed_connections_threshold;
+@@global.connection_control_failed_connections_threshold
+3
+#-----------------------------------------------------------------------
+# Case 2 : connection_control_min_connection_delay
+SET @saved_value= @@global.connection_control_min_connection_delay;
+SELECT @saved_value;
+@saved_value
+1000
+# 2.1 : Setting connection_control_min_connection_delay to valid
+# value
+SET @@global.connection_control_min_connection_delay = 20000;
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+20000
+SET @@global.connection_control_min_connection_delay = 2000;
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+2000
+SET @@global.connection_control_min_connection_delay = 2147483647;
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+2147483647
+SET @@global.connection_control_min_connection_delay = DEFAULT;
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+# 2.2 : Setting connection_control_min_connection_delay to
+# invalid value
+SET @@global.connection_control_min_connection_delay = NULL;
+ERROR 42000: Incorrect argument type to variable 'connection_control_min_connection_delay'
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+SET @@global.connection_control_min_connection_delay = `SELECT * FROM mysql.user`;
+ERROR 42000: Incorrect argument type to variable 'connection_control_min_connection_delay'
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+SET @@global.connection_control_min_connection_delay = -20;
+ERROR 42000: Variable 'connection_control_min_connection_delay' can't be set to the value of '-20'
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+SET @@global.connection_control_min_connection_delay = 9223372036854775808;
+ERROR 42000: Variable 'connection_control_min_connection_delay' can't be set to the value of '9223372036854775808'
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+SET @@global.connection_control_min_connection_delay = -9223372036854775808;
+ERROR 42000: Variable 'connection_control_min_connection_delay' can't be set to the value of '-9223372036854775808'
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+SET@@global.connection_control_min_connection_delay = 20;
+ERROR 42000: Variable 'connection_control_min_connection_delay' can't be set to the value of '20'
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+# Switch to conn_no_privs
+# 2.3 : Use no_privs@localhost to set
+# connection_control_min_connection_delay to valid value
+SET @@global.connection_control_min_connection_delay = 2147483647;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+SET @@global.connection_control_min_connection_delay = DEFAULT;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+# 2.4 : Use no_privs@localhost to set
+# connection_control_min_connection_delay to invalid value
+SET @@global.connection_control_min_connection_delay = NULL;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+SET @@global.connection_control_min_connection_delay = 9223372036854775808;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+# Switch to default connection
+# 2.5 : Setting connection_control_min_connection_delay to a value
+# greater than connection_control_max_connection_delay
+SET @saved_max_delay= @@global.connection_control_max_connection_delay;
+SET @@global.connection_control_max_connection_delay= 10000;
+SET @@global.connection_control_min_connection_delay= 11000;
+ERROR 42000: Variable 'connection_control_min_connection_delay' can't be set to the value of '11000'
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+SET @@global.connection_control_max_connection_delay= @saved_max_delay;
+SET @@global.connection_control_min_connection_delay = @saved_value;
+SELECT @@global.connection_control_min_connection_delay;
+@@global.connection_control_min_connection_delay
+1000
+#-----------------------------------------------------------------------
+# Case 3 : connection_control_max_connection_delay
+SET @saved_value= @@global.connection_control_max_connection_delay;
+SELECT @saved_value;
+@saved_value
+2147483647
+# 3.1 : Setting connection_control_max_connection_delay to valid
+# value
+SET @@global.connection_control_max_connection_delay = 20000;
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+20000
+SET @@global.connection_control_max_connection_delay = 2000;
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2000
+SET @@global.connection_control_max_connection_delay = 2147483647;
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+SET @@global.connection_control_max_connection_delay = DEFAULT;
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+# 3.2 : Setting connection_control_max_connection_delay to
+# invalid value
+SET @@global.connection_control_max_connection_delay = NULL;
+ERROR 42000: Incorrect argument type to variable 'connection_control_max_connection_delay'
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+SET @@global.connection_control_max_connection_delay = `SELECT * FROM mysql.user`;
+ERROR 42000: Incorrect argument type to variable 'connection_control_max_connection_delay'
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+SET @@global.connection_control_max_connection_delay = -20;
+ERROR 42000: Variable 'connection_control_max_connection_delay' can't be set to the value of '-20'
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+SET @@global.connection_control_max_connection_delay = 9223372036854775808;
+ERROR 42000: Variable 'connection_control_max_connection_delay' can't be set to the value of '9223372036854775808'
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+SET @@global.connection_control_max_connection_delay = -9223372036854775808;
+ERROR 42000: Variable 'connection_control_max_connection_delay' can't be set to the value of '-9223372036854775808'
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+SET @@global.connection_control_max_connection_delay = 20;
+ERROR 42000: Variable 'connection_control_max_connection_delay' can't be set to the value of '20'
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+# Switch to conn_no_privs
+# 3.3 : Use no_privs@localhost to set
+# connection_control_max_connection_delay to valid value
+SET @@global.connection_control_max_connection_delay = 2147483647;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+SET @@global.connection_control_max_connection_delay = DEFAULT;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+# 3.4 : Use no_privs@localhost to set
+# connection_control_max_connection_delay to invalid value
+SET @@global.connection_control_max_connection_delay = NULL;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+SET @@global.connection_control_max_connection_delay = 9223372036854775808;
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+# Switch to default connection
+# 3.5 : Setting connection_control_min_connection_delay to a value
+# greater than connection_control_max_connection_delay
+SET @saved_min_delay= @@global.connection_control_min_connection_delay;
+SET @@global.connection_control_min_connection_delay= 11000;
+SET @@global.connection_control_max_connection_delay= 10000;
+ERROR 42000: Variable 'connection_control_max_connection_delay' can't be set to the value of '10000'
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+SET @@global.connection_control_min_connection_delay= @saved_min_delay;
+SET @@global.connection_control_max_connection_delay = @saved_value;
+SELECT @@global.connection_control_max_connection_delay;
+@@global.connection_control_max_connection_delay
+2147483647
+#-----------------------------------------------------------------------
+# Cleanup
+DROP USER no_privs@localhost;
+# Uninstall connection_control plugin
+UNINSTALL PLUGIN connection_control;
+UNINSTALL PLUGIN connection_control_failed_login_attempts;
+#-----------------------------------------------------------------------
--- /dev/null
+$CONNECTION_CONTROL_PLUGIN_OPT
--- /dev/null
+# Skip the test in embedded mode
+--source include/not_embedded.inc
+
+# Make sure that connection_control plugin can be loaded
+--source ../inc/have_connection_control_plugin.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo # Connection delay tests for valid user accounts
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Setup
+--echo # Install connection_control plugin
+--source ../inc/install_connection_control_plugin.inc
+
+--echo # Create anonymous user
+CREATE USER ''@'localhost';
+
+--echo # Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+
+-- echo # Set small values for connection_control variables
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @global.connection_control_max_connection_delay = 1000;
+
+# We don't need to use client side authentication plugin for this test.
+let $USE_AUTH_PLUGIN= 0;
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Following attempts will not experience any delay in server respose
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+--echo
+--echo # Following attempts will experience delay in server respose
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=1;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=2;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=3;
+--source ../inc/check_connection_delay.inc
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Cleanup
+
+connection default;
+
+--echo # Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+
+--echo # Drop anonymous user
+DROP USER ''@'localhost';
+
+--echo # Uninstall connection_control plugin
+--source ../inc/uninstall_connection_control_plugin.inc
+
+# Wait till all disconnects are completed.
+--source include/wait_until_count_sessions.inc
+
+--echo
+--echo # ----------------------------------------------------------------------
--- /dev/null
+$CONNECTION_CONTROL_PLUGIN_OPT
--- /dev/null
+# Skip the test in embedded mode
+--source include/not_embedded.inc
+
+# Make sure that connection_control plugin can be loaded
+--source ../inc/have_connection_control_plugin.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo # Connection delay tests for valid user accounts
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Setup
+--echo # Install connection_control plugin
+--source ../inc/install_connection_control_plugin.inc
+
+--echo # Create user accounts for testing
+CREATE USER u1@localhost IDENTIFIED BY 'abcd';
+CREATE USER u2@localhost IDENTIFIED BY 'abcd';
+CREATE USER u3@localhost IDENTIFIED BY 'abcd';
+
+--echo # Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+
+-- echo # Avoid triggering delay
+SET @@global.connection_control_failed_connections_threshold = 100;
+
+# We don't need to use client side authentication plugin for this test.
+let $USE_AUTH_PLUGIN= 0;
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,efgh,,,,);
+
+-- echo # connection_control_failed_login_attempts should contain entries
+-- echo # for u1@localhost and u2@localhost
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,efgh,,,,);
+
+-- echo # connection_control_failed_login_attempts should contain entries
+-- echo # for u1@localhost, u2@localhost and u3@localhost
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,efgh,,,,);
+
+-- echo # failed connection counts should have increased for all users
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,efgh,,,,);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,efgh,,,,);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+
+-- echo # Try various queries
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+ WHERE USERHOST = '\'u1\'@\'localhost\'';
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+ WHERE USERHOST LIKE '%u2%';
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+ WHERE FAILED_ATTEMPTS > 4;
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+ WHERE FAILED_ATTEMPTS > 5;
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts
+ WHERE FAILED_ATTEMPTS < 5;
+
+connect(con_u1, localhost, u1,abcd,,,,);
+connect(con_u2, localhost, u2,abcd,,,,);
+connection default;
+--disconnect con_u1
+--disconnect con_u2
+
+--echo # After successful login, corresponding entry should disappear
+--echo # from the view
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+
+connect(con_u3, localhost, u3,abcd,,,,);
+--echo # A user without privileges should not be able to any information
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+
+connection default;
+--disconnect con_u3
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,efgh,,,,);
+
+-- echo # Subsequent failed attempts should put entries back in the view
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u4, localhost, u4,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u5, localhost, u5,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u6, localhost, u6,efgh,,,,);
+
+-- echo # Attempts by invalid accounts should be shown in the view
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Cleanup
+
+connection default;
+
+--echo # Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+
+--echo # Remove user accounts created for the test
+DROP USER u1@localhost;
+DROP USER u2@localhost;
+DROP USER u3@localhost;
+
+--echo # Uninstall connection_control plugin
+--source ../inc/uninstall_connection_control_plugin.inc
+
+# Wait till all disconnects are completed.
+--source include/wait_until_count_sessions.inc
+
+--echo
+--echo # ----------------------------------------------------------------------
--- /dev/null
+$CONNECTION_CONTROL_PLUGIN_OPT
--- /dev/null
+# Skip the test in embedded mode
+--source include/not_embedded.inc
+
+# Make sure that connection_control plugin can be loaded
+--source ../inc/have_connection_control_plugin.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo # Connection delay tests for valid user accounts
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Setup
+--echo # Install connection_control plugin
+--source ../inc/install_connection_control_plugin.inc
+
+--echo # Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+
+-- echo # Set small values for connection_control variables
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @@global.connection_control_max_connection_delay = 1000;
+
+# We don't need to use client side authentication plugin for this test.
+let $USE_AUTH_PLUGIN= 0;
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Following attempts will not experience any delay in server respose
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=0;
+--source ../inc/check_connection_delay.inc
+
+--echo
+--echo # Following attempts will experience delay in server respose
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=1;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=2;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=3;
+--source ../inc/check_connection_delay.inc
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+
+let $USER=u3;
+let $PASSWORD=abcd;
+let $SUCCESS=0;
+let $DELAY_STATS=4;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=abcd;
+let $SUCCESS=0;
+let $DELAY_STATS=5;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u1;
+let $PASSWORD=abcd;
+let $SUCCESS=0;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+--sorted_result
+SELECT * FROM INFORMATION_SCHEMA.connection_control_failed_login_attempts;
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Cleanup
+
+connection default;
+
+--echo # Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+
+
+--echo # Uninstall connection_control plugin
+--source ../inc/uninstall_connection_control_plugin.inc
+
+# Wait till all disconnects are completed.
+--source include/wait_until_count_sessions.inc
+
+--echo
+--echo # ----------------------------------------------------------------------
--- /dev/null
+$CONNECTION_CONTROL_PLUGIN_OPT
--- /dev/null
+# Skip the test in embedded mode
+--source include/not_embedded.inc
+
+# Make sure that connection_control plugin can be loaded
+--source ../inc/have_connection_control_plugin.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo # Connection delay tests for valid user accounts
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Setup
+--echo # Install connection_control plugin
+--source ../inc/install_connection_control_plugin.inc
+
+--echo # Create user account for testing
+CREATE USER u1 IDENTIFIED BY 'abcd';
+
+--echo # Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+SET @saved_min_delay = @@global.connection_control_min_connection_delay;
+
+-- echo # Set small values for connection_control variables
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @@global.connection_control_max_connection_delay = 4000;
+SET @@global.connection_control_min_connection_delay = 2000;
+
+# We don't need to use client side authentication plugin for this test.
+let $USE_AUTH_PLUGIN= 0;
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Make enough failed attempts to trigger delays
+
+disable_result_log;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+
+enable_result_log;
+
+--echo
+--echo # Following attempts will experience delay in server respose
+
+# Trying with invalid passwords
+
+--source ../inc/set_before_marker.inc
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=1;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=2;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=3;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 3;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=4;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 4;
+--source ../inc/set_after_marker.inc
+
+# Trying with valid passwords
+
+--source ../inc/set_before_marker.inc
+let $USER=u1;
+let $PASSWORD=abcd;
+let $SUCCESS=1;
+let $DELAY_STATS=5;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 4;
+--source ../inc/set_after_marker.inc
+
+--echo
+--echo # Following attempts will not experience any delay in server respose
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=5;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u1;
+let $PASSWORD=abcd;
+let $SUCCESS=1;
+let $DELAY_STATS=5;
+--source ../inc/check_connection_delay.inc
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Cleanup
+
+connection default;
+
+--echo # Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+SET @@global.connection_control_min_connection_delay = @saved_min_delay;
+
+--echo # Remove user account created for the test
+DROP USER u1;
+
+--echo # Uninstall connection_control plugin
+--source ../inc/uninstall_connection_control_plugin.inc
+
+# Wait till all disconnects are completed.
+--source include/wait_until_count_sessions.inc
+
+--echo
+--echo # ----------------------------------------------------------------------
--- /dev/null
+$CONNECTION_CONTROL_PLUGIN_OPT
--- /dev/null
+# Skip the test in embedded mode
+--source include/not_embedded.inc
+
+# Make sure that connection_control plugin can be loaded
+--source ../inc/have_connection_control_plugin.inc
+--source ../inc/have_test_plugin.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo #-----------------------------------------------------------------------
+--echo # Setup
+--echo # Install connection_control plugin
+--source ../inc/install_connection_control_plugin.inc
+--echo # Do proxy setup
+--source ../inc/setup_proxy_accounts.inc
+
+# Suppress error messages from test_plugin_server
+CALL mtr.add_suppression("Plugin test_plugin_server reported: 'Wrong password supplied for proxied'");
+
+# Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+SET @saved_min_delay= @@global.connection_control_min_connection_delay;
+
+# Set a small values for connection_control variables
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @@global.connection_control_max_connection_delay = 4000;
+SET @@global.connection_control_min_connection_delay = 2000;
+
+# We will use client side authentication plugin for this test.
+let $USE_AUTH_PLUGIN= 1;
+let $CLIENT_AUTH_PLUGIN= $PLUGIN_AUTH_OPT;
+
+--echo #-----------------------------------------------------------------------
+
+--echo # Case 1 : Testss for valid user accounts
+
+--echo # Make enough failed attempts to trigger delays
+
+disable_result_log;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u2,efgh,,,,);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u3,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u2,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u3,efgh,,,,);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u2,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u3,efgh,,,,);
+
+enable_result_log;
+
+--echo # Following attempts will experience delay in server respose
+
+# Trying with invalid passwords
+
+--source ../inc/set_before_marker.inc
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=1;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=2;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=3;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+# Trying with valid passwords
+# Even though u1@localhost, u2@localhost and u3@localhost are
+# proxying same user - proxied@localhost, we will not use
+# proxied@localohst for recording failed attempts information.
+# Rather, we will rely on proxying users' data.
+# So each of the following should get delay of 2 seconds
+# or more.
+
+--source ../inc/set_before_marker.inc
+let $USER=u3;
+let $PASSWORD=proxied;
+let $SUCCESS=1;
+let $DELAY_STATS=4;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u2;
+let $PASSWORD=proxied;
+let $SUCCESS=1;
+let $DELAY_STATS=5;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u1;
+let $PASSWORD=proxied;
+let $SUCCESS=1;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+
+--echo # Following attempts will not experience any delay in server respose
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u1;
+let $PASSWORD=proxied;
+let $SUCCESS=1;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=proxied;
+let $SUCCESS=1;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=proxied;
+let $SUCCESS=1;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+--echo #-----------------------------------------------------------------------
+--echo # Cleanup
+
+connection default;
+
+# Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+SET @@global.connection_control_min_connection_delay = @saved_min_delay;
+
+--echo # Remove user accounts
+--source ../inc/cleanup_proxy_accounts.inc
+--echo # Uninstall connection_control plugin
+--source ../inc/uninstall_connection_control_plugin.inc
+
+# Wait till all disconnects are completed.
+--source include/wait_until_count_sessions.inc
+--echo #-----------------------------------------------------------------------
--- /dev/null
+$CONNECTION_CONTROL_PLUGIN_OPT
--- /dev/null
+# Skip the test in embedded mode
+--source include/not_embedded.inc
+
+# Make sure that connection_control plugin can be loaded
+--source ../inc/have_connection_control_plugin.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo # Connection delay tests for valid user accounts
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Setup
+--echo # Install connection_control plugin
+--source ../inc/install_connection_control_plugin.inc
+
+--echo # Create user accounts for testing
+CREATE USER u1 IDENTIFIED BY 'abcd';
+CREATE USER u2 IDENTIFIED BY 'abcd';
+CREATE USER u3 IDENTIFIED BY 'abcd';
+
+--echo # Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay = @@global.connection_control_max_connection_delay;
+SET @saved_min_delay= @@global.connection_control_min_connection_delay;
+
+-- echo # Set small values for connection_control variables
+SET @@global.connection_control_failed_connections_threshold = 3;
+SET @@global.connection_control_max_connection_delay = 4000;
+SET @@global.connection_control_min_connection_delay = 2000;
+
+# We don't need to use client side authentication plugin for this test.
+let $USE_AUTH_PLUGIN= 0;
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Make enough failed attempts to trigger delays
+
+disable_result_log;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,efgh,,,,);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,efgh,,,,);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,efgh,,,,);
+
+enable_result_log;
+
+--echo
+--echo # Following attempts will experience delay in server respose
+
+# Trying with invalid passwords
+
+--source ../inc/set_before_marker.inc
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=1;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=2;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=3;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+# Trying with valid passwords
+
+--source ../inc/set_before_marker.inc
+let $USER=u3;
+let $PASSWORD=abcd;
+let $SUCCESS=1;
+let $DELAY_STATS=4;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u2;
+let $PASSWORD=abcd;
+let $SUCCESS=1;
+let $DELAY_STATS=5;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--source ../inc/set_before_marker.inc
+let $USER=u1;
+let $PASSWORD=abcd;
+let $SUCCESS=1;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $SERVER_RESPONSE_TIME= 2;
+--source ../inc/set_after_marker.inc
+
+--echo
+--echo # Following attempts will not experience any delay in server respose
+
+let $USER=u1;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=hoho;
+let $SUCCESS=0;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u1;
+let $PASSWORD=abcd;
+let $SUCCESS=1;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u2;
+let $PASSWORD=abcd;
+let $SUCCESS=1;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+let $USER=u3;
+let $PASSWORD=abcd;
+let $SUCCESS=1;
+let $DELAY_STATS=6;
+--source ../inc/check_connection_delay.inc
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Cleanup
+
+connection default;
+
+--echo # Restore original values of conenction_control variables
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+SET @@global.connection_control_max_connection_delay = @saved_max_delay;
+SET @@global.connection_control_min_connection_delay = @saved_min_delay;
+
+--echo # Remove user accounts created for the test
+DROP USER u1;
+DROP USER u2;
+DROP USER u3;
+
+--echo # Uninstall connection_control plugin
+--source ../inc/uninstall_connection_control_plugin.inc
+
+# Wait till all disconnects are completed.
+--source include/wait_until_count_sessions.inc
+
+--echo
+--echo # ----------------------------------------------------------------------
--- /dev/null
+$CONNECTION_CONTROL_PLUGIN_OPT
--- /dev/null
+# Skip the test in embedded mode
+--source include/not_embedded.inc
+
+# Make sure that connection_control plugin can be loaded
+--source ../inc/have_connection_control_plugin.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo # Connection delay tests for valid user accounts
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Setup
+--echo # Install connection_control plugin
+--source ../inc/install_connection_control_plugin.inc
+
+--echo # Create user accounts for testing
+CREATE USER u1@localhost IDENTIFIED BY 'abcd';
+CREATE USER u2@localhost IDENTIFIED BY 'abcd';
+CREATE USER u3@localhost IDENTIFIED BY 'abcd';
+
+--echo # Save original values of connection_control variables
+SET @saved_connections_threshold = @@global.connection_control_failed_connections_threshold;
+SET @saved_max_delay= @@global.connection_control_max_connection_delay;
+
+-- echo # Set small threshold
+SET @@global.connection_control_failed_connections_threshold = 1;
+-- echo # Set small max delay
+SET @@global.connection_control_max_connection_delay = 1000;
+
+# We don't need to use client side authentication plugin for this test.
+let $USE_AUTH_PLUGIN= 0;
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,efgh,,,,);
+
+--echo # Check Connection_control_delay_generated - Should be 0
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,efgh,,,,);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,efgh,,,,);
+
+--echo # Check Connection_control_delay_generated - Should be 6
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,efgh,,,,);
+
+--echo # Check Connection_control_delay_generated - Should be 9
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+
+connect(con_u1, localhost, u1,abcd,,,,);
+connect(con_u2, localhost, u2,abcd,,,,);
+connect(con_u3, localhost, u3,abcd,,,,);
+connection default;
+--disconnect con_u1
+--disconnect con_u2
+--disconnect con_u3
+
+--echo # Successful connection but delays would still be generated
+--echo # Should be 12
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+
+--echo # Setting failed connection threshold should reset delay statistics
+SET @@global.connection_control_failed_connections_threshold = 1;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,efgh,,,,);
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u1, localhost, u1,,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u3, localhost, u3,haha,,,,);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_ACCESS_DENIED_ERROR
+connect(fail_con_u2, localhost, u2,efgh,,,,);
+
+--echo # Check Connection_control_delay_generated - Should be 3
+SHOW STATUS LIKE 'Connection_control_delay_generated';
+
+--echo
+--echo # ----------------------------------------------------------------------
+--echo
+
+--echo # Cleanup
+
+connection default;
+
+--echo # Restore original values of conenction_control variables
+SET @@global.connection_control_max_connection_delay= @saved_max_delay;
+SET @@global.connection_control_failed_connections_threshold = @saved_connections_threshold;
+
+--echo # Remove user accounts created for the test
+DROP USER u1@localhost;
+DROP USER u2@localhost;
+DROP USER u3@localhost;
+
+--echo # Uninstall connection_control plugin
+--source ../inc/uninstall_connection_control_plugin.inc
+
+# Wait till all disconnects are completed.
+--source include/wait_until_count_sessions.inc
+
+--echo
+--echo # ----------------------------------------------------------------------
--- /dev/null
+$CONNECTION_CONTROL_PLUGIN_OPT
--- /dev/null
+# Skip the test in embedded mode
+--source include/not_embedded.inc
+
+# Make sure that connection_control plugin can be loaded
+--source ../inc/have_connection_control_plugin.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo #-----------------------------------------------------------------------
+--echo # Setup
+--echo # Install connection_control plugin
+--source ../inc/install_connection_control_plugin.inc
+CREATE USER no_privs@localhost IDENTIFIED BY 'abcd';
+connect(conn_no_privs, localhost, no_privs, abcd,,,,);
+connection default;
+--echo #-----------------------------------------------------------------------
+
+--echo # Case 1 : connection_control_failed_connections_threshold
+SHOW GRANTS;
+SET @saved_value = @@global.connection_control_failed_connections_threshold;
+SELECT @saved_value;
+SET @@global.connection_control_failed_connections_threshold = @saved_value;
+
+--echo # 1.1 : Setting connection_control_failed_connections_threshold to valid
+--echo # value
+
+SET @@global.connection_control_failed_connections_threshold = 20;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+SET @@global.connection_control_failed_connections_threshold = 2000;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+SET @@global.connection_control_failed_connections_threshold = 2147483647;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+SET @@global.connection_control_failed_connections_threshold = DEFAULT;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--echo # 1.2 : Setting connection_control_failed_connections_threshold to
+--echo # invalid value
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.connection_control_failed_connections_threshold = NULL;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.connection_control_failed_connections_threshold = `SELECT * FROM mysql.user`;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_failed_connections_threshold = -20;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_failed_connections_threshold = 9223372036854775808;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_failed_connections_threshold = -9223372036854775808;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--echo # Switch to conn_no_privs
+connection conn_no_privs;
+--echo # 1.3 : Use no_privs@localhost to set
+--echo # connection_control_failed_connections_threshold to valid value
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_failed_connections_threshold = 2147483647;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_failed_connections_threshold = DEFAULT;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--echo # 1.4 : Use no_privs@localhost to set
+--echo # connection_control_failed_connections_threshold to invalid value
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_failed_connections_threshold = NULL;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_failed_connections_threshold = 9223372036854775808;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+connection default;
+
+SET @@global.connection_control_failed_connections_threshold = @saved_value;
+SELECT @@global.connection_control_failed_connections_threshold;
+
+--echo #-----------------------------------------------------------------------
+
+--echo # Case 2 : connection_control_min_connection_delay
+
+SET @saved_value= @@global.connection_control_min_connection_delay;
+SELECT @saved_value;
+
+--echo # 2.1 : Setting connection_control_min_connection_delay to valid
+--echo # value
+
+SET @@global.connection_control_min_connection_delay = 20000;
+SELECT @@global.connection_control_min_connection_delay;
+
+SET @@global.connection_control_min_connection_delay = 2000;
+SELECT @@global.connection_control_min_connection_delay;
+
+SET @@global.connection_control_min_connection_delay = 2147483647;
+SELECT @@global.connection_control_min_connection_delay;
+
+SET @@global.connection_control_min_connection_delay = DEFAULT;
+SELECT @@global.connection_control_min_connection_delay;
+
+--echo # 2.2 : Setting connection_control_min_connection_delay to
+--echo # invalid value
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.connection_control_min_connection_delay = NULL;
+SELECT @@global.connection_control_min_connection_delay;
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.connection_control_min_connection_delay = `SELECT * FROM mysql.user`;
+SELECT @@global.connection_control_min_connection_delay;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_min_connection_delay = -20;
+SELECT @@global.connection_control_min_connection_delay;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_min_connection_delay = 9223372036854775808;
+SELECT @@global.connection_control_min_connection_delay;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_min_connection_delay = -9223372036854775808;
+SELECT @@global.connection_control_min_connection_delay;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET@@global.connection_control_min_connection_delay = 20;
+SELECT @@global.connection_control_min_connection_delay;
+
+--echo # Switch to conn_no_privs
+connection conn_no_privs;
+--echo # 2.3 : Use no_privs@localhost to set
+--echo # connection_control_min_connection_delay to valid value
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_min_connection_delay = 2147483647;
+SELECT @@global.connection_control_min_connection_delay;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_min_connection_delay = DEFAULT;
+SELECT @@global.connection_control_min_connection_delay;
+
+--echo # 2.4 : Use no_privs@localhost to set
+--echo # connection_control_min_connection_delay to invalid value
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_min_connection_delay = NULL;
+SELECT @@global.connection_control_min_connection_delay;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_min_connection_delay = 9223372036854775808;
+SELECT @@global.connection_control_min_connection_delay;
+
+--echo # Switch to default connection
+connection default;
+--echo # 2.5 : Setting connection_control_min_connection_delay to a value
+--echo # greater than connection_control_max_connection_delay
+
+SET @saved_max_delay= @@global.connection_control_max_connection_delay;
+SET @@global.connection_control_max_connection_delay= 10000;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_min_connection_delay= 11000;
+SELECT @@global.connection_control_min_connection_delay;
+
+SET @@global.connection_control_max_connection_delay= @saved_max_delay;
+
+SET @@global.connection_control_min_connection_delay = @saved_value;
+SELECT @@global.connection_control_min_connection_delay;
+
+--echo #-----------------------------------------------------------------------
+
+--echo # Case 3 : connection_control_max_connection_delay
+
+SET @saved_value= @@global.connection_control_max_connection_delay;
+SELECT @saved_value;
+
+--echo # 3.1 : Setting connection_control_max_connection_delay to valid
+--echo # value
+
+SET @@global.connection_control_max_connection_delay = 20000;
+SELECT @@global.connection_control_max_connection_delay;
+
+SET @@global.connection_control_max_connection_delay = 2000;
+SELECT @@global.connection_control_max_connection_delay;
+
+SET @@global.connection_control_max_connection_delay = 2147483647;
+SELECT @@global.connection_control_max_connection_delay;
+
+SET @@global.connection_control_max_connection_delay = DEFAULT;
+SELECT @@global.connection_control_max_connection_delay;
+
+--echo # 3.2 : Setting connection_control_max_connection_delay to
+--echo # invalid value
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.connection_control_max_connection_delay = NULL;
+SELECT @@global.connection_control_max_connection_delay;
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.connection_control_max_connection_delay = `SELECT * FROM mysql.user`;
+SELECT @@global.connection_control_max_connection_delay;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_max_connection_delay = -20;
+SELECT @@global.connection_control_max_connection_delay;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_max_connection_delay = 9223372036854775808;
+SELECT @@global.connection_control_max_connection_delay;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_max_connection_delay = -9223372036854775808;
+SELECT @@global.connection_control_max_connection_delay;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_max_connection_delay = 20;
+SELECT @@global.connection_control_max_connection_delay;
+
+--echo # Switch to conn_no_privs
+connection conn_no_privs;
+--echo # 3.3 : Use no_privs@localhost to set
+--echo # connection_control_max_connection_delay to valid value
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_max_connection_delay = 2147483647;
+SELECT @@global.connection_control_max_connection_delay;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_max_connection_delay = DEFAULT;
+SELECT @@global.connection_control_max_connection_delay;
+
+--echo # 3.4 : Use no_privs@localhost to set
+--echo # connection_control_max_connection_delay to invalid value
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_max_connection_delay = NULL;
+SELECT @@global.connection_control_max_connection_delay;
+
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+SET @@global.connection_control_max_connection_delay = 9223372036854775808;
+SELECT @@global.connection_control_max_connection_delay;
+
+--echo # Switch to default connection
+connection default;
+--echo # 3.5 : Setting connection_control_min_connection_delay to a value
+--echo # greater than connection_control_max_connection_delay
+
+SET @saved_min_delay= @@global.connection_control_min_connection_delay;
+SET @@global.connection_control_min_connection_delay= 11000;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.connection_control_max_connection_delay= 10000;
+SELECT @@global.connection_control_max_connection_delay;
+
+SET @@global.connection_control_min_connection_delay= @saved_min_delay;
+
+SET @@global.connection_control_max_connection_delay = @saved_value;
+SELECT @@global.connection_control_max_connection_delay;
+
+--echo #-----------------------------------------------------------------------
+--echo # Cleanup
+disconnect conn_no_privs;
+DROP USER no_privs@localhost;
+--echo # Uninstall connection_control plugin
+--source ../inc/uninstall_connection_control_plugin.inc
+
+# Wait till all disconnects are completed.
+--source include/wait_until_count_sessions.inc
+--echo #-----------------------------------------------------------------------
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://'
-wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port'
+wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
--- /dev/null
+
+#
+# Let's understand the topology.
+# * Independent Master with server-id = 1
+# * Galera cluster with 2 nodes: node#1 and node#2 with server-id = 2, 3
+# node#1 act as slave to Independent Master with server-id = 1
+# * Independent Slave with server-id = 4 replicating from galera node#2
+#
+
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+log-slave-updates
+log-bin=mysqld-bin
+binlog-format=row
+gtid-mode=on
+enforce-gtid-consistency=true
+
+[mysqld.1]
+server-id=1
+
+[mysqld.2]
+server-id=2
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts=1;'
+
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 7
+
+wsrep_node_address=127.0.0.1
+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+
+# Required for Galera
+innodb_autoinc_lock_mode=2
+
+innodb_flush_log_at_trx_commit=2
+
+[mysqld.3]
+server-id=3
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout = PT15S; evs.max_install_timeouts = 1;'
+
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 7
+
+wsrep_node_address=127.0.0.1
+wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+
+# Required for Galera
+innodb_autoinc_lock_mode=2
+
+innodb_flush_log_at_trx_commit=2
+
+[mysqld.4]
+server-id=4
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_MYPORT_4= @mysqld.4.port
+NODE_MYSOCK_4= @mysqld.4.socket
+
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+
+NODE_SSTPORT_2= @mysqld.2.#sst_port
+NODE_SSTPORT_3= @mysqld.3.#sst_port
--- /dev/null
+#
+# This .cnf file creates a setup with a 2-node Galera cluster and one stand-alone MySQL server, to be used as a slave
+#
+
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+default-storage-engine=InnoDB
+
+[mysqld.1]
+server-id=1
+binlog-format=row
+log-bin=mysqld-bin
+log_slave_updates
+gtid-mode=on
+enforce-gtid-consistency=true
+event-scheduler=1
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.1.#galera_port'
+
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 7
+
+wsrep_node_address=127.0.0.1
+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+
+# Required for Galera
+innodb_autoinc_lock_mode=2
+
+innodb_flush_log_at_trx_commit=2
+
+[mysqld.2]
+server-id=2
+binlog-format=row
+log-bin=mysqld-bin
+log_slave_updates
+gtid-mode=on
+enforce-gtid-consistency=true
+event-scheduler=1
+
+wsrep_provider=@ENV.WSREP_PROVIDER
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port'
+
+# enforce read-committed characteristics across the cluster
+wsrep_causal_reads=ON
+wsrep_sync_wait = 7
+
+wsrep_node_address=127.0.0.1
+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+
+# Required for Galera
+innodb_autoinc_lock_mode=2
+
+innodb_flush_log_at_trx_commit=2
+
+[mysqld.3]
+server-id=3
+replicate-ignore-db=test
+replicate-wild-ignore-table=test.%
+log-bin=mysqld-bin
+log_slave_updates
+gtid-mode=on
+enforce-gtid-consistency=true
+event-scheduler=1
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_GALERAPORT_1= @mysqld.1.#galera_port
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+
+NODE_SSTPORT_1= @mysqld.1.#sst_port
+NODE_SSTPORT_2= @mysqld.2.#sst_port
--- /dev/null
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+SET @@global.wsrep_desync = 1;
+SET SESSION wsrep_sync_wait=0;
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+SHOW STATUS LIKE 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SET @@global.wsrep_desync = 0;
+SET SESSION wsrep_sync_wait=7;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) NOT NULL,
+ `f2` char(1) DEFAULT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CALL mtr.add_suppression("WSREP: Protocol violation. JOIN message sender (.*) is not in state transfer \\(SYNCED\\). Message ignored.");
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';
--- /dev/null
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
--- /dev/null
+CREATE TABLE t1 (f1 CHAR(10), f0 integer) ENGINE=InnoDB;
+FLUSH TABLE t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t1 DROP COLUMN f1;
+SET SESSION wsrep_osu_method='RSU';
+ALTER TABLE t1 ADD COLUMN f1 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f1;
+ALTER TABLE t1 ADD COLUMN f2 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f2;
+ALTER TABLE t1 ADD COLUMN f3 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f3;
+ALTER TABLE t1 ADD COLUMN f4 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f4;
+ALTER TABLE t1 ADD COLUMN f5 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f5;
+ALTER TABLE t1 ADD COLUMN f6 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f6;
+ALTER TABLE t1 ADD COLUMN f7 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f7;
+ALTER TABLE t1 ADD COLUMN f8 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f8;
+ALTER TABLE t1 ADD COLUMN f9 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f9;
+ALTER TABLE t1 ADD COLUMN f10 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f10;
+ALTER TABLE t1 ADD COLUMN f11 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f11;
+ALTER TABLE t1 ADD COLUMN f12 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f12;
+ALTER TABLE t1 ADD COLUMN f13 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f13;
+ALTER TABLE t1 ADD COLUMN f14 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f14;
+ALTER TABLE t1 ADD COLUMN f15 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f15;
+ALTER TABLE t1 ADD COLUMN f16 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f16;
+SET SESSION wsrep_osu_method='TOI';
+DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+include/wait_for_slave_param.inc [Slave_IO_Running]
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+include/wait_for_slave_to_start.inc
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+STOP SLAVE;
+RESET SLAVE ALL;
+CALL mtr.add_suppression('failed registering on master');
--- /dev/null
+CREATE TABLE parent1 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+CREATE TABLE parent2 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY,
+parent1_id INT,
+parent2_id INT,
+FOREIGN KEY (parent1_id) REFERENCES parent1(id),
+FOREIGN KEY (parent1_id) REFERENCES parent2(id)
+) ENGINE=InnoDB;
+INSERT INTO parent1 VALUES (1);
+INSERT INTO parent2 VALUES (1);
+INSERT INTO child VALUES (1,1,1);
+INSERT INTO child VALUES (2,1,1);
+SET foreign_key_checks=OFF;
+DROP TABLE parent1;
+UPDATE child SET parent1_id=2 WHERE id=1;
+DROP TABLE child;
+DROP TABLE parent2;
+SET foreign_key_checks=ON;
--- /dev/null
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+SET GLOBAL wsrep_desync = TRUE;
+SET wsrep_on = FALSE;
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+ERROR 70100: Query execution was interrupted
+SET wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+DROP TABLE t1;
+DROP TABLE ten;
--- /dev/null
+CREATE TABLE rand_table (f1 FLOAT);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
+f1 f2
+2 a
+SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+COMMIT;;
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = 0;
+SET SESSION wsrep_on = 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+SELECT TIMEDIFF(SYSDATE(), NOW()) < 2;
+TIMEDIFF(SYSDATE(), NOW()) < 2
+1
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+SELECT COUNT(DISTINCT f1) = 10 FROM rand_table;
+COUNT(DISTINCT f1) = 10
+1
+wsrep_local_replays
+1
+DROP TABLE t1;
+DROP TABLE rand_table;
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+SET GLOBAL wsrep_max_ws_rows = 2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SHOW STATUS LIKE '%wsrep%';
+SET GLOBAL wsrep_max_ws_rows = 0;
+DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+SET GLOBAL wsrep_max_ws_rows = 2;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SELECT * FROM t1 GROUP BY f1;
+f1
+1
+SHOW STATUS LIKE '%wsrep%';
+INSERT INTO t1 SELECT * FROM t1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES (1);
+INSERT INTO t1 (f1) VALUES (2),(3),(4);
+ERROR HY000: wsrep_max_ws_rows exceeded
+ROLLBACK;
+START TRANSACTION;
+DELETE FROM t1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+DROP TABLE t1;
+SET GLOBAL wsrep_max_ws_rows = 0;
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO t1 (f1) VALUES (1);
+CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
+CREATE PROCEDURE proc_update ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
+END WHILE;
+END|
+CALL proc_update();;
+SET SESSION wsrep_retry_autocommit = 0;
+have_successes
+1
+have_deadlocks
+1
+Got one of the listed errors
+DROP PROCEDURE proc_update;
+DROP TABLE t1, t2;
+CALL mtr.add_suppression("conflict state 3 after post commit");
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO t1 (f1) VALUES (1);
+CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
+CREATE PROCEDURE proc_update ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
+END WHILE;
+END|
+CALL proc_update();;
+SET SESSION wsrep_retry_autocommit = 0;
+Got one of the listed errors
+DROP PROCEDURE proc_update;
+DROP TABLE t1, t2;
+CALL mtr.add_suppression("conflict state 3 after post commit");
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO t1 (f1) VALUES (1);
+CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
+CREATE PROCEDURE proc_update ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
+END WHILE;
+END|
+CALL proc_update();;
+SET SESSION wsrep_retry_autocommit = 10000;
+Got one of the listed errors
+DROP PROCEDURE proc_update;
+DROP TABLE t1, t2;
+CALL mtr.add_suppression("conflict state 3 after post commit");
--- /dev/null
+CREATE TABLE t1 (i INT) ENGINE = InnoDB;
+INSERT INTO t1 (i) VALUES(1);
+CREATE TABLE t2 (i INT) ENGINE = InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE;
+i
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;;
+DELETE FROM t1 WHERE i = 1;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1, t2;
--- /dev/null
+create table t1 (i int primary key, j int) engine=innodb;
+create table t2 (i int primary key, j int) engine=innodb;
+insert into t1 values (1,0);
+insert into t2 values (2,0);
+set autocommit=off;
+start transaction;
+update t1 set j=1 where i=1;
+set autocommit=off;
+start transaction;
+begin;
+update t2 set j=1 where i=2;
+insert into t1 select * from t2;;
+insert into t2 select * from t1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+DROP TABLE t1, t2;
--- /dev/null
+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;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+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
+1
+DROP PROCEDURE proc_insert;
+DROP TABLE t1;
--- /dev/null
+SAVEPOINT in a stored function should be forbidden
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+SAVEPOINT s;
+RETURN 1;
+END|
+SELECT f1();
+f1()
+1
+DROP FUNCTION f1;
+ROLLBACK TO SAVEPOINT in a stored function should be forbidden
+CREATE FUNCTION f2 () RETURNS INT BEGIN
+ROLLBACK TO SAVEPOINT s;
+RETURN 1;
+END|
+BEGIN;
+SAVEPOINT s;
+SELECT f2();
+ERROR 42000: SAVEPOINT s does not exist
+COMMIT;
+DROP FUNCTION f2;
+BEGIN;
+SAVEPOINT S;
+ROLLBACK TO SAVEPOINT S;
+COMMIT;
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 values (110), (111), (112), (113), (114);
+Direct SAVEPOINT in a trigger should be forbidden
+CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+INSERT INTO t1 VALUES (1);
+DROP TRIGGER i1_t1;
+CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+INSERT INTO t1 VALUES (2);
+DROP TRIGGER i2_t1;
+INSERT INTO t1 VALUES (3);
+CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u1_t1;
+CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u2_t1;
+CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+SAVEPOINT in a compound statement in a trigger should be forbidden
+CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+SAVEPOINT s;
+END|
+INSERT INTO t1 VALUES (5);
+DROP TRIGGER i3_t1;
+SAVEPOINT in a PS call in a trigger should be forbidden
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+PREPARE set_savepoint FROM "SAVEPOINT s";
+EXECUTE set_savepoint;
+DEALLOCATE PREPARE set_savepoint;
+END|
+ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+SAVEPOINT in SP called from a trigger should be forbidden
+CREATE PROCEDURE p1() BEGIN
+SAVEPOINT s;
+END|
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+INSERT INTO t1 VALUES (6);
+DROP TRIGGER i5_t1;
+SAVEPOINT in a SP called from a PS called from a trigger be forbidden
+PREPARE call_p1 FROM "CALL p1";
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1;
+ERROR 0A000: Dynamic SQL is not allowed in stored function or trigger
+SAVEPOINT in a function called from a trigger should be forbidden
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+SAVEPOINT s;
+RETURN 1;
+END|
+CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1();
+INSERT INTO t1 VALUES (7);
+DROP TRIGGER i7_t1;
+SAVEPOINT in a SP called from a SP called from a trigger should be forbidden
+CREATE PROCEDURE p2() BEGIN
+CALL p1();
+END|
+CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2;
+INSERT INTO t1 VALUES (8);
+DROP TRIGGER i8_t1;
+SAVEPOINT in a SP called from a trigger called from a SP should be forbidden
+CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+CREATE PROCEDURE p3() BEGIN
+INSERT INTO t1 VALUES (9);
+END|
+CALL p3();
+DROP TRIGGER i9_t1;
+ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s;
+BEGIN;
+SAVEPOINT s;
+INSERT INTO t1 VALUES (5);
+ERROR 42000: SAVEPOINT s does not exist
+COMMIT;
+DROP TRIGGER i4_t1;
+ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden
+CREATE PROCEDURE p4() BEGIN
+ROLLBACK TO SAVEPOINT s;
+END|
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4;
+BEGIN;
+SAVEPOINT s;
+INSERT INTO t1 VALUES (6);
+ERROR 42000: SAVEPOINT s does not exist
+COMMIT;
+DROP TRIGGER i5_t1;
+SAVEPOINT in a SP next to a trigger should work
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1;
+CREATE PROCEDURE p5() BEGIN
+SAVEPOINT s;
+INSERT INTO t1 VALUES (10);
+ROLLBACK TO SAVEPOINT s;
+END|
+BEGIN;
+CALL p5();
+COMMIT;
+DROP TRIGGER i6_t1;
+create trigger t1 before insert on t1 for each row
+begin
+insert into t2 values (NULL);
+end|
+INSERT INTO t1 VALUES (201), (202), (203);
+SELECT * FROM t1;
+a
+5
+6
+7
+8
+9
+201
+202
+203
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+3
+SELECT * FROM t1;
+a
+5
+6
+7
+8
+9
+201
+202
+203
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+3
+DEALLOCATE PREPARE call_p1;
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP PROCEDURE p5;
+DROP FUNCTION f1;
--- /dev/null
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = OFF;
+SET SESSION wsrep_on = ON;
+CALL mtr.add_suppression("Failed to set packet size");
+CALL mtr.add_suppression("Failed to set packet size");
SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
COUNT(*) = 2
1
+ALTER USER user1 PASSWORD EXPIRE;
+SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
+password_expired = 'Y'
+1
+SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
+password_expired = 'Y'
+1
RENAME USER user2 TO user3;
SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
COUNT(*) = 0
--- /dev/null
+DROP TABLE IF EXISTS t1, t2;
+DROP TABLE IF EXISTS x1, x2;
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+# ANALYZE test
+ANALYZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+test.t2 analyze status OK
+# OPTIMIZE test
+OPTIMIZE TABLE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+test.t2 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t2 optimize status OK
+# REPAIR test
+REPAIR TABLE x1, x2;
+Table Op Msg_type Msg_text
+test.x1 repair status OK
+test.x2 repair status OK
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10 FROM x1;
+COUNT(*) = 10
+1
+SELECT COUNT(*) = 10000 FROM t2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10 FROM x2;
+COUNT(*) = 10
+1
+DROP TABLE t1, t2;
+DROP TABLE x1, x2;
+SET GLOBAL wsrep_replicate_myisam = FALSE;
--- /dev/null
+RESET MASTER;
+RESET MASTER;
+RESET MASTER;
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+CREATE SCHEMA test1;
+CREATE SCHEMA test2;
+USE test1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY,f2 CHAR(5) DEFAULT 'abc') ENGINE=InnoDB;
+USE test2;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY,f2 CHAR(5) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO test1.t1 (f1) VALUES (1);
+INSERT INTO test2.t1 (f1) VALUES (1);
+INSERT INTO test1.t1 (f1) VALUES (2);
+INSERT INTO test2.t1 (f1) VALUES (2);
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+UPDATE test2.t1 SET test2.t1.f2 = 'cde';
+UPDATE test1.t1, test2.t1 SET test1.t1.f2 = 'klm', test2.t1.f2 = 'xyz';
+DELETE test1.t1, test2.t1 FROM test1.t1 INNER JOIN test2.t1 WHERE test1.t1.f1 = test2.t1.f1 AND test1.t1.f1 = 3;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO test2.t1 (f1) VALUES (999);
+INSERT INTO test2.t1 (f1) VALUES (9999);
+COMMIT;
+START TRANSACTION;
+INSERT INTO test1.t1 (f1) VALUES (111);
+INSERT INTO test1.t1 (f1) VALUES (222);
+COMMIT;
+START TRANSACTION;
+INSERT INTO test1.t1 (f1) VALUES (333);
+INSERT INTO test2.t1 (f1) VALUES (99999);
+COMMIT;
+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= '<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'
+mysqld-bin.000001 342 Query 1 415 BEGIN
+mysqld-bin.000001 415 Query 1 489 COMMIT
+mysqld-bin.000001 489 Gtid 1 537 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
+mysqld-bin.000001 537 Query 1 692 use `test1`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY,f2 CHAR(5) DEFAULT 'abc') ENGINE=InnoDB
+mysqld-bin.000001 692 Gtid 1 740 SET @@SESSION.GTID_NEXT= '<effective_uuid>:4'
+mysqld-bin.000001 740 Query 1 813 BEGIN
+mysqld-bin.000001 813 Query 1 887 COMMIT
+mysqld-bin.000001 887 Gtid 1 935 SET @@SESSION.GTID_NEXT= '<effective_uuid>:5'
+mysqld-bin.000001 935 Query 1 998 BEGIN
+mysqld-bin.000001 998 Table_map 1 1047 table_id: ### (test1.t1)
+mysqld-bin.000001 1047 Write_rows 1 1091 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1091 Xid 1 1122 COMMIT /* xid=### */
+mysqld-bin.000001 1122 Gtid 1 1170 SET @@SESSION.GTID_NEXT= '<effective_uuid>:6'
+mysqld-bin.000001 1170 Query 1 1233 BEGIN
+mysqld-bin.000001 1233 Query 1 1297 COMMIT
+mysqld-bin.000001 1297 Gtid 1 1345 SET @@SESSION.GTID_NEXT= '<effective_uuid>:7'
+mysqld-bin.000001 1345 Query 1 1408 BEGIN
+mysqld-bin.000001 1408 Table_map 1 1457 table_id: ### (test1.t1)
+mysqld-bin.000001 1457 Write_rows 1 1501 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1501 Xid 1 1532 COMMIT /* xid=### */
+mysqld-bin.000001 1532 Gtid 1 1580 SET @@SESSION.GTID_NEXT= '<effective_uuid>:8'
+mysqld-bin.000001 1580 Query 1 1643 BEGIN
+mysqld-bin.000001 1643 Query 1 1707 COMMIT
+mysqld-bin.000001 1707 Gtid 1 1755 SET @@SESSION.GTID_NEXT= '<effective_uuid>:9'
+mysqld-bin.000001 1755 Query 1 1818 BEGIN
+mysqld-bin.000001 1818 Table_map 1 1867 table_id: ### (test1.t1)
+mysqld-bin.000001 1867 Write_rows 1 1911 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1911 Xid 1 1942 COMMIT /* xid=### */
+mysqld-bin.000001 1942 Gtid 1 1990 SET @@SESSION.GTID_NEXT= '<effective_uuid>:10'
+mysqld-bin.000001 1990 Query 1 2053 BEGIN
+mysqld-bin.000001 2053 Query 1 2117 COMMIT
+mysqld-bin.000001 2117 Gtid 1 2165 SET @@SESSION.GTID_NEXT= '<effective_uuid>:11'
+mysqld-bin.000001 2165 Query 1 2228 BEGIN
+mysqld-bin.000001 2228 Query 1 2292 COMMIT
+mysqld-bin.000001 2292 Gtid 1 2340 SET @@SESSION.GTID_NEXT= '<effective_uuid>:12'
+mysqld-bin.000001 2340 Query 1 2403 BEGIN
+mysqld-bin.000001 2403 Table_map 1 2452 table_id: ### (test1.t1)
+mysqld-bin.000001 2452 Update_rows 1 2542 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 2542 Xid 1 2573 COMMIT /* xid=### */
+mysqld-bin.000001 2573 Gtid 1 2621 SET @@SESSION.GTID_NEXT= '<effective_uuid>:13'
+mysqld-bin.000001 2621 Query 1 2684 BEGIN
+mysqld-bin.000001 2684 Table_map 1 2733 table_id: ### (test1.t1)
+mysqld-bin.000001 2733 Delete_rows 1 2777 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 2777 Xid 1 2808 COMMIT /* xid=### */
+mysqld-bin.000001 2808 Gtid 1 2856 SET @@SESSION.GTID_NEXT= '<effective_uuid>:14'
+mysqld-bin.000001 2856 Query 1 2919 BEGIN
+mysqld-bin.000001 2919 Query 1 2983 COMMIT
+mysqld-bin.000001 2983 Gtid 1 3031 SET @@SESSION.GTID_NEXT= '<effective_uuid>:15'
+mysqld-bin.000001 3031 Query 1 3094 BEGIN
+mysqld-bin.000001 3094 Table_map 1 3143 table_id: ### (test1.t1)
+mysqld-bin.000001 3143 Write_rows 1 3187 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3187 Table_map 1 3236 table_id: ### (test1.t1)
+mysqld-bin.000001 3236 Write_rows 1 3280 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3280 Xid 1 3311 COMMIT /* xid=### */
+mysqld-bin.000001 3311 Gtid 1 3359 SET @@SESSION.GTID_NEXT= '<effective_uuid>:16'
+mysqld-bin.000001 3359 Query 1 3422 BEGIN
+mysqld-bin.000001 3422 Table_map 1 3471 table_id: ### (test1.t1)
+mysqld-bin.000001 3471 Write_rows 1 3515 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3515 Xid 1 3546 COMMIT /* xid=### */
+gtid_executed_equal
+1
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000001 120 Previous_gtids 3 151
+mysqld-bin.000001 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= '<effective_uuid>:1'
+mysqld-bin.000001 199 Query 1 294 CREATE SCHEMA test1
+mysqld-bin.000001 294 Gtid 1 342 SET @@SESSION.GTID_NEXT= '<effective_uuid>:2'
+mysqld-bin.000001 342 Query 1 415 BEGIN
+mysqld-bin.000001 415 Query 1 489 COMMIT
+mysqld-bin.000001 489 Gtid 1 537 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
+mysqld-bin.000001 537 Query 1 692 use `test1`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY,f2 CHAR(5) DEFAULT 'abc') ENGINE=InnoDB
+mysqld-bin.000001 692 Gtid 1 740 SET @@SESSION.GTID_NEXT= '<effective_uuid>:4'
+mysqld-bin.000001 740 Query 1 813 BEGIN
+mysqld-bin.000001 813 Query 1 887 COMMIT
+mysqld-bin.000001 887 Gtid 1 935 SET @@SESSION.GTID_NEXT= '<effective_uuid>:5'
+mysqld-bin.000001 935 Query 1 998 BEGIN
+mysqld-bin.000001 998 Table_map 1 1047 table_id: ### (test1.t1)
+mysqld-bin.000001 1047 Write_rows 1 1091 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1091 Xid 1 1122 COMMIT /* xid=### */
+mysqld-bin.000001 1122 Gtid 1 1170 SET @@SESSION.GTID_NEXT= '<effective_uuid>:6'
+mysqld-bin.000001 1170 Query 1 1233 BEGIN
+mysqld-bin.000001 1233 Query 1 1297 COMMIT
+mysqld-bin.000001 1297 Gtid 1 1345 SET @@SESSION.GTID_NEXT= '<effective_uuid>:7'
+mysqld-bin.000001 1345 Query 1 1408 BEGIN
+mysqld-bin.000001 1408 Table_map 1 1457 table_id: ### (test1.t1)
+mysqld-bin.000001 1457 Write_rows 1 1501 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1501 Xid 1 1532 COMMIT /* xid=### */
+mysqld-bin.000001 1532 Gtid 1 1580 SET @@SESSION.GTID_NEXT= '<effective_uuid>:8'
+mysqld-bin.000001 1580 Query 1 1643 BEGIN
+mysqld-bin.000001 1643 Query 1 1707 COMMIT
+mysqld-bin.000001 1707 Gtid 1 1755 SET @@SESSION.GTID_NEXT= '<effective_uuid>:9'
+mysqld-bin.000001 1755 Query 1 1818 BEGIN
+mysqld-bin.000001 1818 Table_map 1 1867 table_id: ### (test1.t1)
+mysqld-bin.000001 1867 Write_rows 1 1911 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1911 Xid 1 1942 COMMIT /* xid=### */
+mysqld-bin.000001 1942 Gtid 1 1990 SET @@SESSION.GTID_NEXT= '<effective_uuid>:10'
+mysqld-bin.000001 1990 Query 1 2053 BEGIN
+mysqld-bin.000001 2053 Query 1 2117 COMMIT
+mysqld-bin.000001 2117 Gtid 1 2165 SET @@SESSION.GTID_NEXT= '<effective_uuid>:11'
+mysqld-bin.000001 2165 Query 1 2228 BEGIN
+mysqld-bin.000001 2228 Query 1 2292 COMMIT
+mysqld-bin.000001 2292 Gtid 1 2340 SET @@SESSION.GTID_NEXT= '<effective_uuid>:12'
+mysqld-bin.000001 2340 Query 1 2403 BEGIN
+mysqld-bin.000001 2403 Table_map 1 2452 table_id: ### (test1.t1)
+mysqld-bin.000001 2452 Update_rows 1 2542 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 2542 Xid 1 2573 COMMIT /* xid=### */
+mysqld-bin.000001 2573 Gtid 1 2621 SET @@SESSION.GTID_NEXT= '<effective_uuid>:13'
+mysqld-bin.000001 2621 Query 1 2684 BEGIN
+mysqld-bin.000001 2684 Table_map 1 2733 table_id: ### (test1.t1)
+mysqld-bin.000001 2733 Delete_rows 1 2777 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 2777 Xid 1 2808 COMMIT /* xid=### */
+mysqld-bin.000001 2808 Gtid 1 2856 SET @@SESSION.GTID_NEXT= '<effective_uuid>:14'
+mysqld-bin.000001 2856 Query 1 2919 BEGIN
+mysqld-bin.000001 2919 Query 1 2983 COMMIT
+mysqld-bin.000001 2983 Gtid 1 3031 SET @@SESSION.GTID_NEXT= '<effective_uuid>:15'
+mysqld-bin.000001 3031 Query 1 3094 BEGIN
+mysqld-bin.000001 3094 Table_map 1 3143 table_id: ### (test1.t1)
+mysqld-bin.000001 3143 Write_rows 1 3187 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3187 Table_map 1 3236 table_id: ### (test1.t1)
+mysqld-bin.000001 3236 Write_rows 1 3280 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3280 Xid 1 3311 COMMIT /* xid=### */
+mysqld-bin.000001 3311 Gtid 1 3359 SET @@SESSION.GTID_NEXT= '<effective_uuid>:16'
+mysqld-bin.000001 3359 Query 1 3422 BEGIN
+mysqld-bin.000001 3422 Table_map 1 3471 table_id: ### (test1.t1)
+mysqld-bin.000001 3471 Write_rows 1 3515 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3515 Xid 1 3546 COMMIT /* xid=### */
+include/diff_servers.inc [servers=2 3]
+SELECT COUNT(*) = 2 FROM test1.t1 WHERE f1 IN (1,2);
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 3 FROM test1.t1 WHERE f1 IN (111,222,333);
+COUNT(*) = 3
+1
+SELECT COUNT(*) = 2 FROM test1.t1 WHERE f2 = 'klm';
+COUNT(*) = 2
+1
+USE test2;
+ERROR 42000: Unknown database 'test2'
+DROP SCHEMA test1;
+DROP SCHEMA test2;
+STOP SLAVE;
+RESET SLAVE ALL;
--- /dev/null
+RESET MASTER;
+RESET MASTER;
+RESET MASTER;
+START SLAVE USER='root';
+Warnings:
+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
+CREATE SCHEMA test1;
+CREATE SCHEMA test2;
+USE test1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+USE test2;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO test1.t1 (f1) VALUES (1);
+INSERT INTO test2.t1 (f1) VALUES (1);
+INSERT INTO test1.t1 (f1) VALUES (2);
+INSERT INTO test2.t1 (f1) VALUES (2);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+SET SESSION wsrep_on=OFF;
+include/wait_for_slave_sql_error.inc [errno=1047]
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+INSERT INTO test1.t1 (f1) VALUES (5);
+INSERT INTO test2.t1 (f1) VALUES (5);
+SET SESSION wsrep_on=ON;
+INSERT INTO test1.t1 (f1) VALUES (6);
+INSERT INTO test2.t1 (f1) VALUES (6);
+START SLAVE;
+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= '<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'
+mysqld-bin.000001 342 Query 1 415 BEGIN
+mysqld-bin.000001 415 Query 1 489 COMMIT
+mysqld-bin.000001 489 Gtid 1 537 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
+mysqld-bin.000001 537 Query 1 655 use `test1`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 655 Gtid 1 703 SET @@SESSION.GTID_NEXT= '<effective_uuid>:4'
+mysqld-bin.000001 703 Query 1 776 BEGIN
+mysqld-bin.000001 776 Query 1 850 COMMIT
+mysqld-bin.000001 850 Gtid 1 898 SET @@SESSION.GTID_NEXT= '<effective_uuid>:5'
+mysqld-bin.000001 898 Query 1 961 BEGIN
+mysqld-bin.000001 961 Table_map 1 1007 table_id: ### (test1.t1)
+mysqld-bin.000001 1007 Write_rows 1 1047 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1047 Xid 1 1078 COMMIT /* xid=### */
+mysqld-bin.000001 1078 Gtid 1 1126 SET @@SESSION.GTID_NEXT= '<effective_uuid>:6'
+mysqld-bin.000001 1126 Query 1 1189 BEGIN
+mysqld-bin.000001 1189 Query 1 1253 COMMIT
+mysqld-bin.000001 1253 Gtid 1 1301 SET @@SESSION.GTID_NEXT= '<effective_uuid>:7'
+mysqld-bin.000001 1301 Query 1 1364 BEGIN
+mysqld-bin.000001 1364 Table_map 1 1410 table_id: ### (test1.t1)
+mysqld-bin.000001 1410 Write_rows 1 1450 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1450 Xid 1 1481 COMMIT /* xid=### */
+mysqld-bin.000001 1481 Gtid 1 1529 SET @@SESSION.GTID_NEXT= '<effective_uuid>:8'
+mysqld-bin.000001 1529 Query 1 1592 BEGIN
+mysqld-bin.000001 1592 Query 1 1656 COMMIT
+mysqld-bin.000001 1656 Gtid 1 1704 SET @@SESSION.GTID_NEXT= '<effective_uuid>:9'
+mysqld-bin.000001 1704 Query 1 1767 BEGIN
+mysqld-bin.000001 1767 Table_map 1 1813 table_id: ### (test1.t1)
+mysqld-bin.000001 1813 Write_rows 1 1853 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1853 Xid 1 1884 COMMIT /* xid=### */
+mysqld-bin.000001 1884 Gtid 1 1932 SET @@SESSION.GTID_NEXT= '<effective_uuid>:10'
+mysqld-bin.000001 1932 Query 1 1995 BEGIN
+mysqld-bin.000001 1995 Query 1 2059 COMMIT
+mysqld-bin.000001 2059 Gtid 1 2107 SET @@SESSION.GTID_NEXT= '<effective_uuid>:11'
+mysqld-bin.000001 2107 Query 1 2170 BEGIN
+mysqld-bin.000001 2170 Table_map 1 2216 table_id: ### (test1.t1)
+mysqld-bin.000001 2216 Write_rows 1 2256 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 2256 Xid 1 2287 COMMIT /* xid=### */
+mysqld-bin.000001 2287 Gtid 1 2335 SET @@SESSION.GTID_NEXT= '<effective_uuid>:12'
+mysqld-bin.000001 2335 Query 1 2398 BEGIN
+mysqld-bin.000001 2398 Query 1 2462 COMMIT
+mysqld-bin.000001 2462 Gtid 1 2510 SET @@SESSION.GTID_NEXT= '<effective_uuid>:13'
+mysqld-bin.000001 2510 Query 1 2573 BEGIN
+mysqld-bin.000001 2573 Table_map 1 2619 table_id: ### (test1.t1)
+mysqld-bin.000001 2619 Write_rows 1 2659 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 2659 Xid 1 2690 COMMIT /* xid=### */
+mysqld-bin.000001 2690 Gtid 1 2738 SET @@SESSION.GTID_NEXT= '<effective_uuid>:14'
+mysqld-bin.000001 2738 Query 1 2801 BEGIN
+mysqld-bin.000001 2801 Query 1 2865 COMMIT
+mysqld-bin.000001 2865 Gtid 1 2913 SET @@SESSION.GTID_NEXT= '<effective_uuid>:15'
+mysqld-bin.000001 2913 Query 1 2976 BEGIN
+mysqld-bin.000001 2976 Table_map 1 3022 table_id: ### (test1.t1)
+mysqld-bin.000001 3022 Write_rows 1 3062 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3062 Xid 1 3093 COMMIT /* xid=### */
+mysqld-bin.000001 3093 Gtid 1 3141 SET @@SESSION.GTID_NEXT= '<effective_uuid>:16'
+mysqld-bin.000001 3141 Query 1 3204 BEGIN
+mysqld-bin.000001 3204 Query 1 3268 COMMIT
+mysqld-bin.000001 3268 Gtid 1 3316 SET @@SESSION.GTID_NEXT= '<effective_uuid>:17'
+mysqld-bin.000001 3316 Query 1 3379 BEGIN
+mysqld-bin.000001 3379 Table_map 1 3425 table_id: ### (test1.t1)
+mysqld-bin.000001 3425 Write_rows 1 3465 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3465 Xid 1 3496 COMMIT /* xid=### */
+mysqld-bin.000001 3496 Gtid 1 3544 SET @@SESSION.GTID_NEXT= '<effective_uuid>:18'
+mysqld-bin.000001 3544 Query 1 3607 BEGIN
+mysqld-bin.000001 3607 Query 1 3671 COMMIT
+mysqld-bin.000001 3671 Gtid 1 3719 SET @@SESSION.GTID_NEXT= '<effective_uuid>:19'
+mysqld-bin.000001 3719 Query 1 3782 BEGIN
+mysqld-bin.000001 3782 Table_map 1 3828 table_id: ### (test1.t1)
+mysqld-bin.000001 3828 Write_rows 1 3868 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3868 Xid 1 3899 COMMIT /* xid=### */
+mysqld-bin.000001 3899 Gtid 1 3947 SET @@SESSION.GTID_NEXT= '<effective_uuid>:20'
+mysqld-bin.000001 3947 Query 1 4010 BEGIN
+mysqld-bin.000001 4010 Query 1 4074 COMMIT
+mysqld-bin.000001 4074 Gtid 1 4122 SET @@SESSION.GTID_NEXT= '<effective_uuid>:21'
+mysqld-bin.000001 4122 Query 1 4185 BEGIN
+mysqld-bin.000001 4185 Table_map 1 4231 table_id: ### (test1.t1)
+mysqld-bin.000001 4231 Write_rows 1 4271 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 4271 Xid 1 4302 COMMIT /* xid=### */
+mysqld-bin.000001 4302 Gtid 1 4350 SET @@SESSION.GTID_NEXT= '<effective_uuid>:22'
+mysqld-bin.000001 4350 Query 1 4413 BEGIN
+mysqld-bin.000001 4413 Query 1 4477 COMMIT
+mysqld-bin.000001 4477 Gtid 1 4525 SET @@SESSION.GTID_NEXT= '<effective_uuid>:23'
+mysqld-bin.000001 4525 Query 1 4588 BEGIN
+mysqld-bin.000001 4588 Table_map 1 4634 table_id: ### (test1.t1)
+mysqld-bin.000001 4634 Write_rows 1 4674 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 4674 Xid 1 4705 COMMIT /* xid=### */
+mysqld-bin.000001 4705 Gtid 1 4753 SET @@SESSION.GTID_NEXT= '<effective_uuid>:24'
+mysqld-bin.000001 4753 Query 1 4816 BEGIN
+mysqld-bin.000001 4816 Query 1 4880 COMMIT
+mysqld-bin.000001 4880 Gtid 1 4928 SET @@SESSION.GTID_NEXT= '<effective_uuid>:25'
+mysqld-bin.000001 4928 Query 1 4991 BEGIN
+mysqld-bin.000001 4991 Table_map 1 5037 table_id: ### (test1.t1)
+mysqld-bin.000001 5037 Write_rows 1 5077 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 5077 Xid 1 5108 COMMIT /* xid=### */
+mysqld-bin.000001 5108 Gtid 1 5156 SET @@SESSION.GTID_NEXT= '<effective_uuid>:26'
+mysqld-bin.000001 5156 Query 1 5219 BEGIN
+mysqld-bin.000001 5219 Query 1 5283 COMMIT
+mysqld-bin.000001 5283 Gtid 1 5331 SET @@SESSION.GTID_NEXT= '<effective_uuid>:27'
+mysqld-bin.000001 5331 Query 1 5394 BEGIN
+mysqld-bin.000001 5394 Table_map 1 5440 table_id: ### (test1.t1)
+mysqld-bin.000001 5440 Write_rows 1 5480 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 5480 Xid 1 5511 COMMIT /* xid=### */
+mysqld-bin.000001 5511 Gtid 1 5559 SET @@SESSION.GTID_NEXT= '<effective_uuid>:28'
+mysqld-bin.000001 5559 Query 1 5622 BEGIN
+mysqld-bin.000001 5622 Query 1 5686 COMMIT
+mysqld-bin.000001 5686 Gtid 1 5734 SET @@SESSION.GTID_NEXT= '<effective_uuid>:29'
+mysqld-bin.000001 5734 Query 1 5797 BEGIN
+mysqld-bin.000001 5797 Table_map 1 5843 table_id: ### (test1.t1)
+mysqld-bin.000001 5843 Write_rows 1 5883 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 5883 Xid 1 5914 COMMIT /* xid=### */
+mysqld-bin.000001 5914 Gtid 1 5962 SET @@SESSION.GTID_NEXT= '<effective_uuid>:30'
+mysqld-bin.000001 5962 Query 1 6025 BEGIN
+mysqld-bin.000001 6025 Query 1 6089 COMMIT
+USE test2;
+ERROR 42000: Unknown database 'test2'
+gtid_executed_equal
+1
+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 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'
+mysqld-bin.000001 342 Query 1 415 BEGIN
+mysqld-bin.000001 415 Query 1 489 COMMIT
+mysqld-bin.000001 489 Gtid 1 537 SET @@SESSION.GTID_NEXT= '<effective_uuid>:3'
+mysqld-bin.000001 537 Query 1 655 use `test1`; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB
+mysqld-bin.000001 655 Gtid 1 703 SET @@SESSION.GTID_NEXT= '<effective_uuid>:4'
+mysqld-bin.000001 703 Query 1 776 BEGIN
+mysqld-bin.000001 776 Query 1 850 COMMIT
+mysqld-bin.000001 850 Gtid 1 898 SET @@SESSION.GTID_NEXT= '<effective_uuid>:5'
+mysqld-bin.000001 898 Query 1 961 BEGIN
+mysqld-bin.000001 961 Table_map 1 1007 table_id: ### (test1.t1)
+mysqld-bin.000001 1007 Write_rows 1 1047 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1047 Xid 1 1078 COMMIT /* xid=### */
+mysqld-bin.000001 1078 Gtid 1 1126 SET @@SESSION.GTID_NEXT= '<effective_uuid>:6'
+mysqld-bin.000001 1126 Query 1 1189 BEGIN
+mysqld-bin.000001 1189 Query 1 1253 COMMIT
+mysqld-bin.000001 1253 Gtid 1 1301 SET @@SESSION.GTID_NEXT= '<effective_uuid>:7'
+mysqld-bin.000001 1301 Query 1 1364 BEGIN
+mysqld-bin.000001 1364 Table_map 1 1410 table_id: ### (test1.t1)
+mysqld-bin.000001 1410 Write_rows 1 1450 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1450 Xid 1 1481 COMMIT /* xid=### */
+mysqld-bin.000001 1481 Gtid 1 1529 SET @@SESSION.GTID_NEXT= '<effective_uuid>:8'
+mysqld-bin.000001 1529 Query 1 1592 BEGIN
+mysqld-bin.000001 1592 Query 1 1656 COMMIT
+mysqld-bin.000001 1656 Gtid 1 1704 SET @@SESSION.GTID_NEXT= '<effective_uuid>:9'
+mysqld-bin.000001 1704 Query 1 1767 BEGIN
+mysqld-bin.000001 1767 Table_map 1 1813 table_id: ### (test1.t1)
+mysqld-bin.000001 1813 Write_rows 1 1853 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 1853 Xid 1 1884 COMMIT /* xid=### */
+mysqld-bin.000001 1884 Gtid 1 1932 SET @@SESSION.GTID_NEXT= '<effective_uuid>:10'
+mysqld-bin.000001 1932 Query 1 1995 BEGIN
+mysqld-bin.000001 1995 Query 1 2059 COMMIT
+mysqld-bin.000001 2059 Gtid 1 2107 SET @@SESSION.GTID_NEXT= '<effective_uuid>:11'
+mysqld-bin.000001 2107 Query 1 2170 BEGIN
+mysqld-bin.000001 2170 Table_map 1 2216 table_id: ### (test1.t1)
+mysqld-bin.000001 2216 Write_rows 1 2256 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 2256 Xid 1 2287 COMMIT /* xid=### */
+mysqld-bin.000001 2287 Gtid 1 2335 SET @@SESSION.GTID_NEXT= '<effective_uuid>:12'
+mysqld-bin.000001 2335 Query 1 2398 BEGIN
+mysqld-bin.000001 2398 Query 1 2462 COMMIT
+mysqld-bin.000001 2462 Gtid 1 2510 SET @@SESSION.GTID_NEXT= '<effective_uuid>:13'
+mysqld-bin.000001 2510 Query 1 2573 BEGIN
+mysqld-bin.000001 2573 Table_map 1 2619 table_id: ### (test1.t1)
+mysqld-bin.000001 2619 Write_rows 1 2659 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 2659 Xid 1 2690 COMMIT /* xid=### */
+mysqld-bin.000001 2690 Gtid 1 2738 SET @@SESSION.GTID_NEXT= '<effective_uuid>:14'
+mysqld-bin.000001 2738 Query 1 2801 BEGIN
+mysqld-bin.000001 2801 Query 1 2865 COMMIT
+mysqld-bin.000001 2865 Gtid 1 2913 SET @@SESSION.GTID_NEXT= '<effective_uuid>:15'
+mysqld-bin.000001 2913 Query 1 2976 BEGIN
+mysqld-bin.000001 2976 Table_map 1 3022 table_id: ### (test1.t1)
+mysqld-bin.000001 3022 Write_rows 1 3062 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3062 Xid 1 3093 COMMIT /* xid=### */
+mysqld-bin.000001 3093 Gtid 1 3141 SET @@SESSION.GTID_NEXT= '<effective_uuid>:16'
+mysqld-bin.000001 3141 Query 1 3204 BEGIN
+mysqld-bin.000001 3204 Query 1 3268 COMMIT
+mysqld-bin.000001 3268 Gtid 1 3316 SET @@SESSION.GTID_NEXT= '<effective_uuid>:17'
+mysqld-bin.000001 3316 Query 1 3379 BEGIN
+mysqld-bin.000001 3379 Table_map 1 3425 table_id: ### (test1.t1)
+mysqld-bin.000001 3425 Write_rows 1 3465 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3465 Xid 1 3496 COMMIT /* xid=### */
+mysqld-bin.000001 3496 Gtid 1 3544 SET @@SESSION.GTID_NEXT= '<effective_uuid>:18'
+mysqld-bin.000001 3544 Query 1 3607 BEGIN
+mysqld-bin.000001 3607 Query 1 3671 COMMIT
+mysqld-bin.000001 3671 Gtid 1 3719 SET @@SESSION.GTID_NEXT= '<effective_uuid>:19'
+mysqld-bin.000001 3719 Query 1 3782 BEGIN
+mysqld-bin.000001 3782 Table_map 1 3828 table_id: ### (test1.t1)
+mysqld-bin.000001 3828 Write_rows 1 3868 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 3868 Xid 1 3899 COMMIT /* xid=### */
+mysqld-bin.000001 3899 Gtid 1 3947 SET @@SESSION.GTID_NEXT= '<effective_uuid>:20'
+mysqld-bin.000001 3947 Query 1 4010 BEGIN
+mysqld-bin.000001 4010 Query 1 4074 COMMIT
+mysqld-bin.000001 4074 Gtid 1 4122 SET @@SESSION.GTID_NEXT= '<effective_uuid>:21'
+mysqld-bin.000001 4122 Query 1 4185 BEGIN
+mysqld-bin.000001 4185 Table_map 1 4231 table_id: ### (test1.t1)
+mysqld-bin.000001 4231 Write_rows 1 4271 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 4271 Xid 1 4302 COMMIT /* xid=### */
+mysqld-bin.000001 4302 Gtid 1 4350 SET @@SESSION.GTID_NEXT= '<effective_uuid>:22'
+mysqld-bin.000001 4350 Query 1 4413 BEGIN
+mysqld-bin.000001 4413 Query 1 4477 COMMIT
+mysqld-bin.000001 4477 Gtid 1 4525 SET @@SESSION.GTID_NEXT= '<effective_uuid>:23'
+mysqld-bin.000001 4525 Query 1 4588 BEGIN
+mysqld-bin.000001 4588 Table_map 1 4634 table_id: ### (test1.t1)
+mysqld-bin.000001 4634 Write_rows 1 4674 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 4674 Xid 1 4705 COMMIT /* xid=### */
+mysqld-bin.000001 4705 Gtid 1 4753 SET @@SESSION.GTID_NEXT= '<effective_uuid>:24'
+mysqld-bin.000001 4753 Query 1 4816 BEGIN
+mysqld-bin.000001 4816 Query 1 4880 COMMIT
+mysqld-bin.000001 4880 Gtid 1 4928 SET @@SESSION.GTID_NEXT= '<effective_uuid>:25'
+mysqld-bin.000001 4928 Query 1 4991 BEGIN
+mysqld-bin.000001 4991 Table_map 1 5037 table_id: ### (test1.t1)
+mysqld-bin.000001 5037 Write_rows 1 5077 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 5077 Xid 1 5108 COMMIT /* xid=### */
+mysqld-bin.000001 5108 Gtid 1 5156 SET @@SESSION.GTID_NEXT= '<effective_uuid>:26'
+mysqld-bin.000001 5156 Query 1 5219 BEGIN
+mysqld-bin.000001 5219 Query 1 5283 COMMIT
+mysqld-bin.000001 5283 Gtid 1 5331 SET @@SESSION.GTID_NEXT= '<effective_uuid>:27'
+mysqld-bin.000001 5331 Query 1 5394 BEGIN
+mysqld-bin.000001 5394 Table_map 1 5440 table_id: ### (test1.t1)
+mysqld-bin.000001 5440 Write_rows 1 5480 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 5480 Xid 1 5511 COMMIT /* xid=### */
+mysqld-bin.000001 5511 Gtid 1 5559 SET @@SESSION.GTID_NEXT= '<effective_uuid>:28'
+mysqld-bin.000001 5559 Query 1 5622 BEGIN
+mysqld-bin.000001 5622 Query 1 5686 COMMIT
+mysqld-bin.000001 5686 Gtid 1 5734 SET @@SESSION.GTID_NEXT= '<effective_uuid>:29'
+mysqld-bin.000001 5734 Query 1 5797 BEGIN
+mysqld-bin.000001 5797 Table_map 1 5843 table_id: ### (test1.t1)
+mysqld-bin.000001 5843 Write_rows 1 5883 table_id: ### flags: STMT_END_F
+mysqld-bin.000001 5883 Xid 1 5914 COMMIT /* xid=### */
+mysqld-bin.000001 5914 Gtid 1 5962 SET @@SESSION.GTID_NEXT= '<effective_uuid>:30'
+mysqld-bin.000001 5962 Query 1 6025 BEGIN
+mysqld-bin.000001 6025 Query 1 6089 COMMIT
+DROP SCHEMA test1;
+DROP SCHEMA test2;
+STOP SLAVE;
+RESET SLAVE ALL;
+CALL mtr.add_suppression("GTID replication failed");
+CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed");
+CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
+CALL mtr.add_suppression("TO isolation failed for");
+CALL mtr.add_suppression("Slave SQL: Error 'Deadlock found when trying to get lock; try restarting transaction' on query");
+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");
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t1 VALUES (1);
-INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (1,'node_2');
+INSERT INTO t1 VALUES (1,'node_1');
+INSERT INTO t1 VALUES (2, 'node_2');
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
wsrep_local_aborts_increment
1
UNLOCK TABLES;
COMMIT;
SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
WSREP_FORCED_BINLOG_FORMAT NONE
WSREP_LOAD_DATA_SPLITTING ON
WSREP_LOG_CONFLICTS OFF
-WSREP_MAX_WS_ROWS 131072
-WSREP_MAX_WS_SIZE 1073741824
+WSREP_MAX_WS_ROWS 0
+WSREP_MAX_WS_SIZE 2147483647
WSREP_MYSQL_REPLICATION_BUNDLE 0
WSREP_NOTIFY_CMD
WSREP_ON ON
WSREP_SST_DONOR_REJECTS_QUERIES OFF
WSREP_SST_METHOD rsync
WSREP_SYNC_WAIT 7
-<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <RECV_Q_HARD_LIMIT>;gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2;
+<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_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
--- /dev/null
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+SET GLOBAL wsrep_desync = 1;
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 1
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2';
+INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+SET GLOBAL wsrep_desync = 1;
+Warnings:
+Warning 1231 'wsrep_desync' is already ON.
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 1
+SET DEBUG_SYNC='now WAIT_FOR alter1';
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2';
+INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+SET DEBUG_SYNC='RESET';
+SET GLOBAL wsrep_desync = 0;
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SET GLOBAL wsrep_desync = 0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+show status like 'wsrep_desync_count';
+Variable_name Value
+wsrep_desync_count 0
+SET GLOBAL wsrep_desync = 0;
+Warnings:
+Warning 1231 'wsrep_desync' is already OFF.
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1000
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1000
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE ten;
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
+INSERT INTO t1 VALUES (2);
+Killing server ...
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+INSERT INTO t1 VALUES (3);
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+include/diff_servers.inc [servers=1 2]
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [async IST sender starting to serve]
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
+DROP TABLE t1;
--- /dev/null
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+Killing server ...
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+include/diff_servers.inc [servers=1 2]
+DROP TABLE t1;
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [IST first seqno 2 not found from cache, falling back to SST]
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
--- /dev/null
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE PROCEDURE insert_simple ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f1, f2) VALUES (DEFAULT,'abcdef');
+END WHILE;
+END|
+CREATE PROCEDURE insert_multi ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f1) VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
+END WHILE;
+END|
+CREATE PROCEDURE insert_transaction ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+SET AUTOCOMMIT = OFF;
+WHILE 1 DO
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+INSERT INTO t1 (f1) VALUES (DEFAULT);
+COMMIT;
+END WHILE;
+END|
+CREATE PROCEDURE update_simple ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+UPDATE t1 SET f2 = CONCAT(f2,f2);
+END WHILE;
+END|
+CREATE PROCEDURE insert_1k ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024));
+END WHILE;
+END|
+CREATE PROCEDURE insert_1m ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024));
+END WHILE;
+END|
+CREATE PROCEDURE insert_10m ()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET SESSION wsrep_sync_wait = 0;
+WHILE 1 DO
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+END WHILE;
+END|
+CALL insert_simple();;
+CALL insert_multi();;
+CALL insert_transaction ();;
+CALL update_simple ();;
+CALL insert_1k ();;
+CALL insert_1m ();;
+CALL insert_10m ();;
+SET SESSION wsrep_sync_wait = 0;
+Killing server ...
+Killing server ...
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+ERROR HY000: Lost connection to MySQL server during query
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+Performing --wsrep-recover ...
+Using --wsrep-start-position when starting mysqld ...
+include/diff_servers.inc [servers=1 2]
+DROP TABLE t1;
+DROP TABLE ten;
+DROP PROCEDURE insert_simple;
+DROP PROCEDURE insert_multi;
+DROP PROCEDURE insert_transaction;
+DROP PROCEDURE update_simple;
+DROP PROCEDURE insert_1k;
+DROP PROCEDURE insert_1m;
+CALL mtr.add_suppression("conflict state 7 after post commit");
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [async IST sender starting to serve]
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
COUNT(*) = 2
1
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 2
-1
DROP TABLE t1;
-SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
-COUNT(*) = 1000
+SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
+COUNT(*) = 100
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
COMMIT;
CREATE TABLE sum_table (f1 INTEGER);
-SELECT SUM(f1) = 1000 FROM sum_table;
-SUM(f1) = 1000
+SELECT SUM(f1) = 100 FROM sum_table;
+SUM(f1) = 100
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
-UPDATE t1000 SET f1 = 3;
+UPDATE t100 SET f1 = 3;
COMMIT;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+include/diff_servers.inc [servers=1 2]
DROP SCHEMA test;
CREATE SCHEMA test;
CREATE TABLE t1 (id INT) ENGINE=InnoDB;
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
SET GLOBAL wsrep_slave_threads = 2;
+LOCK TABLE t1 WRITE;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+UNLOCK TABLES;
+SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 10 FROM t1;
COUNT(*) = 10
0
SELECT COUNT(*) = 10 FROM t2;
COUNT(*) = 10
0
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%';
-COUNT(*) = 2
-1
SET GLOBAL wsrep_slave_threads = 1;;
DROP TABLE t1;
DROP TABLE t2;
COUNT(*) = 0
1
DROP TABLE t1;
-CALL mtr.add_suppression("WSREP: Maximum writeset size exceeded by");
-CALL mtr.add_suppression("WSREP: transaction size exceeded");
+CALL mtr.add_suppression("Maximum writeset size exceeded by");
+CALL mtr.add_suppression("transaction size limit");
+CALL mtr.add_suppression("transaction size exceeded");
+CALL mtr.add_suppression("rbr write fail");
--- /dev/null
+CALL mtr.add_suppression("Aborting");
+CALL mtr.add_suppression("unknown option '--galera-unknown-option'");
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
+SELECT * FROM t1;
+f1 f2
+1 a
+2 a
+3 a
+Shutting down server ...
+UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 b
+3 c
+Starting server ...
+Starting server ...
+SELECT * FROM t1;
+f1 f2
+1 a
+2 b
+3 c
+Shutting down server ...
+UPDATE t1 SET f2 = 'd' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'd' WHERE f1 > 2;
+SELECT * FROM t1;
+f1 f2
+1 a
+2 d
+3 d
+Starting server ...
+Starting server ...
+SELECT * FROM t1;
+f1 f2
+1 a
+2 d
+3 d
+DROP TABLE t1;
Killing server ...
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
-SET GLOBAL wsrep_cluster_address = '';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
-VARIABLE_VALUE = 'Synced'
-1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
--- /dev/null
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE parent (
+id INT PRIMARY KEY,
+KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE child (
+id INT PRIMARY KEY AUTO_INCREMENT,
+parent_id INT
+) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1);
+INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE;;
+UPDATE parent SET id = 2 WHERE id = 1;;
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+COUNT(*) = 10000
+1
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+COUNT(*) = 10000
+1
+DROP TABLE child;
+DROP TABLE parent;
+DROP TABLE ten;
--- /dev/null
+CREATE DATABASE database1;
+USE database1;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+SET SESSION wsrep_retry_autocommit = 0;
+INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+USE database1;
+SET SESSION wsrep_retry_autocommit = 0;
+INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;;
+DROP DATABASE database1;;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+COUNT(*) = 0
+1
+USE database1;
+ERROR 42000: Unknown database 'database1'
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+COUNT(*) = 0
+1
+USE database1;
+ERROR 42000: Unknown database 'database1'
--- /dev/null
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET SESSION wsrep_retry_autocommit = 0;
+INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;;
+TRUNCATE TABLE t1;;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+DROP TABLE ten;
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
-SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-VARIABLE_VALUE = 'Primary'
-1
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 2
-1
-SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1';
-SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
-COUNT(*) > 0
-1
-SHOW STATUS LIKE 'wsrep_ready';
-Variable_name Value
-wsrep_ready OFF
-SHOW STATUS LIKE 'wsrep_cluster_status';
-Variable_name Value
-wsrep_cluster_status non-Primary
-SHOW STATUS LIKE 'wsrep_local_state';
-Variable_name Value
-wsrep_local_state 0
-SHOW STATUS LIKE 'wsrep_local_state_comment';
-Variable_name Value
-wsrep_local_state_comment Initialized
-SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
CALL mtr.add_suppression("gcs_caused\\(\\) returned -103 \\(Software caused connection abort\\)");
CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed to reach primary view: 110");
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
-CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'gcomm://192\\.0\\.2\\.1': -110 \\(Connection timed out\\)");
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
-CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
--- /dev/null
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+SET GLOBAL wsrep_max_ws_rows = 4;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+INSERT INTO t1 (f2) VALUES (5);
+ERROR HY000: wsrep_max_ws_rows exceeded
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+UPDATE t1 SET f2 = 10 WHERE f2 = 4;
+ERROR HY000: wsrep_max_ws_rows exceeded
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+DELETE FROM t1 WHERE f2 = 1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_max_ws_rows = 5;
+INSERT INTO t1 (f2) VALUES (1),(2),(3),(4),(5);
+SET GLOBAL wsrep_max_ws_rows = 4;
+UPDATE t1 SET f2 = f2 + 10;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+DELETE FROM t1 WHERE f2 < 10;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+INSERT INTO t1 (f2) SELECT * FROM ten;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+INSERT INTO t1 (f2) VALUES (10),(20),(30),(40),(50);
+ERROR HY000: wsrep_max_ws_rows exceeded
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+SET GLOBAL wsrep_max_ws_rows = 10;
+DELETE FROM t1 WHERE f2 < 10;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_max_ws_rows = 100;
+SELECT COUNT(*) = 100 FROM t1;
+COUNT(*) = 100
+1
+DELETE FROM t1 WHERE f2 < 101;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET GLOBAL wsrep_max_ws_rows = 9999;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SET GLOBAL wsrep_max_ws_rows = 10000;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SET GLOBAL wsrep_max_ws_rows = 9999;
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SET GLOBAL wsrep_max_ws_rows = 10000;
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+SET GLOBAL wsrep_max_ws_rows = 9999;
+DELETE FROM t1 WHERE f2 = 2;
+ERROR HY000: wsrep_max_ws_rows exceeded
+SET GLOBAL wsrep_max_ws_rows = 10000;
+DELETE FROM t1 WHERE f2 = 2;
+SELECT COUNT(*) = 0 FROM t1;
+COUNT(*) = 0
+1
+SET AUTOCOMMIT = ON;
+SET GLOBAL wsrep_max_ws_rows = 1;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+ERROR HY000: wsrep_max_ws_rows exceeded
+DROP TABLE t1;
+DROP TABLE ten;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+SELECT @@wsrep_max_ws_size = 10000;
+@@wsrep_max_ws_size = 10000
+1
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=20000';
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+SET GLOBAL wsrep_max_ws_size = 20000;
+provider_options_match
+1
DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f2 = SLEEP(5);
+SET SESSION wsrep_retry_autocommit = 0;
+INSERT INTO t1 (f1) VALUES (1),(2);;
+TRUNCATE TABLE t1;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SET SESSION wsrep_retry_autocommit = 1;
+INSERT INTO t1 (f1) VALUES (3),(4);;
+TRUNCATE TABLE t1;
+SELECT * FROM test.t1;
+f1 f2
+3 0
+4 0
+CREATE PROCEDURE repeated_truncate ()
+BEGIN
+DECLARE i INT;
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+SET i = 0;
+WHILE i <= 1000 DO
+TRUNCATE TABLE t1;
+SET i = i + 1;
+END WHILE;
+END|
+CALL repeated_truncate();
+SET SESSION wsrep_retry_autocommit = 1;
+INSERT INTO t1 (f1) VALUES (5),(6);
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+SET SESSION wsrep_retry_autocommit = 1024;
+INSERT INTO t1 (f1) VALUES (7),(8);;
+include/diff_servers.inc [servers=1 2]
+DROP TABLE t1;
+DROP PROCEDURE repeated_truncate;
--- /dev/null
+CREATE TABLE t1 (
+f1 VARCHAR(255) PRIMARY KEY
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES ('abc');
+SELECT f1 = 'abc' FROM t1;
+f1 = 'abc'
+1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'klm';
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'xyz';
+COMMIT;
+COMMIT;
+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+include/assert_grep.inc [cluster conflict due to high priority abort for threads]
+DROP TABLE t1;
--- /dev/null
+call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'");
+call mtr.add_suppression("WSREP\: Set options returned 7");
+SET GLOBAL wsrep_provider_options="gmcasts.segment=1";
+ERROR HY000: Incorrect arguments to SET
+Unhandled exceptions: 0
--- /dev/null
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+FLUSH TABLES t1 FOR EXPORT;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+UNLOCK TABLES;
+### t1 should have column f2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+FLUSH TABLE WITH READ LOCK;
+### This shouldn't block.
+FLUSH TABLES t1 FOR EXPORT;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+UNLOCK TABLES;
+### t1 should have column f2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES (2,3);
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+FLUSH TABLE WITH READ LOCK;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+FLUSH TABLES t1 WITH READ LOCK;;
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+FLUSH TABLES t1 WITH READ LOCK;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+UNLOCK TABLES;
+### t1 should have column f2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL,
+ `f2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+SELECT * from t1;
+id f2
+1 NULL
+2 3
+DROP TABLE t1;
--- /dev/null
+set GLOBAL wsrep_slave_threads=26;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+set GLOBAL wsrep_slave_threads=16;
+SET GLOBAL wsrep_provider='none';
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+set GLOBAL wsrep_slave_threads=5;
+SELECT COUNT(*) = 5 FROM t1;
+COUNT(*) = 5
+1
+set GLOBAL wsrep_slave_threads=12;
+SELECT COUNT(*) = 4 FROM t1;
+COUNT(*) = 4
+1
+INSERT INTO t1 VALUES (100), (101), (102);
+set GLOBAL wsrep_slave_threads=5;
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+show global variables like 'wsrep_slave_threads';
+Variable_name Value
+wsrep_slave_threads 5
+SET GLOBAL wsrep_slave_threads = 1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+16
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+15
+show global variables like 'wsrep_slave_threads';
+Variable_name Value
+wsrep_slave_threads 12
+SET GLOBAL wsrep_slave_threads = 1;
+DROP TABLE t1;
--- /dev/null
+# This tests proper desync counter cleanup when DONOR/DESYNC state is cleared.
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Make node 1 tolerate split-brain
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
+
+# Desync and disconnect node 2 from the PC:
+--connection node_2
+SET @@global.wsrep_desync = 1;
+SET SESSION wsrep_sync_wait=0;
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+# Wait until node 2 disappears from the PC:
+--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
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
+# Modify app state to force node 2 into PRIMARY upon reconnection.
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+
+# Reconnect node 2 to the PC:
+--connection node_2
+SET GLOBAL wsrep_provider_options = 'gmcast.isolate=0';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Must return 0:
+SHOW STATUS LIKE 'wsrep_desync_count';
+
+# Resync node_2, should pass:
+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;
+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.");
+
+--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
+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=false';
--- /dev/null
+#
+# GAL-419 safe_to_bootstrap: boostrap using wsrep_cluster_address=gcomm:// not prevented
+#
+
+--source include/galera_cluster.inc
+--source include/big_test.inc
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--sleep 2
+
+# Node #1 has wsrep_cluster_address=gcomm:// in my.cnf, so should fail to bootstrap
+
+--error 1
+--exec $MYSQLD --defaults-group-suffix=.1 --defaults-file=$MYSQLTEST_VARDIR/my.cnf | grep 'This node is not safe to bootstrap the cluster'
+
+# Unless we remove grastate.dat
+
+--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+
+--connection node_1
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.inc
+
+--connection node_2
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
--- /dev/null
+--source include/galera_cluster.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(10), f0 integer) ENGINE=InnoDB;
+
+FLUSH TABLE t1 FOR EXPORT;
+UNLOCK TABLES;
+
+ALTER TABLE t1 DROP COLUMN f1;
+
+SET SESSION wsrep_osu_method='RSU';
+ALTER TABLE t1 ADD COLUMN f1 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f1;
+ALTER TABLE t1 ADD COLUMN f2 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f2;
+ALTER TABLE t1 ADD COLUMN f3 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f3;
+ALTER TABLE t1 ADD COLUMN f4 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f4;
+ALTER TABLE t1 ADD COLUMN f5 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f5;
+ALTER TABLE t1 ADD COLUMN f6 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f6;
+ALTER TABLE t1 ADD COLUMN f7 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f7;
+ALTER TABLE t1 ADD COLUMN f8 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f8;
+ALTER TABLE t1 ADD COLUMN f9 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f9;
+ALTER TABLE t1 ADD COLUMN f10 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f10;
+ALTER TABLE t1 ADD COLUMN f11 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f11;
+ALTER TABLE t1 ADD COLUMN f12 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f12;
+ALTER TABLE t1 ADD COLUMN f13 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f13;
+ALTER TABLE t1 ADD COLUMN f14 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f14;
+ALTER TABLE t1 ADD COLUMN f15 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f15;
+ALTER TABLE t1 ADD COLUMN f16 CHAR(10);
+ALTER TABLE t1 DROP COLUMN f16;
+
+SET SESSION wsrep_osu_method='TOI';
+DROP TABLE t1;
--- /dev/null
+!include ../galera_2nodes_as_master.cnf
--- /dev/null
+#
+# MW-284 Slave I/O retry on ER_COM_UNKNOWN_ERROR
+#
+
+--source include/have_log_bin.inc
+--source include/galera_cluster.inc
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_CONNECT_RETRY=1;
+--enable_query_log
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+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;
+
+--connection node_3
+START SLAVE USER='root';
+--sleep 1
+--let $slave_param= Slave_IO_Running
+--let $slave_param_value= Connecting
+--source include/wait_for_slave_param.inc
+
+--connection node_1
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+# We expect the slave to reconnect and resume replication
+
+--connection node_3
+--source include/wait_for_slave_to_start.inc
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) > 0 FROM t1
+--source include/wait_condition.inc
+
+# Cleanup
+
+--connection node_1
+DROP TABLE t1;
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
+
+CALL mtr.add_suppression('failed registering on master');
--- /dev/null
+#
+# Broken FK constraints cause assertions
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE parent1 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+CREATE TABLE parent2 ( id INT PRIMARY KEY, KEY (id) ) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY,
+ parent1_id INT,
+ parent2_id INT,
+ FOREIGN KEY (parent1_id) REFERENCES parent1(id),
+ FOREIGN KEY (parent1_id) REFERENCES parent2(id)
+) ENGINE=InnoDB;
+
+INSERT INTO parent1 VALUES (1);
+INSERT INTO parent2 VALUES (1);
+INSERT INTO child VALUES (1,1,1);
+INSERT INTO child VALUES (2,1,1);
+
+SET foreign_key_checks=OFF;
+DROP TABLE parent1;
+
+UPDATE child SET parent1_id=2 WHERE id=1;
+
+DROP TABLE child;
+DROP TABLE parent2;
+SET foreign_key_checks=ON;
--- /dev/null
+#
+# MW-286 Spurious deadlock error after error with wsrep_desync and wsrep_on
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/big_test.inc
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
+
+# Insert some values before the ALTER
+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+# Insert more values while the ALTER is running
+--send INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_2
+SET GLOBAL wsrep_desync = TRUE;
+SET wsrep_on = FALSE;
+
+--error ER_QUERY_INTERRUPTED
+ALTER TABLE t1 ADD PRIMARY KEY (f1);
+
+SET wsrep_on = TRUE;
+SET GLOBAL wsrep_desync = FALSE;
+
+DROP TABLE t1;
+DROP TABLE ten;
--- /dev/null
+#
+# MW-292 Reset timestamp after transaction replay
+#
+# We force transaction replay to happen and then we check that NOW() is not stuck in time.
+# As a bonus we also check that RAND() continues to return random values after replay
+#
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source suite/galera/include/galera_have_debug_sync.inc
+
+--let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+
+CREATE TABLE rand_table (f1 FLOAT);
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a');
+INSERT INTO t1 VALUES (2, 'a');
+
+--connection node_1
+SET AUTOCOMMIT=ON;
+START TRANSACTION;
+
+UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE;
+
+# Block the commit
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--let $galera_sync_point = commit_monitor_enter_sync
+--source include/galera_set_sync_point.inc
+
+--connection node_1
+--send COMMIT;
+
+# Wait until commit is blocked
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--source include/galera_wait_sync_point.inc
+
+# Issue a conflicting update on node #2
+--connection node_2
+UPDATE t1 SET f2 = 'c' WHERE f1 = 2;
+
+# Wait for both transactions to be blocked
+--connection node_1a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'System lock';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'init' AND INFO = 'COMMIT';
+--source include/wait_condition.inc
+
+# Unblock the commit
+--connection node_1a
+--source include/galera_clear_sync_point.inc
+--source include/galera_signal_sync_point.inc
+
+# Commit succeeds via replay
+--connection node_1
+--reap
+
+# Confirm that NOW() is not stuck in time relative to SYSDATE();
+--sleep 3
+SELECT TIMEDIFF(SYSDATE(), NOW()) < 2;
+
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+INSERT INTO rand_table VALUES (RAND()),(RAND()),(RAND()),(RAND()),(RAND());
+
+SELECT COUNT(DISTINCT f1) = 10 FROM rand_table;
+
+# wsrep_local_replays has increased by 1
+--let $wsrep_local_replays_new = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'`
+--disable_query_log
+--eval SELECT $wsrep_local_replays_new - $wsrep_local_replays_old = 1 AS wsrep_local_replays;
+--enable_query_log
+
+--connection node_2
+DROP TABLE t1;
+DROP TABLE rand_table;
--- /dev/null
+#
+# MW-309 Regression: wsrep_max_ws_rows limit also applies to certain SELECT queries
+#
+
+--source include/galera_cluster.inc
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+
+SET GLOBAL wsrep_max_ws_rows = 2;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 GROUP BY f1;
+SELECT * FROM t1 GROUP BY f1;
+
+--error 0
+SELECT * FROM t1 GROUP BY f1;
+
+--disable_result_log
+--error 0
+SHOW STATUS LIKE '%wsrep%';
+--enable_result_log
+
+SET GLOBAL wsrep_max_ws_rows = 0;
+DROP TABLE t1;
--- /dev/null
+--log-bin --log-slave-updates
--- /dev/null
+#
+# MW-313 Enforce wsrep_max_ws_rows also when binlog is enabled
+#
+
+--source include/galera_cluster.inc
+--source include/have_binlog_format_row.inc
+
+# No error expected for SELECT and SHOW
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+
+SET GLOBAL wsrep_max_ws_rows = 2;
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 GROUP BY f1;
+SELECT * FROM t1 GROUP BY f1;
+
+--error 0
+SELECT * FROM t1 GROUP BY f1;
+
+--disable_result_log
+--error 0
+SHOW STATUS LIKE '%wsrep%';
+--enable_result_log
+
+# Error expected for DML
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 SELECT * FROM t1;
+
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES (1);
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f1) VALUES (2),(3),(4);
+
+ROLLBACK;
+START TRANSACTION;
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1;
+
+DROP TABLE t1;
+SET GLOBAL wsrep_max_ws_rows = 0;
--- /dev/null
+#
+# Cleanup for MW-328 tests
+#
+
+--connection node_1
+--disable_query_log
+--eval KILL CONNECTION $sp_connection_id
+--enable_query_log
+
+--connection node_1X
+--error 2013,1317
+--reap
+
+--connection node_1
+DROP PROCEDURE proc_update;
+DROP TABLE t1, t2;
+
+CALL mtr.add_suppression("conflict state 3 after post commit");
--- /dev/null
+#
+# Initialization for MW-328 tests
+#
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 CHAR(20) DEFAULT 'abc') ENGINE=InnoDB;
+INSERT INTO t1 (f1) VALUES (1);
+
+CREATE TABLE t2 (f1 CHAR(20)) ENGINE=InnoDB;
+
+#
+# Have some random updates going on against t1
+#
+
+DELIMITER |;
+CREATE PROCEDURE proc_update ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ UPDATE t1 SET f2 = LEFT(MD5(RAND()), 4);
+ END WHILE;
+END|
+
+DELIMITER ;|
+
+--connect node_1X, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1X
+--let $sp_connection_id = `SELECT CONNECTION_ID()`
+--send CALL proc_update();
--- /dev/null
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Attempt to insert into t2 and check if insert actually inserted rows if
+# a success was reported.
+#
+
+--source include/galera_cluster.inc
+--source suite/galera/t/MW-328-header.inc
+
+--connection node_2
+--let $count = 100
+--let $successes = 0
+--let $deadlocks = 0
+
+SET SESSION wsrep_retry_autocommit = 0;
+
+--disable_query_log
+
+while ($count)
+{
+ TRUNCATE TABLE t2;
+
+ --error 0,1213
+ INSERT IGNORE INTO t2 SELECT f2 FROM t1;
+ if ($mysql_errno != 1213) {
+ --inc $successes
+ if (`SELECT COUNT(*) = 0 FROM t2`) {
+ --die No rows arrived in table t2
+ }
+ }
+
+ if ($mysql_errno == 1213) {
+ --inc $deadlocks
+
+ }
+
+ --dec $count
+}
+
+--enable_query_log
+
+#
+# Check that the test produced both deadlocks and successes
+#
+
+--disable_query_log
+--eval SELECT $successes > 0 AS have_successes
+--eval SELECT $deadlocks > 0 AS have_deadlocks
+--enable_query_log
+
+
+--source suite/galera/t/MW-328-footer.inc
--- /dev/null
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Make sure an unrelated SELECT following a BF-aborted query never
+# gets the deadlock error
+#
+
+--source include/galera_cluster.inc
+--source suite/galera/t/MW-328-header.inc
+
+--connection node_2
+--let $count = 100
+
+SET SESSION wsrep_retry_autocommit = 0;
+
+--disable_query_log
+
+while ($count)
+{
+ --error 0,1213
+ INSERT IGNORE INTO t2 SELECT f2 FROM t1;
+
+ --disable_result_log
+ --error 0
+ SELECT 1 FROM DUAL;
+ --enable_result_log
+
+ --dec $count
+}
+
+--enable_query_log
+
+--source suite/galera/t/MW-328-footer.inc
--- /dev/null
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Make sure that a high value of wsrep_retry_autocommit
+# masks all deadlock errors
+#
+
+--source include/galera_cluster.inc
+--source suite/galera/t/MW-328-header.inc
+
+--connection node_2
+--let $count = 100
+
+SET SESSION wsrep_retry_autocommit = 10000;
+
+--disable_query_log
+
+while ($count)
+{
+ --error 0
+ INSERT IGNORE INTO t2 SELECT f2 FROM t1;
+
+ --disable_result_log
+ --error 0
+ SELECT 1 FROM DUAL;
+ --enable_result_log
+
+ --dec $count
+}
+
+--enable_query_log
+
+--source suite/galera/t/MW-328-footer.inc
--- /dev/null
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Test that non-Galera deadlock error still behaves as expected
+#
+
+--source include/galera_cluster.inc
+
+CREATE TABLE t1 (i INT) ENGINE = InnoDB;
+INSERT INTO t1 (i) VALUES(1);
+
+CREATE TABLE t2 (i INT) ENGINE = InnoDB;
+
+# Create a deadlock situation
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+SELECT * FROM t1 WHERE i = 1 LOCK IN SHARE MODE;
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+--send INSERT IGNORE INTO t2 SELECT * FROM t1 WHERE i = 1 FOR UPDATE;
+
+--connection node_1
+--sleep 2
+DELETE FROM t1 WHERE i = 1;
+COMMIT;
+
+# We expect that ER_LOCK_DEADLOCK will be delivered even though it was a INSERT INGORE statement
+--connection node_1a
+--error ER_LOCK_DEADLOCK
+--reap
+
+DROP TABLE t1, t2;
--- /dev/null
+#
+# MW-328 Fix unnecessary/silent BF aborts
+#
+
+#
+# Test that non-Galera deadlock error still behaves as expected (case #2)
+#
+
+--source include/galera_cluster.inc
+
+create table t1 (i int primary key, j int) engine=innodb;
+create table t2 (i int primary key, j int) engine=innodb;
+
+insert into t1 values (1,0);
+insert into t2 values (2,0);
+
+set autocommit=off;
+start transaction;
+update t1 set j=1 where i=1;
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1a
+set autocommit=off;
+start transaction;
+begin;
+update t2 set j=1 where i=2;
+
+--connection node_1
+# Hang expected here
+--send insert into t1 select * from t2;
+
+--sleep 2
+--connection node_1a
+--error ER_LOCK_DEADLOCK
+insert into t2 select * from t1;
+
+--connection node_1
+--reap
+
+DROP TABLE t1, t2;
--- /dev/null
+--wsrep-retry-autocommit=0
--- /dev/null
+#
+# #MW-329 Fix incorrect affected rows count after replay
+#
+
+--source include/galera_cluster.inc
+
+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
+#
+
+DELIMITER |;
+CREATE PROCEDURE proc_insert ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f1) VALUES (FLOOR( 1 + RAND( ) * 65535 ));
+ END WHILE;
+END|
+DELIMITER ;|
+
+--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connection node_1b
+--let $connection_id = `SELECT CONNECTION_ID()`
+--send CALL proc_insert();
+
+#
+# Run concurrent UPDATEs. We expect that each UPDATE will report that
+# some rows were matched and updated
+#
+
+--connection node_2
+--let $count = 10
+while ($count)
+{
+ --let $signature = `SELECT LEFT(MD5(RAND()), 10)`
+ --disable_query_log
+ --error 0,ER_LOCK_DEADLOCK
+ --eval UPDATE t1 SET f2 = '$signature'
+ --enable_query_log
+ --let $row_count = `SELECT ROW_COUNT()`
+ if (`SELECT @@error_count = 0`) {
+ if (`SELECT $row_count = 0`) {
+ --die ROW_COUNT() = 0
+ }
+ }
+ --dec $count
+}
+
+#
+# Confirm that some transaction replays occurred
+#
+
+SELECT VARIABLE_VALUE > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays';
+
+#
+# Terminate the stored procedure
+#
+
+--connection node_1
+--disable_query_log
+--eval KILL CONNECTION $connection_id
+--enable_query_log
+
+--connection node_1b
+--error 0,2013,1317
+--reap
+
+--connection node_1
+DROP PROCEDURE proc_insert;
+DROP TABLE t1;
--- /dev/null
+# Disable SAVEPOINT and ROLLBACK TO SAVEPOINT in SP, SF, TR.
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+
+--connection node_1
+--echo SAVEPOINT in a stored function should be forbidden
+--delimiter |
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+ SAVEPOINT s;
+ RETURN 1;
+END|
+--delimiter ;
+
+SELECT f1();
+
+DROP FUNCTION f1;
+
+--echo ROLLBACK TO SAVEPOINT in a stored function should be forbidden
+--delimiter |
+CREATE FUNCTION f2 () RETURNS INT BEGIN
+ ROLLBACK TO SAVEPOINT s;
+ RETURN 1;
+END|
+--delimiter ;
+
+BEGIN;
+SAVEPOINT s;
+--error ER_SP_DOES_NOT_EXIST
+SELECT f2();
+COMMIT;
+
+DROP FUNCTION f2;
+
+BEGIN;
+SAVEPOINT S;
+ROLLBACK TO SAVEPOINT S;
+COMMIT;
+
+
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 values (110), (111), (112), (113), (114);
+
+--echo Direct SAVEPOINT in a trigger should be forbidden
+--connection node_2
+CREATE TRIGGER i1_t1 BEFORE INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+DROP TRIGGER i1_t1;
+
+CREATE TRIGGER i2_t1 AFTER INSERT ON t1 FOR EACH ROW SAVEPOINT s;
+INSERT INTO t1 VALUES (2);
+DROP TRIGGER i2_t1;
+
+INSERT INTO t1 VALUES (3);
+CREATE TRIGGER u1_t1 BEFORE UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u1_t1;
+
+CREATE TRIGGER u2_t1 AFTER UPDATE ON t1 FOR EACH ROW SAVEPOINT s;
+UPDATE t1 SET a=4 WHERE a=3;
+DROP TRIGGER u2_t1;
+
+CREATE TRIGGER d1_t1 BEFORE DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+
+CREATE TRIGGER d1_t1 AFTER DELETE ON t1 FOR EACH ROW SAVEPOINT s;
+DELETE FROM t1;
+DROP TRIGGER d1_t1;
+
+--echo SAVEPOINT in a compound statement in a trigger should be forbidden
+--delimiter |
+CREATE TRIGGER i3_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+ SAVEPOINT s;
+END|
+--delimiter ;
+INSERT INTO t1 VALUES (5);
+DROP TRIGGER i3_t1;
+
+--echo SAVEPOINT in a PS call in a trigger should be forbidden
+# echo handled by SAVEPOINT forbidden in PS
+--delimiter |
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN
+ PREPARE set_savepoint FROM "SAVEPOINT s";
+ EXECUTE set_savepoint;
+ DEALLOCATE PREPARE set_savepoint;
+END|
+--delimiter ;
+
+--connection node_2
+--echo SAVEPOINT in SP called from a trigger should be forbidden
+--delimiter |
+CREATE PROCEDURE p1() BEGIN
+ SAVEPOINT s;
+END|
+--delimiter ;
+--connection node_1
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+INSERT INTO t1 VALUES (6);
+DROP TRIGGER i5_t1;
+
+--echo SAVEPOINT in a SP called from a PS called from a trigger be forbidden
+# echo handled by SAVEPOINT forbidden in PS
+PREPARE call_p1 FROM "CALL p1";
+--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW EXECUTE call_p1;
+
+--echo SAVEPOINT in a function called from a trigger should be forbidden
+--delimiter |
+CREATE FUNCTION f1 () RETURNS INT BEGIN
+ SAVEPOINT s;
+ RETURN 1;
+END|
+--delimiter ;
+CREATE TRIGGER i7_t1 BEFORE INSERT ON t1 FOR EACH ROW SET @foo = f1();
+INSERT INTO t1 VALUES (7);
+DROP TRIGGER i7_t1;
+
+--echo SAVEPOINT in a SP called from a SP called from a trigger should be forbidden
+--delimiter |
+CREATE PROCEDURE p2() BEGIN
+ CALL p1();
+END|
+--delimiter ;
+CREATE TRIGGER i8_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p2;
+INSERT INTO t1 VALUES (8);
+DROP TRIGGER i8_t1;
+
+--echo SAVEPOINT in a SP called from a trigger called from a SP should be forbidden
+CREATE TRIGGER i9_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p1;
+--delimiter |
+CREATE PROCEDURE p3() BEGIN
+ INSERT INTO t1 VALUES (9);
+END|
+--delimiter ;
+CALL p3();
+DROP TRIGGER i9_t1;
+
+--echo ROLLBACK TO SAVEPOINT in trigger as a trivial statement should be forbidden
+# Trigger activation creates a new savepoint level, making the earlier levels
+# inaccessible. Thus forbidding SAVEPOINT should be enough as then there is
+# no valid savepoint to pass to ROLLBACK TO SAVEPOINT, but we forbid it once
+# more just in case.
+CREATE TRIGGER i4_t1 BEFORE INSERT ON t1 FOR EACH ROW ROLLBACK TO SAVEPOINT s;
+BEGIN;
+SAVEPOINT s;
+--error ER_SP_DOES_NOT_EXIST
+INSERT INTO t1 VALUES (5);
+COMMIT;
+DROP TRIGGER i4_t1;
+
+--echo ROLLBACK TO SAVEPOINT in a trigger in a SP call should be forbidden
+--delimiter |
+CREATE PROCEDURE p4() BEGIN
+ ROLLBACK TO SAVEPOINT s;
+END|
+--delimiter ;
+CREATE TRIGGER i5_t1 BEFORE INSERT ON t1 FOR EACH ROW CALL p4;
+BEGIN;
+SAVEPOINT s;
+--error ER_SP_DOES_NOT_EXIST
+INSERT INTO t1 VALUES (6);
+COMMIT;
+DROP TRIGGER i5_t1;
+
+--echo SAVEPOINT in a SP next to a trigger should work
+CREATE TRIGGER i6_t1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.a = NEW.a + 1;
+--delimiter |
+CREATE PROCEDURE p5() BEGIN
+ SAVEPOINT s;
+ INSERT INTO t1 VALUES (10);
+ ROLLBACK TO SAVEPOINT s;
+END|
+--delimiter ;
+BEGIN;
+CALL p5();
+COMMIT;
+DROP TRIGGER i6_t1;
+
+--connection node_2
+delimiter |;
+create trigger t1 before insert on t1 for each row
+begin
+ insert into t2 values (NULL);
+end|
+delimiter ;|
+
+--connection node_1
+INSERT INTO t1 VALUES (201), (202), (203);
+
+--connection node_1
+SELECT * FROM t1;
+SELECT COUNT(*) FROM t2;
+
+--connection node_2
+SELECT * FROM t1;
+SELECT COUNT(*) FROM t2;
+
+--connection node_1
+DEALLOCATE PREPARE call_p1;
+
+--connection node_2
+DROP TABLE t1, t2;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP PROCEDURE p5;
+DROP FUNCTION f1;
--- /dev/null
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=2'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=2'
+
--- /dev/null
+#
+# codership/galera#414 Shutdown crashes node if the node started with `gcs.max_packet_size=2`
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+
+# We perform the shutdown/restart sequence in here. If there was a crash during shutdown, MTR will detect it
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+SET SESSION wsrep_sync_wait = 0;
+SET SESSION wsrep_on = OFF;
+--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
+--source include/start_mysqld.inc
+
+--connection node_1
+SET SESSION wsrep_on = ON;
+--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
+
+--connection node_1
+CALL mtr.add_suppression("Failed to set packet size");
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+--source include/wait_condition.inc
+CALL mtr.add_suppression("Failed to set packet size");
+
# ALTER USER
#
-# LP bug 1376269
-#
-#--connection node_1
-#ALTER USER user1 PASSWORD EXPIRE;
-#SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
-#
-#--connection node_2
-#SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
+--connection node_1
+ALTER USER user1 PASSWORD EXPIRE;
+SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
+
+--connection node_2
+SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1';
#
# RENAME USER
--- /dev/null
+#
+# Test that various admin commands from sql_admin.cc
+# Currently, REPAIR, OPTIMIZE and ANALYZE are tested.
+# Jira: PXC-390
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, t2;
+DROP TABLE IF EXISTS x1, x2;
+--enable_warnings
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER);
+CREATE TABLE t2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
+SET GLOBAL wsrep_replicate_myisam = TRUE;
+CREATE TABLE x1 (f1 INTEGER) ENGINE=MyISAM;
+CREATE TABLE x2 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO x1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+INSERT INTO t2 (f2) SELECT 1 FROM t1 AS a1, t1 AS a2, t1 AS a3, t1 AS a4;
+INSERT INTO x2 (f2) VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+
+# Wait until all the data from t2 has been replicated
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 10 FROM x1;
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 10 FROM x2;
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 10 FROM t1;
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 10000 FROM t2;
+--source include/wait_condition.inc
+
+
+--echo # ANALYZE test
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+ANALYZE TABLE t1, t2;
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
+
+
+--echo # OPTIMIZE test
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+OPTIMIZE TABLE t1, t2;
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
+
+
+--echo # REPAIR test
+--connection node_2
+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
+
+--connection node_1
+REPAIR TABLE x1, x2;
+
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_last_committed_before + 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'
+--source include/wait_condition.inc
+
+
+
+--connection node_2
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 FROM x1;
+SELECT COUNT(*) = 10000 FROM t2;
+SELECT COUNT(*) = 10 FROM x2;
+
+--connection node_1
+DROP TABLE t1, t2;
+DROP TABLE x1, x2;
+SET GLOBAL wsrep_replicate_myisam = FALSE;
--- /dev/null
+!include ../galera_2nodes_as_slave.cnf
+
+[mysqld]
+gtid-mode=ON
+log-bin=mysqld-bin
+log-slave-updates
+enforce-gtid-consistency
+binlog-format=ROW
+
+[mysqld.2]
+replicate-do-db=test1
+replicate-wild-do-table=test1.%
+
+[mysqld.3]
+replicate-do-db=test1
+replicate-wild-do-table=test1.%
--- /dev/null
+#
+# Test Galera as a slave to a MySQL master using GTIDs
+#
+
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_1
+RESET MASTER;
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+RESET MASTER;
+
+--connection node_2
+RESET MASTER;
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE USER='root';
+
+--connection node_1
+CREATE SCHEMA test1;
+CREATE SCHEMA test2;
+USE test1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY,f2 CHAR(5) DEFAULT 'abc') ENGINE=InnoDB;
+USE test2;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY,f2 CHAR(5) DEFAULT 'abc') ENGINE=InnoDB;
+
+#
+# First , some autocommit stuff
+#
+
+# Simple inserts
+
+INSERT INTO test1.t1 (f1) VALUES (1);
+INSERT INTO test2.t1 (f1) VALUES (1);
+
+INSERT INTO test1.t1 (f1) VALUES (2);
+INSERT INTO test2.t1 (f1) VALUES (2);
+
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+
+# Update that only covers test2.t1
+
+UPDATE test2.t1 SET test2.t1.f2 = 'cde';
+
+# Multi-table UPDATE
+
+UPDATE test1.t1, test2.t1 SET test1.t1.f2 = 'klm', test2.t1.f2 = 'xyz';
+
+# Multi-table DELETE
+
+DELETE test1.t1, test2.t1 FROM test1.t1 INNER JOIN test2.t1 WHERE test1.t1.f1 = test2.t1.f1 AND test1.t1.f1 = 3;
+
+#
+# Multi-statement transactions
+#
+
+# Transaction which is not replicated at all
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO test2.t1 (f1) VALUES (999);
+INSERT INTO test2.t1 (f1) VALUES (9999);
+COMMIT;
+
+# Transaction that is completely replicated
+START TRANSACTION;
+INSERT INTO test1.t1 (f1) VALUES (111);
+INSERT INTO test1.t1 (f1) VALUES (222);
+COMMIT;
+
+# Transaction that is partially replicated
+
+START TRANSACTION;
+INSERT INTO test1.t1 (f1) VALUES (333);
+INSERT INTO test2.t1 (f1) VALUES (99999);
+COMMIT;
+
+#
+# Make sure binary logs and gtid_executed strings are equal
+#
+
+--sleep 2
+--connection node_2
+--let $effective_uuid = `SELECT LEFT(@@global.gtid_executed, 36)`
+--let $gtid_executed_node2 = `SELECT @@global.gtid_executed;`
+
+--replace_result $effective_uuid <effective_uuid>
+--replace_regex /xid=[0-9]+/xid=###/ /table_id: [0-9]+/table_id: ###/
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+
+--connection node_3
+
+--disable_query_log
+--eval SELECT '$gtid_executed_node2' = @@global.gtid_executed AS gtid_executed_equal;
+--enable_query_log
+
+--replace_result $effective_uuid <effective_uuid>
+--replace_regex /xid=[0-9]+/xid=###/ /table_id: [0-9]+/table_id: ###/
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+
+#
+# Final consistency checks
+#
+
+--let $diff_servers = 2 3
+--source include/diff_servers.inc
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+SELECT COUNT(*) = 2 FROM test1.t1 WHERE f1 IN (1,2);
+SELECT COUNT(*) = 3 FROM test1.t1 WHERE f1 IN (111,222,333);
+SELECT COUNT(*) = 2 FROM test1.t1 WHERE f2 = 'klm';
+
+--error 1049
+USE test2;
+
+#
+# Cleanup
+#
+
+--connection node_1
+DROP SCHEMA test1;
+DROP SCHEMA test2;
+
+--sleep 1
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+STOP SLAVE;
+RESET SLAVE ALL;
--- /dev/null
+!include ../galera_3nodes_as_slave.cnf
+
+[mysqld]
+gtid-mode=ON
+log-bin=mysqld-bin
+log-slave-updates
+enforce-gtid-consistency
+binlog-format=ROW
+
+[mysqld.2]
+replicate-do-db=test1
+replicate-wild-do-table=test1.%
+
+[mysqld.3]
+replicate-do-db=test1
+replicate-wild-do-table=test1.%
--- /dev/null
+#
+# Test the case where a Galera slave to async replication goes non-prim while
+# a stream of replication events including filtered events is arriving
+#
+
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+--source include/big_test.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_1
+RESET MASTER;
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+RESET MASTER;
+
+--connection node_2
+RESET MASTER;
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE USER='root';
+
+--connection node_1
+CREATE SCHEMA test1;
+CREATE SCHEMA test2;
+USE test1;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+USE test2;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+INSERT INTO test1.t1 (f1) VALUES (1);
+INSERT INTO test2.t1 (f1) VALUES (1);
+
+INSERT INTO test1.t1 (f1) VALUES (2);
+INSERT INTO test2.t1 (f1) VALUES (2);
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 2 FROM test1.t1;
+--source include/wait_condition.inc
+
+SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+--connection node_1
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+INSERT INTO test1.t1 (f1) VALUES (3);
+INSERT INTO test2.t1 (f1) VALUES (3);
+
+--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
+
+--let $slave_sql_errno = 1047
+--source include/wait_for_slave_sql_error.inc
+
+--connection node_1
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+INSERT INTO test1.t1 (f1) VALUES (4);
+INSERT INTO test2.t1 (f1) VALUES (4);
+
+--connection node_2
+SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+--connection node_1
+INSERT INTO test1.t1 (f1) VALUES (5);
+INSERT INTO test2.t1 (f1) VALUES (5);
+
+--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
+SET SESSION wsrep_on=ON;
+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_ready';
+--source include/wait_condition.inc
+
+--connection node_1
+INSERT INTO test1.t1 (f1) VALUES (6);
+INSERT INTO test2.t1 (f1) VALUES (6);
+
+--connection node_2
+START SLAVE;
+
+#
+# Consistency checks
+#
+
+--sleep 2
+--connection node_2
+--let $wait_condition = SELECT COUNT(DISTINCT f1) = 6 FROM test1.t1;
+--source include/wait_condition.inc
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(DISTINCT f1) = 6 FROM test1.t1;
+--source include/wait_condition.inc
+
+--connection node_2
+--let $gtid_executed_node2 = `SELECT @@global.gtid_executed;`
+--let $effective_uuid = `SELECT LEFT(@@global.gtid_executed, 36)`
+
+--replace_result $effective_uuid <effective_uuid>
+--replace_regex /xid=[0-9]+/xid=###/ /table_id: [0-9]+/table_id: ###/
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+
+--error 1049
+USE test2;
+
+--connection node_3
+
+--disable_query_log
+--eval SELECT '$gtid_executed_node2' = @@global.gtid_executed AS gtid_executed_equal;
+--enable_query_log
+
+--error 1049
+USE test2;
+
+--replace_result $effective_uuid <effective_uuid>
+--replace_regex /xid=[0-9]+/xid=###/ /table_id: [0-9]+/table_id: ###/
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+
+#
+# Cleanup
+#
+
+--connection node_1
+DROP SCHEMA test1;
+DROP SCHEMA test2;
+
+--sleep 1
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--connection node_2
+STOP SLAVE;
+RESET SLAVE ALL;
+CALL mtr.add_suppression("GTID replication failed");
+CALL mtr.add_suppression("Slave SQL: Error in Xid_log_event: Commit could not be completed");
+CALL mtr.add_suppression("Slave SQL: Node has dropped from cluster, Error_code: 1047");
+CALL mtr.add_suppression("TO isolation failed for");
+CALL mtr.add_suppression("Slave SQL: Error 'Deadlock found when trying to get lock; try restarting transaction' on query");
+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");
!include ../galera_2nodes.cnf
[mysqld]
-#wsrep_sst_method=xtrabackup-v2
-#wsrep_sst_auth="root:"
-#wsrep_debug=ON
+wsrep_sst_method=xtrabackup-v2
+wsrep_sst_auth="root:"
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
#
# Test that autoincrement works correctly while the cluster membership
-# is changing and IST takes place.
+# is changing and SST takes place.
#
--source include/big_test.inc
# Test a local transaction being aborted by a slave one
#
-CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(6)) ENGINE=InnoDB;
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--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,'node_2');
--connection node_1
-INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (1,'node_1');
+
+--connection node_2a
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'node_1'
+--source include/wait_condition.inc
--connection node_2
--error ER_LOCK_DEADLOCK
-INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (2, 'node_2');
--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'`
COMMIT;
SET AUTOCOMMIT=ON;
+SET SESSION wsrep_sync_wait = 7;
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'`
--- /dev/null
+#
+# Test for overlapped transactions under manual desync.
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+
+CREATE TABLE ten (f1 INTEGER);
+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t1 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+CREATE TABLE t2 (f1 INTEGER, PRIMARY KEY (f1)) Engine=InnoDB;
+
+SET GLOBAL wsrep_desync = 1;
+show status like 'wsrep_desync_count';
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter1 WAIT_FOR alter2';
+send INSERT INTO t1 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+
+--connection node_1a
+
+SET GLOBAL wsrep_desync = 1;
+show status like 'wsrep_desync_count';
+SET DEBUG_SYNC='now WAIT_FOR alter1';
+SET DEBUG_SYNC='before_execute_sql_command SIGNAL alter2';
+send INSERT INTO t2 (f1) SELECT 0000 + (100 * a1.f1) + (10 * a2.f1) + a3.f1 FROM ten AS a1, ten AS a2, ten AS a3;
+
+--connection node_1
+reap;
+
+--connection node_1a
+reap;
+
+--connection node_1
+
+SET DEBUG_SYNC='RESET';
+
+SET GLOBAL wsrep_desync = 0;
+show status like 'wsrep_desync_count';
+SET GLOBAL wsrep_desync = 0;
+show status like 'wsrep_desync_count';
+
+--disable_query_log
+call mtr.add_suppression("Trying to make wsrep_desync = OFF on the node that is already synchronized.");
+--enable_query_log
+show status like 'wsrep_desync_count';
+SET GLOBAL wsrep_desync = 0;
+
+SELECT COUNT(*) FROM t1;
+SELECT COUNT(*) FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE ten;
---query_cache_type=1 --query_cache_size=1000000 --innodb_track_changed_pages=1 --userstat=1 --thread_statistics=1
+--query_cache_type=1 --query_cache_size=1000000
--- /dev/null
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true'
--- /dev/null
+#
+# Kill entire cluster while gcache.recover=yes. Expect that node #2 will rejoin using IST
+#
+
+--source include/galera_cluster.inc
+--source include/big_test.inc
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+SET SESSION wsrep_sync_wait = 0;
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) > 0 FROM t1;
+--source include/wait_condition.inc
+
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+INSERT INTO t1 VALUES (2);
+
+--source include/kill_galera.inc
+
+--sleep 1
+
+--connection node_1
+--let $galera_wsrep_recover_server_id=1
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+--connection node_1
+# Warning happens when the cluster is started for the first time
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that IST took place
+--let $assert_text = async IST sender starting to serve
+--let $assert_select = async IST sender starting to serve
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
+
+--connection node_2
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that gcache recovery took place
+
+--let $assert_text = Recovering GCache ring buffer: found gapless sequence
+--let $assert_select = Recovering GCache ring buffer: found gapless sequence
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
+
+DROP TABLE t1;
--- /dev/null
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+max_allowed_packet=10M
+innodb_log_file_size=110M
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;gcache.size=10M'
--- /dev/null
+#
+# Attempt gcache recovery on a full gcache. Node will not be able to join via IST due to gcache rollover
+#
+
+--source include/galera_cluster.inc
+--source include/big_test.inc
+
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--connection node_1
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+--source include/kill_galera.inc
+
+--connection node_1
+--let $galera_wsrep_recover_server_id=1
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name = $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+--connection node_2
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+--connection node_1
+DROP TABLE t1;
+
+# Warning always happens when the cluster is started for the first time
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that IST did not take place
+--let $assert_text = IST first seqno 2 not found from cache, falling back to SST
+--let $assert_select = IST first seqno 2 not found from cache, falling back to SST
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
+
+--connection node_2
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
--- /dev/null
+!include ../galera_2nodes.cnf
+
+[mysqld.1]
+innodb_log_file_size=110M
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'
+
+[mysqld.2]
+innodb_log_file_size=110M
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.recover=yes;pc.ignore_sb=true;'
--- /dev/null
+#
+# Kill entire cluster while various transactions are in progress
+# restore the cluster and expect that node #2 will rejoin using IST
+#
+
+--source include/galera_cluster.inc
+--source include/big_test.inc
+
+SET SESSION wsrep_sync_wait = 0;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 LONGBLOB) ENGINE=InnoDB;
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+DELIMITER |;
+CREATE PROCEDURE insert_simple ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f1, f2) VALUES (DEFAULT,'abcdef');
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_multi ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f1) VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_transaction ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ SET AUTOCOMMIT = OFF;
+ WHILE 1 DO
+ START TRANSACTION;
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ INSERT INTO t1 (f1) VALUES (DEFAULT);
+ COMMIT;
+ END WHILE;
+END|
+
+DELIMITER ;|
+DELIMITER |;
+
+CREATE PROCEDURE update_simple ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ UPDATE t1 SET f2 = CONCAT(f2,f2);
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_1k ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024));
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_1m ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024));
+ END WHILE;
+END|
+
+CREATE PROCEDURE insert_10m ()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+ SET SESSION wsrep_sync_wait = 0;
+ WHILE 1 DO
+ INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
+ END WHILE;
+END|
+
+DELIMITER ;|
+
+--connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_update_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_1k, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_1m, 127.0.0.1, root, , test, $NODE_MYPORT_1
+--connect node_1_insert_10m, 127.0.0.1, root, , test, $NODE_MYPORT_1
+
+--connection node_1_insert_simple
+--send CALL insert_simple();
+
+--connection node_1_insert_multi
+--send CALL insert_multi();
+
+--connection node_1_insert_transaction
+--send CALL insert_transaction ();
+
+--connection node_1_update_simple
+--send CALL update_simple ();
+
+--connection node_1_insert_1k
+--send CALL insert_1k ();
+
+--connection node_1_insert_1m
+--send CALL insert_1m ();
+
+--connection node_1_insert_10m
+--send CALL insert_10m ();
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+--source include/kill_galera.inc
+
+--sleep 10
+--connection node_1
+--source include/kill_galera.inc
+
+--connection node_1_insert_simple
+--error 2013
+--reap
+
+--connection node_1_insert_multi
+--error 2013
+--reap
+
+--connection node_1_insert_transaction
+--error 2013
+--reap
+
+--connection node_1_update_simple
+--error 2013
+--reap
+
+--connection node_1_insert_1k
+--error 2013
+--reap
+
+--connection node_1_insert_1m
+--error 2013
+--reap
+
+--connection node_1_insert_10m
+--error 2013
+--reap
+
+--connection node_1
+--let $galera_wsrep_recover_server_id=1
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name = $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+--connection node_2
+--let $galera_wsrep_recover_server_id=2
+--source suite/galera/include/galera_wsrep_recover.inc
+
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+--connection node_1
+DROP TABLE t1;
+DROP TABLE ten;
+DROP PROCEDURE insert_simple;
+DROP PROCEDURE insert_multi;
+DROP PROCEDURE insert_transaction;
+DROP PROCEDURE update_simple;
+DROP PROCEDURE insert_1k;
+DROP PROCEDURE insert_1m;
+
+--connection node_1
+CALL mtr.add_suppression("conflict state 7 after post commit");
+
+# Warning happens when the cluster is started for the first time
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that IST took place
+--let $assert_text = async IST sender starting to serve
+--let $assert_select = async IST sender starting to serve
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.1.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
+
+--connection node_2
+CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
+
+# Confirm that gcache recovery took place
+
+--let $assert_text = Recovering GCache ring buffer: found gapless sequence
+--let $assert_select = Recovering GCache ring buffer: found gapless sequence
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = starting as process
+--source include/assert_grep.inc
--source include/galera_connect.inc
--connection node_2a
+--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 = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1
--disable_query_log
--source include/have_innodb.inc
#
-# This test forces 1K tables with a PK to participate in a single transaction
+# This test forces 100 tables with a PK to participate in a single transaction
#
#
-# First, create 1K tables and make sure the DDLs are all propagated
+# First, create 100 tables and make sure the DDLs are all propagated
#
--connection node_1
---let $count = 1000
+--let $count = 100
while ($count)
{
--disable_query_log
}
--connection node_2
-SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
+SELECT COUNT(*) = 100 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
#
# Second, create a transaction that uses all those tables
SET AUTOCOMMIT=OFF;
START TRANSACTION;
---let $count = 1000
+--let $count = 100
while ($count)
{
--disable_query_log
--connection node_2
CREATE TABLE sum_table (f1 INTEGER);
---let $count = 1000
+--let $count = 100
while ($count)
{
--disable_query_log
--dec $count
}
-SELECT SUM(f1) = 1000 FROM sum_table;
+SELECT SUM(f1) = 100 FROM sum_table;
#
# Fourth, create a deadlock
SET AUTOCOMMIT=OFF;
START TRANSACTION;
---let $count = 1000
+--let $count = 100
while ($count)
{
--disable_query_log
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
-UPDATE t1000 SET f1 = 3;
+UPDATE t100 SET f1 = 3;
--connection node_1
COMMIT;
--error ER_LOCK_DEADLOCK
COMMIT;
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
DROP SCHEMA test;
CREATE SCHEMA test;
--connection node_2
SET GLOBAL wsrep_slave_threads = 2;
+LOCK TABLE t1 WRITE;
--connection node_1
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'applied write set%';
+--source include/wait_condition.inc
+
+UNLOCK TABLES;
+
+SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 10 FROM t1;
SELECT COUNT(*) = 10 FROM t2;
-SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%';
--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig;
DROP TABLE t1;
-CALL mtr.add_suppression("WSREP: Maximum writeset size exceeded by");
-CALL mtr.add_suppression("WSREP: transaction size exceeded");
+CALL mtr.add_suppression("Maximum writeset size exceeded by");
+CALL mtr.add_suppression("transaction size limit");
+CALL mtr.add_suppression("transaction size exceeded");
+CALL mtr.add_suppression("rbr write fail");
--connection node_2
--source include/restart_mysqld.inc
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
--let $galera_connection_name = node_2a
--let $galera_server_number = 2
--source include/galera_connect.inc
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Suppress expected warnings:
+
+CALL mtr.add_suppression("Aborting");
+CALL mtr.add_suppression("unknown option '--galera-unknown-option'");
+
+#
+# We should count the number of "Assertion failed" warnings
+# in the log file before and after testing. To do this we need
+# to save original log file before testing:
+#
+--let TEST_LOG=$MYSQLTEST_VARDIR/log/mysqld.2.err
+--perl
+ use strict;
+ my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
+ my $test_log_copy=$test_log . '.copy';
+ if (-e $test_log_copy) {
+ unlink $test_log_copy;
+ }
+EOF
+--copy_file $TEST_LOG $TEST_LOG.copy
+
+--connection node_2
+
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a');
+
+SELECT * FROM t1;
+
+# Initiate normal shutdown on the node 2 and
+# waiting until shutdown has been completed:
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Some updates on node 1:
+
+UPDATE t1 SET f2 = 'b' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'c' WHERE f1 > 2;
+
+SELECT * FROM t1;
+
+# Remove the "grastate.dat" file (to initiate new SST)
+# and restart node 2 with unknown option:
+
+--connection node_2
+
+--remove_file $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+
+--let $start_mysqld_params=--galera-unknown-option
+
+--echo Starting server ...
+--exec echo "try:$start_mysqld_params" > $_expect_file_name
+
+# Sleep to ensure that server exited...
+
+--sleep 30
+
+# Restart node 2 without unknown option:
+
+--let $start_mysqld_params=
+
+--echo Starting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Sanity check (node 2 is running now and can perform SQL operators):
+
+SELECT * FROM t1;
+
+# Initiate normal shutdown on the node 2 and
+# waiting until shutdown has been completed:
+
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Some updates on node 1 - to initiate IST next time:
+
+UPDATE t1 SET f2 = 'd' WHERE f1 > 1;
+UPDATE t1 SET f2 = 'd' WHERE f1 > 2;
+
+SELECT * FROM t1;
+
+# Restart node 2 with unknown option:
+
+--connection node_2
+
+--let $start_mysqld_params=--galera-unknown-option
+
+--echo Starting server ...
+--exec echo "try:$start_mysqld_params" > $_expect_file_name
+
+# Sleep to ensure that server exited...
+
+--sleep 30
+
+# Restart node 2 without unknown option:
+
+--let $start_mysqld_params=
+
+--echo Starting server ...
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+
+# Sanity check (node 2 is running now and can perform SQL operators):
+
+SELECT * FROM t1;
+
+--connection node_1
+
+DROP TABLE t1;
+
+#
+# We should count the number of "Assertion failed" warnings
+# in the log file during test phase - to print the error message
+# if quantity of such warnings in log file increased at the end
+# of the test:
+#
+--perl
+ use strict;
+ my $test_log=$ENV{'TEST_LOG'} or die "TEST_LOG not set";
+ my $test_log_copy=$test_log . '.copy';
+ open(FILE, $test_log_copy) or die("Unable to open $test_log_copy: $!\n");
+ my $initial=grep(/Assertion * failed/gi,<FILE>);
+ close(FILE);
+ open(FILE, $test_log) or die("Unable to open $test_log: $!\n");
+ my $count_warnings=grep(/Assertion * failed/gi,<FILE>);
+ close(FILE);
+ if ($count_warnings != $initial) {
+ my $diff=$count_warnings-$initial;
+ print "Assertion failed $diff times.\n";
+ }
+EOF
+--remove_file $TEST_LOG.copy
# Reset the master and restart the slave so that post-test checks can run
-SET GLOBAL wsrep_cluster_address = '';
---disable_query_log
---eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
---enable_query_log
+--connection node_2
--source include/start_mysqld.inc
--sleep 5
--source include/wait_until_connected_again.inc
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
# 3. Restart node #2 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
# 4. Restart node #1 with the new socket.ssl_ca , socket.ssl_cert and socket.ssl_key
--source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
-SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
+--source include/wait_condition.inc
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
# Upgrade complete. Both nodes now use the new key and certificate
--- /dev/null
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# This test creates a new FK constraint while an UPDATE is running
+#
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE parent (
+ id INT PRIMARY KEY,
+ KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE child (
+ id INT PRIMARY KEY AUTO_INCREMENT,
+ parent_id INT
+) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1);
+
+INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+--connection node_1
+--sleep 1
+--send ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id) ON UPDATE CASCADE;
+
+--connection node_2
+--sleep 1
+--send UPDATE parent SET id = 2 WHERE id = 1;
+
+--connection node_1
+--reap
+
+--connection node_2
+--reap
+
+--connection node_2
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+
+--connection node_1
+SELECT COUNT(*) = 10000 FROM child WHERE parent_id = 2;
+
+DROP TABLE child;
+DROP TABLE parent;
+
+DROP TABLE ten;
--- /dev/null
+#
+# Test the operation of DDLs that affect multiple database objects
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $galera_connection_name = node_1a
+--let $galera_server_number = 1
+--source include/galera_connect.inc
+
+--connection node_1
+CREATE DATABASE database1;
+USE database1;
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
+
+# Make sure autocommit retrying does not kick in as this will mask the error we expect to get
+SET SESSION wsrep_retry_autocommit = 0;
+# Attemp to insert 1M rows
+--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_1a
+USE database1;
+SET SESSION wsrep_retry_autocommit = 0;
+--send INSERT INTO t2 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;
+
+--connection node_2
+--sleep 1
+--send DROP DATABASE database1;
+
+--connection node_1
+--sleep 1
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_1a
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+--reap
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+--error ER_BAD_DB_ERROR
+USE database1;
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = 'database1';
+--error ER_BAD_DB_ERROR
+USE database1;
--- /dev/null
+#
+# Test the operation of TRUNCATE with concurrent DML.
+# The DML should be BF-aborted if the DDL arrives from another node
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+#
+# INSERT and TRUNCATE on different nodes
+#
+
+--connection node_1
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+# Insert 100K rows
+--connection node_2
+# Prevent autocommit retring from masking the deadlock error we expect to get
+SET SESSION wsrep_retry_autocommit = 0;
+--send INSERT INTO t1 (f1) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
+
+--connection node_1
+--sleep 1
+--send TRUNCATE TABLE t1;
+
+--connection node_1
+--reap
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+--reap
+
+--connection node_2
+SELECT COUNT(*) = 0 FROM t1;
+
+--connection node_1
+SELECT COUNT(*) = 0 FROM t1;
+
+DROP TABLE t1;
+DROP TABLE ten;
# Set to invalid value
#
---connection node_1
---let $wsrep_cluster_address_node1 = `SELECT @@wsrep_cluster_address`
+--connection node_2
+--let $wsrep_cluster_address_node2 = `SELECT @@wsrep_cluster_address`
SET GLOBAL wsrep_cluster_address = 'foo://';
# With wsrep_sync_wait, this returns an error
SHOW STATUS LIKE 'wsrep_local_state';
SHOW STATUS LIKE 'wsrep_local_state_comment';
---connection node_2
+--connection node_1
--sleep 1
-# Node #2 thinks that it is now part of a single-node primary cluster
+# Node #1 thinks that it is now part of a single-node primary cluster
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
# Reset everything as it was
#
---connection node_1
+--connection node_2
--disable_query_log
---eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node1';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node2';
--enable_query_log
---connection node_2
-SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
-
--source include/wait_until_connected_again.inc
--connection node_1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-#
-# Set to invalid host
-#
-
---connection node_1
-SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1';
-
---error 0
-SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
-
-# Must return 'OFF'
-SHOW STATUS LIKE 'wsrep_ready';
-
-# Must return 'Non-primary'
-SHOW STATUS LIKE 'wsrep_cluster_status';
-
-# Must return 0 = 'Initialized'
-SHOW STATUS LIKE 'wsrep_local_state';
-SHOW STATUS LIKE 'wsrep_local_state_comment';
-
-#
-# Reset everything as it was
-#
-
---connection node_1
---disable_query_log
---eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node1';
---enable_query_log
-
--connection node_2
-SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
---sleep 1
-
---connection node_1
-SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-
CALL mtr.add_suppression("Backend not supported: foo");
CALL mtr.add_suppression("Failed to initialize backend using 'foo");
CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo");
CALL mtr.add_suppression("gcs_caused\\(\\) returned -103 \\(Software caused connection abort\\)");
CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed to reach primary view: 110");
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
-CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'gcomm://192\\.0\\.2\\.1': -110 \\(Connection timed out\\)");
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
-CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
-
--- /dev/null
+--source include/galera_cluster.inc
+
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+
+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+
+--let $wsrep_max_ws_rows_orig = `SELECT @@wsrep_max_ws_rows`
+SET GLOBAL wsrep_max_ws_rows = 4;
+
+# Test that wsrep_max_ws_rows is enforced with multi statement transactions
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (5);
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+--error ER_ERROR_DURING_COMMIT
+UPDATE t1 SET f2 = 10 WHERE f2 = 4;
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+INSERT INTO t1 (f2) VALUES (3);
+INSERT INTO t1 (f2) VALUES (4);
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1 WHERE f2 = 1;
+COMMIT;
+SELECT COUNT(*) = 0 FROM t1;
+
+
+# Test that wsrep_max_ws_rows is enforced on sigle statements
+
+SET GLOBAL wsrep_max_ws_rows = 5;
+INSERT INTO t1 (f2) VALUES (1),(2),(3),(4),(5);
+SET GLOBAL wsrep_max_ws_rows = 4;
+
+--error ER_ERROR_DURING_COMMIT
+UPDATE t1 SET f2 = f2 + 10;
+SELECT COUNT(*) = 5 FROM t1;
+
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1 WHERE f2 < 10;
+SELECT COUNT(*) = 5 FROM t1;
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) SELECT * FROM ten;
+SELECT COUNT(*) = 5 FROM t1;
+
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (10),(20),(30),(40),(50);
+SELECT COUNT(*) = 5 FROM t1;
+
+# Fewer than wsrep_max_ws_rows is OK
+
+SET GLOBAL wsrep_max_ws_rows = 10;
+DELETE FROM t1 WHERE f2 < 10;
+SELECT COUNT(*) = 0 FROM t1;
+
+# Test a series of transactions
+
+--disable_query_log
+SET GLOBAL wsrep_max_ws_rows = 5;
+let $i= 100;
+while ($i)
+{
+ START TRANSACTION;
+ --eval INSERT INTO t1 (f2) VALUES ($i);
+ COMMIT;
+ dec $i;
+}
+--enable_query_log
+SET GLOBAL wsrep_max_ws_rows = 100;
+SELECT COUNT(*) = 100 FROM t1;
+DELETE FROM t1 WHERE f2 < 101;
+SELECT COUNT(*) = 0 FROM t1;
+
+# Test large statements
+
+SET GLOBAL wsrep_max_ws_rows = 9999;
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+SET GLOBAL wsrep_max_ws_rows = 10000;
+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
+
+SET GLOBAL wsrep_max_ws_rows = 9999;
+--error ER_ERROR_DURING_COMMIT
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+SET GLOBAL wsrep_max_ws_rows = 10000;
+UPDATE t1 SET f2 = 2 WHERE f2 = 1;
+
+SET GLOBAL wsrep_max_ws_rows = 9999;
+--error ER_ERROR_DURING_COMMIT
+DELETE FROM t1 WHERE f2 = 2;
+SET GLOBAL wsrep_max_ws_rows = 10000;
+DELETE FROM t1 WHERE f2 = 2;
+
+SELECT COUNT(*) = 0 FROM t1;
+
+
+# Test that wsrep_max_ws_rows is reset when switching autocommit mode
+
+SET AUTOCOMMIT = ON;
+SET GLOBAL wsrep_max_ws_rows = 1;
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+INSERT INTO t1 (f2) VALUES (1);
+INSERT INTO t1 (f2) VALUES (2);
+
+
+SET AUTOCOMMIT = OFF;
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+
+# Test that wsrep_max_ws_rows is reset on implicit commits
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+
+START TRANSACTION;
+INSERT INTO t1 (f2) VALUES (1);
+--error ER_ERROR_DURING_COMMIT
+INSERT INTO t1 (f2) VALUES (2);
+
+
+--disable_query_log
+--eval SET GLOBAL wsrep_max_ws_rows = $wsrep_max_ws_rows_orig
+--enable_query_log
+
+DROP TABLE t1;
+DROP TABLE ten;
INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024));
SELECT COUNT(*) = 0 FROM t1;
+#
+# Changing repl.max_ws_size also changes wsrep_max_ws_size
+#
+
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+SELECT @@wsrep_max_ws_size = 10000;
+
+
+#
+# Changing wsrep_max_ws_size is equivalent to changing repl.max_ws_size
+#
+
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=20000';
+--let $provider_options = `SELECT @@wsrep_provider_options`
+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=10000';
+
+SET GLOBAL wsrep_max_ws_size = 20000;
+--let $provider_options_updated = `SELECT @@wsrep_provider_options`
+
+--disable_query_log
+--eval SELECT STRCMP('$provider_options', '$provider_options_updated') = 0 AS provider_options_match
+--enable_query_log
+
--disable_query_log
--eval SET GLOBAL wsrep_max_ws_size = $wsrep_max_ws_size_orig
--enable_query_log
--- /dev/null
+#
+# Test that the wsrep_retry_autocommit variable is respected. We use an INSERT that
+# proceeds very slowly due to extra SLEEP() in a trigger
+#
+
+--source include/galera_cluster.inc
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f2 = SLEEP(5);
+
+#
+# With wsrep_retry_autocommit = 0, error is certain
+#
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit = 0;
+--send INSERT INTO t1 (f1) VALUES (1),(2);
+
+--connection node_2
+--sleep 1
+TRUNCATE TABLE t1;
+
+--connection node_1
+--error ER_LOCK_DEADLOCK
+--reap
+
+#
+# With wsrep_retry_autocommit = 1, success against one TRUNCATE
+#
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit = 1;
+--send INSERT INTO t1 (f1) VALUES (3),(4);
+
+--connection node_2
+--sleep 1
+TRUNCATE TABLE t1;
+
+--connection node_1
+--error 0
+--reap
+SELECT * FROM test.t1;
+
+#
+# With wsrep_retry_autocommit = 1, failure against multiple TRUNCATEs
+#
+
+--connection node_2
+DELIMITER |;
+CREATE PROCEDURE repeated_truncate ()
+BEGIN
+ DECLARE i INT;
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
+
+ SET i = 0;
+ WHILE i <= 1000 DO
+ TRUNCATE TABLE t1;
+ SET i = i + 1;
+ END WHILE;
+END|
+DELIMITER ;|
+
+# Begin streaming TRUNCATEs
+--let $truncate_connection_id = `SELECT CONNECTION_ID()`
+--send CALL repeated_truncate()
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit = 1;
+--sleep 1
+--error ER_LOCK_DEADLOCK
+INSERT INTO t1 (f1) VALUES (5),(6);
+
+#
+# With wsrep_retry_autocommit = 1024, success against multiple TRUNCATEs
+#
+
+--connection node_1
+SET SESSION wsrep_retry_autocommit = 1024;
+--send INSERT INTO t1 (f1) VALUES (7),(8);
+
+--sleep 6
+
+# Once he stream of TRUNCATEs is complete
+--connection node_2
+--reap
+
+# the INSERT will eventually be sucessfull
+--connection node_1
+--error 0
+--reap
+
+--let $diff_servers = 1 2
+--source include/diff_servers.inc
+
+DROP TABLE t1;
+DROP PROCEDURE repeated_truncate;
--- /dev/null
+--wsrep_log_conflicts=ON
--- /dev/null
+#
+# Test --wsrep_log_conflicts=ON
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (
+ f1 VARCHAR(255) PRIMARY KEY
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO t1 VALUES ('abc');
+
+--connection node_2
+SELECT f1 = 'abc' FROM t1;
+
+#
+# Provoke a conflict
+#
+
+--connection node_1
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'klm';
+
+--connection node_2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+UPDATE t1 SET f1 = 'xyz';
+
+--connection node_1
+COMMIT;
+
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--connection node_2a
+--let $wait_condition = SELECT f1 = 'klm' FROM t1;
+--source include/wait_condition.inc
+
+--connection node_2
+--error ER_LOCK_DEADLOCK
+COMMIT;
+
+#
+# We can not really check the log output very much because it is quite variable
+#
+
+--let $assert_file = $MYSQLTEST_VARDIR/log/mysqld.2.err
+--let $assert_only_after = CURRENT_TEST
+
+--let $assert_text = cluster conflict due to high priority abort for threads
+--let $assert_select = cluster conflict due to high priority abort for threads
+--let $assert_match = cluster conflict due to high priority abort for threads
+--source include/assert_grep.inc
+
+DROP TABLE t1;
--- /dev/null
+#
+# PXC-318: Typo in wsrep_provider_options causes an unhandled exception
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+--let LOGF=$MYSQLTEST_VARDIR/log/mysqld.1.err
+--disable_info
+call mtr.add_suppression("WSREP\: Unknown parameter 'gmcasts\.segment'");
+call mtr.add_suppression("WSREP\: Set options returned 7");
+--error ER_WRONG_ARGUMENTS
+SET GLOBAL wsrep_provider_options="gmcasts.segment=1";
+# Search for unhandled exception message.
+perl;
+ use strict;
+ my $logf= $ENV{'LOGF'} or die "LOGF not set";
+ open(FILE, "$logf") or die("Unable to open $logf: $!\n");
+ my $count_warnings=grep(/terminate called after throwing an instance of /gi,<FILE>);
+ print "Unhandled exceptions: $count_warnings\n";
+ close(FILE);
+EOF
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+FLUSH TABLES t1 FOR EXPORT;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+
+--connection node_2
+UNLOCK TABLES;
+
+--echo ### t1 should have column f2
+SHOW CREATE TABLE t1;
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+FLUSH TABLE WITH READ LOCK;
+--echo ### This shouldn't block.
+FLUSH TABLES t1 FOR EXPORT;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+
+--connection node_2
+UNLOCK TABLES;
+
+--echo ### t1 should have column f2
+SHOW CREATE TABLE t1;
+
+--connection node_1
+INSERT INTO t1 VALUES (2,3);
+
+--connection node_2
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
--- /dev/null
+#
+# Test Flush tables with read lock along with
+# flush tables <table> with read lock for compatibility.
+# Also, making sure all DDL and DMLs are propagated
+# after provider is unpaused
+#
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--let $galera_connection_name = node_2a
+--let $galera_server_number = 2
+--source include/galera_connect.inc
+
+--connection node_1
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+FLUSH TABLE WITH READ LOCK;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+
+--connection node_2a
+SET session wsrep_sync_wait=0;
+SET session wsrep_causal_reads=OFF;
+SHOW CREATE TABLE t1;
+--sleep 1
+--send FLUSH TABLES t1 WITH READ LOCK;
+
+--connection node_2
+# let the flush table wait in pause state before we unlock
+# table otherwise there is window where-in flush table is
+# yet to wait in pause and unlock allows alter table to proceed.
+# this is because send in asynchronous.
+--sleep 3
+# this will release existing lock but will not resume
+# the cluster as there is new FTRL that is still pausing it.
+UNLOCK TABLES;
+SHOW CREATE TABLE t1;
+
+--connection node_2a
+--reap
+UNLOCK TABLES;
+--sleep 1
+SHOW CREATE TABLE t1;
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
--- /dev/null
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+FLUSH TABLES t1 WITH READ LOCK;
+
+--connection node_1
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+INSERT INTO t1 VALUES (2,3);
+
+--sleep 2
+
+--connection node_2
+UNLOCK TABLES;
+
+--echo ### t1 should have column f2
+SHOW CREATE TABLE t1;
+SELECT * from t1;
+
+--connection node_1
+DROP TABLE t1;
--- /dev/null
+#
+# PXC-421: Test deadlock involving updates of
+# wsrep_provider, wsrep_cluster_address and wsrep_slave_threads.
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--let $wsrep_slave_1 = `SELECT @@wsrep_slave_threads`
+set GLOBAL wsrep_slave_threads=26;
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+
+--connection node_2
+--let $wsrep_slave_2 = `SELECT @@wsrep_slave_threads`
+set GLOBAL wsrep_slave_threads=16;
+--let $wsrep_provider_orig = `SELECT @@wsrep_provider`
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+
+SET GLOBAL wsrep_provider='none';
+INSERT INTO t1 VALUES (2);
+
+--connection node_1
+INSERT INTO t1 VALUES (3);
+
+--connection node_2
+--disable_query_log
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+--source include/wait_until_connected_again.inc
+--source include/galera_wait_ready.inc
+
+INSERT INTO t1 VALUES (4);
+set GLOBAL wsrep_slave_threads=5;
+
+# Node #2 has all the inserts
+SELECT COUNT(*) = 5 FROM t1;
+
+--connection node_1
+set GLOBAL wsrep_slave_threads=12;
+# Node #1 is missing the insert made while Node #2 was not replicated
+SELECT COUNT(*) = 4 FROM t1;
+INSERT INTO t1 VALUES (100), (101), (102);
+
+--connection node_2
+set GLOBAL wsrep_slave_threads=5;
+INSERT INTO t1 (f1) SELECT * from t1 as x1;
+show global variables like 'wsrep_slave_threads';
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_2
+SELECT COUNT(*) FROM t1;
+
+--connection node_1
+SELECT COUNT(*) FROM t1;
+show global variables like 'wsrep_slave_threads';
+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_1
+DROP TABLE t1;
[mysqld.1]
wsrep_cluster_address='gcomm://'
-wsrep_provider_options='base_port=@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
[mysqld.2]
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.2.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
[mysqld.3]
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
-wsrep_provider_options='base_port=@mysqld.3.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
SET GLOBAL wsrep_provider_options = 'gmcast.isolate=1';
SET SESSION wsrep_sync_wait = 0;
-SHOW STATUS LIKE 'wsrep_cluster_status';
-Variable_name Value
-wsrep_cluster_status non-Primary
SET GLOBAL wsrep_provider_options = 'pc.bootstrap=1';
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
SET GLOBAL wsrep_provider_options = 'pc.weight=3';
Suspending node ...
SET SESSION wsrep_sync_wait=0;
+SET SESSION wsrep_on=OFF;
+SET SESSION wsrep_on=ON;
SHOW STATUS LIKE 'wsrep_cluster_size';
Variable_name Value
wsrep_cluster_size 2
--- /dev/null
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 1']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+include/assert_grep.inc [grastate.dat does not have 'safe_to_bootstrap: 0']
+SET SESSION wsrep_on = OFF;
+Killing server ...
+safe_to_bootstrap: 1
+safe_to_bootstrap: 0
+safe_to_bootstrap: 0
+CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
+CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `f1` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t1;
--- /dev/null
+# We need a dedicated .cnf file, even if empty, in order to force this test to run
+# alone on a freshly started cluster. Otherwise there are adverse interactions with
+# prior tests such as galera_3nodes.galera_innobackupex_backup
+
+!include ../galera_3nodes.cnf
# Node #2 should be non-primary
SET SESSION wsrep_sync_wait = 0;
-SHOW STATUS LIKE 'wsrep_cluster_status';
+--let $wait_condition = SELECT variable_value = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_cluster_status';
+--source include/wait_condition.inc
# Signal node #2 to bootstrap
--connection node_2
--- /dev/null
+# We need a dedicated .cnf file, even if empty, in order to force this test to run
+# alone on a freshly started cluster. Otherwise there are adverse interactions with
+# following tests such as galera_3nodes.galera_var_dirty_reads2
+
+!include ../galera_3nodes.cnf
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
+SET SESSION wsrep_on=ON;
+
# We can not use SELECT queries here, as only SHOW is allowed to run.
# For nodes #2 and #3, we expect a non-primary component of size 2
--connection node_1
--source include/galera_resume.inc
---sleep 5
+--sleep 10
--source include/wait_until_connected_again.inc
# For Node #1, we expect a primary component of size 1
--- /dev/null
+#
+# Test the safe_to_bootstrap in grastate.dat
+#
+
+--source include/galera_cluster.inc
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+
+#
+# At start, all grastate.dat files have safe_to_boostrap: 0
+#
+
+--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 0'
+--let $assert_select= safe_to_bootstrap: 0
+--let $assert_count= 1
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+--source include/assert_grep.inc
+
+#
+# Shut down one node
+#
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Still, all grastate.dat files should have safe_to_boostrap: 0
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+--source include/assert_grep.inc
+
+#
+# Shut down one more node
+#
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# Now, nodes 2,3 should have safe_to_boostrap: 0
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+--source include/assert_grep.inc
+
+# But node #1 should have safe_to_boostrap: 1
+
+--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 1'
+--let $assert_select= safe_to_bootstrap: 1
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--source include/assert_grep.inc
+
+# Restart one node
+
+--connection node_2
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_1
+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+# All nodes should be back to 'safe_to_bootstrap: 0'
+
+--let $assert_text= grastate.dat does not have 'safe_to_bootstrap: 0'
+--let $assert_select= safe_to_bootstrap: 0
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+--source include/assert_grep.inc
+
+--let $assert_file= $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+--source include/assert_grep.inc
+
+#
+# Kill the cluster
+#
+
+--connection node_2
+--source include/shutdown_mysqld.inc
+
+--connection node_1
+SET SESSION wsrep_on = OFF;
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--source include/kill_galera.inc
+
+#
+# Only node #1 should have safe_to_bootstrap: 1
+# include/assert_grep.inc requires a running server, so we revert to simple grep
+#
+
+--error 0
+--exec grep 'safe_to_bootstrap: 1' $MYSQLTEST_VARDIR/mysqld.1/data/grastate.dat
+
+--error 0
+--exec grep 'safe_to_bootstrap: 0' $MYSQLTEST_VARDIR/mysqld.2/data/grastate.dat
+
+--error 0
+--exec grep 'safe_to_bootstrap: 0' $MYSQLTEST_VARDIR/mysqld.3/data/grastate.dat
+
+#
+# Attempt to bootstrap nodes #2, #3, should fail
+#
+
+--error 1
+--exec $MYSQLD --defaults-group-suffix=.2 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster'
+--error 1
+--exec $MYSQLD --defaults-group-suffix=.3 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster'
+
+#
+# Attempt to bootstrap starting from node #1, should succeed
+#
+
+--connection node_1
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/start_mysqld.inc
+--source include/wait_until_connected_again.inc
+
+--connection node_2
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+--source include/start_mysqld.inc
+
+--connection node_3
+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
+--source include/start_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--connection node_2
+CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
+
+--connection node_3
+CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--source include/wait_condition.inc
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
+--source include/wait_condition.inc
+
DROP TABLE t1;
--- /dev/null
+CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY)ENGINE=INNODB;
+# SETTING auto_increment_increment IN CONNECTION DEFAULT
+SET AUTO_INCREMENT_INCREMENT = 1;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+id
+1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+# SETTING auto_increment_increment IN CONNECTION1
+SET AUTO_INCREMENT_INCREMENT = 2;
+SET DEBUG_SYNC= 'ib_after_row_insert SIGNAL opened WAIT_FOR flushed1';
+INSERT INTO t1 VALUES(NULL);
+SET AUTO_INCREMENT_INCREMENT = 2;
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+SET DEBUG_SYNC= 'ib_after_row_insert_step SIGNAL flushed1 WAIT_FOR opened1';
+insert into t1 values(NULL);
+# CONNECTION default
+SELECT * FROM t1;
+id
+1
+3
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
+SET DEBUG_SYNC= 'now SIGNAL opened1';
+# CONNECTION con1
+SELECT * FROM t1;
+id
+1
+3
+5
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY)ENGINE=INNODB;
+# SETTING auto_increment_increment IN CONNECTION DEFAULT
+SET AUTO_INCREMENT_INCREMENT = 1;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+id
+1
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+SET DEBUG_SYNC = 'now SIGNAL flushed';
+# SETTING auto_increment_increment in connection1
+SET AUTO_INCREMENT_INCREMENT = 2;
+SET DEBUG_SYNC= 'now WAIT_FOR flushed';
+SET DEBUG_SYNC= 'ib_after_row_insert SIGNAL opened WAIT_FOR flushed1';
+INSERT INTO t1 values(NULL);
+# CONNECTION DEFAULT
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+SET DEBUG_SYNC= 'ib_after_row_insert_step SIGNAL flushed1 WAIT_FOR opened1';
+INSERT INTO t1 VALUES(NULL);
+# CONNECTION con1
+SELECT * FROM t1;
+id
+1
+3
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+SET DEBUG_SYNC= 'now SIGNAL opened1';
+# CONNECTION default
+SELECT * FROM t1;
+id
+1
+3
+5
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+DROP TABLE t1;
--- /dev/null
+#
+#Bug #21133329 HANGING "SYSTEM LOCK" WHEN EXECUTING "FLUSH TABLE ... FOR EXPORT"
+#
+CREATE TABLE t1 (
+c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+c2 BIGINT,
+c3 VARCHAR(2048),
+c4 VARCHAR(2048),
+INDEX idx1(c2),
+INDEX idx2(c3(512)),
+INDEX idx3(c4(512))) Engine=InnoDB;
+CREATE TABLE t2 ( f1 int PRIMARY KEY) engine=innodb;
+SET GLOBAL INNODB_PURGE_STOP_NOW=ON;
+SET GLOBAL innodb_disable_background_merge=ON;
+SET GLOBAL innodb_stats_persistent=OFF;
+show variables like '%innodb_stats_persistent%';
+Variable_name Value
+innodb_stats_persistent OFF
+innodb_stats_persistent_sample_pages 20
+INSERT INTO t1(c2, c3, c4) VALUES
+(1, REPEAT('a', 2048), REPEAT('a', 2048)),
+(2, REPEAT('b', 2048), REPEAT('b', 2048)),
+(3, REPEAT('c', 2048), REPEAT('c', 2048)),
+(4, REPEAT('d', 2048), REPEAT('d', 2048));
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+FLUSH TABLES t2 FOR EXPORT;
+UNLOCK TABLES;
+SET GLOBAL innodb_disable_background_merge=OFF;
+SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
+SET GLOBAL innodb_stats_persistent=ON;
+DROP TABLE t1,t2;
--- /dev/null
+SET @old_innodb_file_per_table = @@innodb_file_per_table;
+SET GLOBAL innodb_file_per_table = 1;
+SELECT @@innodb_file_per_table;
+@@innodb_file_per_table
+1
+CREATE TABLE t1 (
+col_1 CHAR (255),
+col_2 VARCHAR (255)
+) ENGINE = InnoDB;
+CREATE INDEX idx1 ON t1(col_1);
+CREATE INDEX idx2 ON t1(col_2);
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 0 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 0 NULL NULL YES BTREE
+INSERT INTO t1 VALUES ("col1_00001", "col2_00001"), ("col1_00002", "col2_00002");
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE
+FLUSH TABLES t1 FOR EXPORT;
+backup: t1
+UNLOCK TABLES;
+DROP TABLE t1;
+CREATE TABLE t1 (
+col_1 CHAR (255),
+col_2 VARCHAR (255)
+) ENGINE = InnoDB;
+CREATE INDEX idx1 ON t1(col_1);
+CREATE INDEX idx2 ON t1(col_2);
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 0 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 0 NULL NULL YES BTREE
+INSERT INTO t1 VALUES ("col1_00001", "col2_00001");
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 1 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 1 NULL NULL YES BTREE
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 1 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 1 NULL NULL YES BTREE
+ALTER TABLE t1 DISCARD TABLESPACE;
+restore: t1 .ibd and .cfg files
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SHOW INDEXES FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
+t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE
+t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE
+DROP TABLE t1;
+SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table;
--- /dev/null
+# INPLACE ALTER WITH INPLACE_IGNORE FLAG AND CHANGE CREATE OPTION
+# CHANGE THE COLUMN DEFAULT (INPLACE_IGNORE)
+# AND TABLE CHARSET(CHANGE CREATE)
+CREATE TABLE t1(
+id INT PRIMARY KEY,
+f1 INT NOT NULL DEFAULT 0)ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 2);
+ALTER TABLE t1 MODIFY COLUMN f1 INT NOT NULL DEFAULT 0,
+DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+DROP TABLE t1;
+# CHANGE THE STORAGE TYPE OF COLUMN(INPLACE IGNORE)
+# AND TABLE CHARSET(CHANGE CREATE)
+CREATE TABLE t1(
+id INT STORAGE DISK)ENGINE=INNODB;
+INSERT INTO t1 values(1);
+ALTER TABLE t1 MODIFY COLUMN id INT STORAGE MEMORY,
+DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+DROP TABLE t1;
+# RENAME THE TABLE(INPLACE IGNORE)
+# AND CHANGE TABLE CHARSET(CHANGE CREATE)
+CREATE TABLE t1(
+f1 INT NOT NULL,
+f2 INT NOT NULL)ENGINE=INNODB;
+INSERT INTO t1 VALUES(1, 2);
+ALTER TABLE t1 RENAME t2, DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+DROP TABLE t2;
21 aaaaaaaaaaaaaaaaaaaa
22 bbbbbbbbbbbbbbbbbbbb
23 cccccccccccccccccccc
+SET GLOBAL innodb_fast_shutdown=0;
"test misc 1"
"test misc 2"
"test misc 3"
`IF(NULL IS NOT NULL, NULL, NULL)` binary(0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE table_54044;
-CREATE TABLE tmp ENGINE = INNODB AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
+CREATE TABLE tmp ENGINE = INNODB
+AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
SHOW CREATE TABLE tmp;
Table Create Table
tmp CREATE TABLE `tmp` (
--- /dev/null
+#
+# Bug #21983865 UNEXPECTED DEADLOCK WITH INNODB_AUTOINC_LOCK_MODE=0
+#
+create table t1(f1 int not null auto_increment primary key) engine=innodb;
+# Hold autoinc_lock on table t1 from connection con1
+set debug_sync='ib_after_row_insert SIGNAL others WAIT_FOR continue_others';
+insert into t1 values(NULL);
+# Create 40 connections and make it to wait for autoinc_lock on table t1.
+# Release the auto_inc lock on table t1 for connection con1
+set debug_sync='now SIGNAL continue_others';
+# Now all 40 connections can finish the insert operation on t1.
+drop table t1;
3784744,4180925,4559596,3963734,3856391,4494153)
AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref PRIMARY,idx1,idx2 idx1 60 const,const,const 18 Using index condition
+1 SIMPLE t1 range PRIMARY,idx1,idx2 idx1 64 NULL 18 Using index condition
DROP TABLE t1;
#
# Bug#51431 Wrong sort order after import of dump file
--- /dev/null
+#
+# Bug 23333990 PERSISTENT INDEX STATISTICS UPDATE BEFORE
+# TRANSACTION IS COMMITTED
+#
+"Test 1:- Uncommited delete test"
+CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+val INT UNSIGNED NOT NULL,
+INDEX (val)) ENGINE=INNODB
+STATS_PERSISTENT=1,STATS_AUTO_RECALC=1;
+INSERT INTO t1 (val) VALUES (4);
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+262144
+Connection 1
+START TRANSACTION;
+DELETE FROM t1;
+SELECT COUNT(*) FROM t1;
+Connection Default
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+Test correctly estimates the number of rows as > 20000
+even when in other uncommmited transaction
+all rows have been deleted.
+Connection 1
+COUNT(*)
+0
+commit;
+Connection deafult
+Test 2:- Insert and rollback test
+CREATE TABLE t2 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+val INT UNSIGNED NOT NULL,
+INDEX (val)) ENGINE=INNODB
+STATS_PERSISTENT=1,STATS_AUTO_RECALC=1;
+Connection 1
+START TRANSACTION;
+INSERT INTO t2 (val) VALUES (4);
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+SELECT COUNT(*) FROM t2;
+Connection default
+select count(*) from t2;
+count(*)
+0
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status OK
+Test correctly estimates the number of rows as > 20000
+even when in other uncommited transaction
+many rows are inserted.
+Connection 1
+COUNT(*)
+262144
+Rollback the insert
+rollback;
+Connection default
+Test correctly estimates the number of rows as 1
+after rollback.
+DROP TABLE t1,t2;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
+#
+# Bug#22576241 SETTING INNODB_MONITOR_ENABLE TO ALL DOES NOT ENABLE ALL
+# MONITORS
+#
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf 0
+SET GLOBAL innodb_monitor_enable='module_buffer_page';
+INSERT INTO t1 VALUES (1), (2), (3), (4);
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf NNNN
+SET GLOBAL innodb_monitor_disable='module_buffer_page';
+SET GLOBAL innodb_monitor_reset_all='module_buffer_page';
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf 0
+SET GLOBAL innodb_monitor_enable='%';
+INSERT INTO t1 VALUES (5), (6), (7), (8);
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf NNNN
+SET GLOBAL innodb_monitor_disable='%';
+SET GLOBAL innodb_monitor_reset_all='%';
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf 0
+SET GLOBAL innodb_monitor_enable='ALL';
+INSERT INTO t1 VALUES (9), (10), (11), (12);
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+NAME COUNT
+buffer_page_written_index_leaf NNNN
+SET GLOBAL innodb_monitor_enable=default;
+SET GLOBAL innodb_monitor_disable=default;
+SET GLOBAL innodb_monitor_reset_all=default;
+DROP TABLE t1;
--- /dev/null
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+--source include/have_debug.inc
+
+# Two parallel connection with autoinc column after restart.
+
+CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY)ENGINE=INNODB;
+
+--echo # SETTING auto_increment_increment IN CONNECTION DEFAULT
+SET AUTO_INCREMENT_INCREMENT = 1;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+
+--source include/restart_mysqld.inc
+
+--echo # SETTING auto_increment_increment IN CONNECTION1
+SET AUTO_INCREMENT_INCREMENT = 2;
+
+SET DEBUG_SYNC= 'ib_after_row_insert SIGNAL opened WAIT_FOR flushed1';
+
+SEND INSERT INTO t1 VALUES(NULL);
+
+connect(con1, localhost, root,,);
+SET AUTO_INCREMENT_INCREMENT = 2;
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+SET DEBUG_SYNC= 'ib_after_row_insert_step SIGNAL flushed1 WAIT_FOR opened1';
+send insert into t1 values(NULL);
+
+--echo # CONNECTION default
+connection default;
+reap;
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+SET DEBUG_SYNC= 'now SIGNAL opened1';
+
+--echo # CONNECTION con1
+connection con1;
+reap;
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+connection default;
+disconnect con1;
+
+DROP TABLE t1;
+
+# Two parallel connection with autoinc column without restart.
+
+CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY)ENGINE=INNODB;
+
+--echo # SETTING auto_increment_increment IN CONNECTION DEFAULT
+SET AUTO_INCREMENT_INCREMENT = 1;
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+SET DEBUG_SYNC = 'now SIGNAL flushed';
+
+connect(con1, localhost, root,,);
+
+--echo # SETTING auto_increment_increment in connection1
+SET AUTO_INCREMENT_INCREMENT = 2;
+
+SET DEBUG_SYNC= 'now WAIT_FOR flushed';
+SET DEBUG_SYNC= 'ib_after_row_insert SIGNAL opened WAIT_FOR flushed1';
+
+send INSERT INTO t1 values(NULL);
+
+--echo # CONNECTION DEFAULT
+connection default;
+
+SET DEBUG_SYNC= 'now WAIT_FOR opened';
+SET DEBUG_SYNC= 'ib_after_row_insert_step SIGNAL flushed1 WAIT_FOR opened1';
+
+send INSERT INTO t1 VALUES(NULL);
+
+--echo # CONNECTION con1
+connection con1;
+reap;
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+SET DEBUG_SYNC= 'now SIGNAL opened1';
+
+--echo # CONNECTION default
+connection default;
+reap;
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+disconnect con1;
+DROP TABLE t1;
--- /dev/null
+
+--echo #
+--echo #Bug #21133329 HANGING "SYSTEM LOCK" WHEN EXECUTING "FLUSH TABLE ... FOR EXPORT"
+--echo #
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (
+ c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ c2 BIGINT,
+ c3 VARCHAR(2048),
+ c4 VARCHAR(2048),
+ INDEX idx1(c2),
+ INDEX idx2(c3(512)),
+ INDEX idx3(c4(512))) Engine=InnoDB;
+
+CREATE TABLE t2 ( f1 int PRIMARY KEY) engine=innodb;
+
+# Stop purge so that it doesn't remove the delete marked entries.
+SET GLOBAL INNODB_PURGE_STOP_NOW=ON;
+
+# Disable change buffer merge from the master thread, additionally
+# enable aggressive flushing so that more changes are buffered.
+SET GLOBAL innodb_disable_background_merge=ON;
+SET GLOBAL innodb_stats_persistent=OFF;
+show variables like '%innodb_stats_persistent%';
+
+INSERT INTO t1(c2, c3, c4) VALUES
+ (1, REPEAT('a', 2048), REPEAT('a', 2048)),
+ (2, REPEAT('b', 2048), REPEAT('b', 2048)),
+ (3, REPEAT('c', 2048), REPEAT('c', 2048)),
+ (4, REPEAT('d', 2048), REPEAT('d', 2048));
+
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+INSERT INTO t1(c2, c3, c4) SELECT c2, c3, c4 FROM t1;
+
+FLUSH TABLES t2 FOR EXPORT;
+UNLOCK TABLES;
+
+SET GLOBAL innodb_disable_background_merge=OFF;
+SET GLOBAL INNODB_PURGE_RUN_NOW=ON;
+SET GLOBAL innodb_stats_persistent=ON;
+
+DROP TABLE t1,t2;
innodb_stats_table_flag_auto_recalc : Performs multiple restarts in a row which causes '1047: Unknown command' errors
innodb-lock-inherit-read_commited : Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT
innodb-index-debug : Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT
+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.
--- /dev/null
+#
+# BUG#20125349 - PERSISTANT STATS IS NOT UPDATED WHEN TTS IS IMPORTED.
+#
+
+--source include/not_embedded.inc
+--source include/have_innodb.inc
+
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+SET @old_innodb_file_per_table = @@innodb_file_per_table;
+
+SET GLOBAL innodb_file_per_table = 1;
+SELECT @@innodb_file_per_table;
+
+CREATE TABLE t1 (
+ col_1 CHAR (255),
+ col_2 VARCHAR (255)
+) ENGINE = InnoDB;
+
+CREATE INDEX idx1 ON t1(col_1);
+CREATE INDEX idx2 ON t1(col_2);
+
+SHOW INDEXES FROM t1;
+
+INSERT INTO t1 VALUES ("col1_00001", "col2_00001"), ("col1_00002", "col2_00002");
+
+SHOW INDEXES FROM t1;
+
+ANALYZE TABLE t1;
+SHOW INDEXES FROM t1;
+
+FLUSH TABLES t1 FOR EXPORT;
+perl;
+do 'include/innodb-util.inc';
+ib_backup_tablespaces("test", "t1");
+EOF
+
+UNLOCK TABLES;
+
+DROP TABLE t1;
+
+CREATE TABLE t1 (
+ col_1 CHAR (255),
+ col_2 VARCHAR (255)
+) ENGINE = InnoDB;
+
+CREATE INDEX idx1 ON t1(col_1);
+CREATE INDEX idx2 ON t1(col_2);
+
+SHOW INDEXES FROM t1;
+
+INSERT INTO t1 VALUES ("col1_00001", "col2_00001");
+
+SHOW INDEXES FROM t1;
+
+ANALYZE TABLE t1;
+SHOW INDEXES FROM t1;
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+
+perl;
+do 'include/innodb-util.inc';
+ib_discard_tablespaces("test", "t1");
+ib_restore_tablespaces("test", "t1");
+EOF
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+
+SHOW INDEXES FROM t1;
+
+ANALYZE TABLE t1;
+SHOW INDEXES FROM t1;
+
+DROP TABLE t1;
+
+SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table;
+
+--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.ibd
+--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.cfg
--- /dev/null
+--echo # INPLACE ALTER WITH INPLACE_IGNORE FLAG AND CHANGE CREATE OPTION
+
+--echo # CHANGE THE COLUMN DEFAULT (INPLACE_IGNORE)
+--echo # AND TABLE CHARSET(CHANGE CREATE)
+
+CREATE TABLE t1(
+ id INT PRIMARY KEY,
+ f1 INT NOT NULL DEFAULT 0)ENGINE=INNODB;
+
+INSERT INTO t1 VALUES(1, 2);
+
+let id_before_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+ALTER TABLE t1 MODIFY COLUMN f1 INT NOT NULL DEFAULT 0,
+ DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+
+let id_after_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+if ($id_before_alter != $id_after_alter)
+{
+ --echo "Table rebuild happened";
+}
+
+DROP TABLE t1;
+
+--echo # CHANGE THE STORAGE TYPE OF COLUMN(INPLACE IGNORE)
+--echo # AND TABLE CHARSET(CHANGE CREATE)
+
+CREATE TABLE t1(
+ id INT STORAGE DISK)ENGINE=INNODB;
+
+INSERT INTO t1 values(1);
+
+let id_before_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+ALTER TABLE t1 MODIFY COLUMN id INT STORAGE MEMORY,
+ DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+
+let id_after_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+if ($id_before_alter != $id_after_alter)
+{
+ --echo "Table rebuild happened";
+}
+
+DROP TABLE t1;
+
+--echo # RENAME THE TABLE(INPLACE IGNORE)
+--echo # AND CHANGE TABLE CHARSET(CHANGE CREATE)
+
+CREATE TABLE t1(
+ f1 INT NOT NULL,
+ f2 INT NOT NULL)ENGINE=INNODB;
+
+INSERT INTO t1 VALUES(1, 2);
+
+let id_before_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`;
+
+ALTER TABLE t1 RENAME t2, DEFAULT CHARSET=latin1, ALGORITHM=INPLACE;
+
+let id_after_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t2"`;
+
+if ($id_before_alter != $id_after_alter)
+{
+ --echo "Table rebuild happened";
+}
+
+DROP TABLE t2;
let $args=--loose-console > $SEARCH_FILE 2>&1;
# Stop the server
+SET GLOBAL innodb_fast_shutdown=0;
let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
--exec echo "wait" > $restart_file
--shutdown_server
SHOW CREATE TABLE table_54044;
DROP TABLE table_54044;
-# These 'create table' operations should fail because of
-# using NULL datatype
+# This 'create table' should pass since it uses a Field_string of size 0.
-CREATE TABLE tmp ENGINE = INNODB AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
+CREATE TABLE tmp ENGINE = INNODB
+ AS SELECT COALESCE(NULL, NULL, NULL), GREATEST(NULL, NULL), NULL;
SHOW CREATE TABLE tmp;
DROP TABLE tmp;
-
--- /dev/null
+--innodb-autoinc-lock-mode=0
--- /dev/null
+--source include/have_debug.inc
+--source include/have_innodb.inc
+--source include/have_debug_sync.inc
+--source include/count_sessions.inc
+
+--echo #
+--echo # Bug #21983865 UNEXPECTED DEADLOCK WITH INNODB_AUTOINC_LOCK_MODE=0
+--echo #
+
+create table t1(f1 int not null auto_increment primary key) engine=innodb;
+
+--echo # Hold autoinc_lock on table t1 from connection con1
+connect (con1, localhost, root);
+set debug_sync='ib_after_row_insert SIGNAL others WAIT_FOR continue_others';
+--send insert into t1 values(NULL)
+
+connection default;
+--echo # Create 40 connections and make it to wait for autoinc_lock on table t1.
+--disable_query_log
+set debug_sync='now WAIT_FOR others';
+let $1=2;
+while ($1 < 40) {
+ connect (con$1,localhost,root);
+ --send insert into t1 values(NULL)
+ inc $1;
+ connection default;
+}
+
+connect (con40,localhost,root);
+--enable_query_log
+--echo # Release the auto_inc lock on table t1 for connection con1
+set debug_sync='now SIGNAL continue_others';
+
+--echo # Now all 40 connections can finish the insert operation on t1.
+let $1=1;
+connection default;
+disconnect con40;
+while ($1 < 40) {
+ connection con$1;
+ --reap
+ connection default;
+ disconnect con$1;
+ inc $1;
+}
+
+drop table t1;
+--source include/wait_until_count_sessions.inc
--- /dev/null
+--innodb_stats_include_delete_marked=on
--- /dev/null
+--echo #
+--echo # Bug 23333990 PERSISTENT INDEX STATISTICS UPDATE BEFORE
+--echo # TRANSACTION IS COMMITTED
+--echo #
+
+--source include/big_test.inc
+--source include/not_valgrind.inc
+
+--echo "Test 1:- Uncommited delete test"
+CREATE TABLE t1 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ val INT UNSIGNED NOT NULL,
+ INDEX (val)) ENGINE=INNODB
+ STATS_PERSISTENT=1,STATS_AUTO_RECALC=1;
+
+
+INSERT INTO t1 (val) VALUES (4);
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+INSERT INTO t1 (val) SELECT VAL from t1;
+SELECT COUNT(*) FROM t1;
+
+connect(con1, localhost, root,,);
+
+--echo Connection 1
+connection con1;
+START TRANSACTION;
+DELETE FROM t1;
+send SELECT COUNT(*) FROM t1;
+
+--echo Connection Default
+connection default;
+# To make test determinstic in case stats calculation is not
+# triggered we will call analyze table
+analyze table t1;
+let $row_count= query_get_value(EXPLAIN SELECT * FROM t1 WHERE val=4, rows,1);
+if ($row_count > 20000)
+{
+--echo Test correctly estimates the number of rows as > 20000
+--echo even when in other uncommmited transaction
+--echo all rows have been deleted.
+}
+
+if ($row_count < 20000)
+{
+--echo FAIL row count is $row_count
+}
+--echo Connection 1
+connection con1;
+reap;
+commit;
+
+--echo Connection deafult
+connection default;
+
+--echo Test 2:- Insert and rollback test
+CREATE TABLE t2 (id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ val INT UNSIGNED NOT NULL,
+ INDEX (val)) ENGINE=INNODB
+ STATS_PERSISTENT=1,STATS_AUTO_RECALC=1;
+
+--echo Connection 1
+connection con1;
+
+START TRANSACTION;
+
+INSERT INTO t2 (val) VALUES (4);
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+INSERT INTO t2 (val) SELECT VAL from t2;
+send SELECT COUNT(*) FROM t2;
+
+--echo Connection default
+connection default;
+select count(*) from t2;
+analyze table t2;
+let $row_count= query_get_value(EXPLAIN SELECT * FROM t2 WHERE val=4, rows,1);
+if ($row_count > 20000)
+{
+--echo Test correctly estimates the number of rows as > 20000
+--echo even when in other uncommited transaction
+--echo many rows are inserted.
+}
+
+--echo Connection 1
+connection con1;
+reap;
+--echo Rollback the insert
+rollback;
+
+--echo Connection default
+connection default;
+let $row_count= query_get_value(EXPLAIN SELECT * FROM t2 WHERE val=4, rows,1);
+if ($row_count <= 1)
+{
+--echo Test correctly estimates the number of rows as $row_count
+--echo after rollback.
+}
+
+disconnect con1;
+DROP TABLE t1,t2;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
-- enable_warnings
+
+--echo #
+--echo # Bug#22576241 SETTING INNODB_MONITOR_ENABLE TO ALL DOES NOT ENABLE ALL
+--echo # MONITORS
+--echo #
+CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+
+let $innodb_monitor_enable = `SELECT @@innodb_monitor_enable`;
+
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_enable='module_buffer_page';
+INSERT INTO t1 VALUES (1), (2), (3), (4); FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_disable='module_buffer_page';
+SET GLOBAL innodb_monitor_reset_all='module_buffer_page';
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_enable='%';
+INSERT INTO t1 VALUES (5), (6), (7), (8); FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_disable='%';
+SET GLOBAL innodb_monitor_reset_all='%';
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+SET GLOBAL innodb_monitor_enable='ALL';
+INSERT INTO t1 VALUES (9), (10), (11), (12); FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+--replace_regex /[1-9]/NNNN/
+SELECT NAME, COUNT FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE NAME
+LIKE 'buffer_page_written_index_leaf';
+
+--disable_warnings
+SET GLOBAL innodb_monitor_enable=default;
+SET GLOBAL innodb_monitor_disable=default;
+SET GLOBAL innodb_monitor_reset_all=default;
+--enable_warnings
+
+DROP TABLE t1;
AGAINST ('"more test proximity"' IN BOOLEAN MODE);
id title body
drop table articles;
+#
+# Bug #22679185 INVALID INNODB FTS DOC ID DURING INSERT
+#
+create table t1 (f1 int not null primary key, f2 varchar(100),
+FTS_DOC_ID bigint(20) unsigned not null,
+unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
+fulltext key (f2))engine=innodb;
+insert into t1 values(1, "This is the first record", 20000);
+insert into t1 values(2, "This is the second record", 40000);
+select FTS_DOC_ID from t1;
+FTS_DOC_ID
+20000
+40000
+drop table t1;
+create table t1 (f1 int not null primary key, f2 varchar(100),
+FTS_DOC_ID bigint(20) unsigned not null auto_increment,
+unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
+fulltext key (f2))engine=innodb, auto_increment=100000;
+set auto_increment_increment = 65535;
+insert into t1(f1, f2) values(1, "This is the first record");
+insert into t1(f1, f2) values(2, "This is the second record");
+insert into t1(f1, f2) values(3, "This is the third record");
+select FTS_DOC_ID from t1;
+FTS_DOC_ID
+131071
+196606
+262141
+drop table t1;
1 database
2 mysql
DROP TABLE t1;
+# Case 4: Test sync commit & rollback in background
+CREATE TABLE t1(
+id INT AUTO_INCREMENT,
+title VARCHAR(100),
+FULLTEXT(title),
+PRIMARY KEY(id)) ENGINE=InnoDB;
+SET SESSION debug="+d,fts_instrument_sync";
+INSERT INTO t1(title) VALUES('mysql');
+SET SESSION debug="-d,fts_instrument_sync";
+SET GLOBAL debug="+d,fts_instrument_sync,fts_instrument_sync_interrupted";
+INSERT INTO t1(title) VALUES('database');
+SET GLOBAL debug="-d,fts_instrument_sync,fts_instrument_sync_interrupted";
+SET SESSION debug="+d,fts_instrument_sync_debug";
+INSERT INTO t1(title) VALUES('good');
+SET SESSION debug="-d,fts_instrument_sync_debug";
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
+database 2 2 1 2 0
+good 3 3 1 3 0
+mysql 1 1 1 1 0
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
+SET GLOBAL innodb_ft_aux_table=default;
+SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database good');
+id title
+1 mysql
+2 database
+3 good
+DROP TABLE t1;
AGAINST ('"more test proximity"' IN BOOLEAN MODE);
drop table articles;
+
+--echo #
+--echo # Bug #22679185 INVALID INNODB FTS DOC ID DURING INSERT
+--echo #
+
+create table t1 (f1 int not null primary key, f2 varchar(100),
+ FTS_DOC_ID bigint(20) unsigned not null,
+ unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
+ fulltext key (f2))engine=innodb;
+
+insert into t1 values(1, "This is the first record", 20000);
+insert into t1 values(2, "This is the second record", 40000);
+select FTS_DOC_ID from t1;
+drop table t1;
+
+
+create table t1 (f1 int not null primary key, f2 varchar(100),
+ FTS_DOC_ID bigint(20) unsigned not null auto_increment,
+ unique key `FTS_DOC_ID_INDEX` (`FTS_DOC_ID`),
+ fulltext key (f2))engine=innodb, auto_increment=100000;
+
+set auto_increment_increment = 65535;
+insert into t1(f1, f2) values(1, "This is the first record");
+insert into t1(f1, f2) values(2, "This is the second record");
+insert into t1(f1, f2) values(3, "This is the third record");
+select FTS_DOC_ID from t1;
+drop table t1;
--echo # Case 3: Test insert crash recovery
--let $_expect_file_name=$MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
-connect (con1,localhost,root,,);
-
CREATE TABLE t1 (
FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
DROP TABLE t1;
+--echo # Case 4: Test sync commit & rollback in background
+CREATE TABLE t1(
+ id INT AUTO_INCREMENT,
+ title VARCHAR(100),
+ FULLTEXT(title),
+ PRIMARY KEY(id)) ENGINE=InnoDB;
+
+SET SESSION debug="+d,fts_instrument_sync";
+INSERT INTO t1(title) VALUES('mysql');
+SET SESSION debug="-d,fts_instrument_sync";
+
+--source include/restart_mysqld.inc
+
+SET GLOBAL debug="+d,fts_instrument_sync,fts_instrument_sync_interrupted";
+INSERT INTO t1(title) VALUES('database');
+SET GLOBAL debug="-d,fts_instrument_sync,fts_instrument_sync_interrupted";
+
+SET SESSION debug="+d,fts_instrument_sync_debug";
+INSERT INTO t1(title) VALUES('good');
+SET SESSION debug="-d,fts_instrument_sync_debug";
+
+SET GLOBAL innodb_ft_aux_table="test/t1";
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
+SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
+SET GLOBAL innodb_ft_aux_table=default;
+
+SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database good');
+
+DROP TABLE t1;
+
--source include/wait_until_count_sessions.inc
HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ;
DROP TABLE t1,t2,t3,t4;
+
+--echo #
+--echo # Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+--echo # INDEX, EVEN THOUGH COST IS HIGHER
+--echo #
+
+CREATE TABLE t1 (
+ a TINYTEXT NOT NULL,
+ b TINYINT(3) UNSIGNED NOT NULL,
+ PRIMARY KEY (a(32),b),
+ KEY b_idx(b)
+) ENGINE=INNODB;
+INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1),
+ ('c',4),('d',3),('e',2),('f',2);
+
+SET @optimizer_switch_saved=@@session.optimizer_switch;
+SET @@session.optimizer_switch=default;
+SET optimizer_trace="enabled=on";
+
+# Uses "access_type_changed" to use range over ref despite b_idx not being the
+# cheapest in range.
+EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2;
+
+# Output of table_scan in test_quick_select is not always reliable.
+--replace_regex /"rows": 12/"rows": 11/ /"cost": 5.5/"cost": 5.3/
+SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+
+SET optimizer_trace="enabled=off";
+SET @@session.optimizer_switch=@optimizer_switch_saved;
+
+DROP TABLE t1;
HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ;
field1 field2 field3 field4
DROP TABLE t1,t2,t3,t4;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE t1 (
+a TINYTEXT NOT NULL,
+b TINYINT(3) UNSIGNED NOT NULL,
+PRIMARY KEY (a(32),b),
+KEY b_idx(b)
+) ENGINE=INNODB;
+INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1),
+('c',4),('d',3),('e',2),('f',2);
+SET @optimizer_switch_saved=@@session.optimizer_switch;
+SET @@session.optimizer_switch=default;
+SET optimizer_trace="enabled=on";
+EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,b_idx b_idx 35 NULL 2 Using index condition; Using where
+SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
+EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2 {
+ "steps": [
+ {
+ "join_preparation": {
+ "select#": 1,
+ "steps": [
+ {
+ "expanded_query": "/* select#1 */ select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where ((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))"
+ }
+ ] /* steps */
+ } /* join_preparation */
+ },
+ {
+ "join_optimization": {
+ "select#": 1,
+ "steps": [
+ {
+ "condition_processing": {
+ "condition": "WHERE",
+ "original_condition": "((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))",
+ "steps": [
+ {
+ "transformation": "equality_propagation",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ },
+ {
+ "transformation": "constant_propagation",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ },
+ {
+ "transformation": "trivial_condition_removal",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ }
+ ] /* steps */
+ } /* condition_processing */
+ },
+ {
+ "table_dependencies": [
+ {
+ "table": "`t1`",
+ "row_may_be_null": false,
+ "map_bit": 0,
+ "depends_on_map_bits": [
+ ] /* depends_on_map_bits */
+ }
+ ] /* table_dependencies */
+ },
+ {
+ "ref_optimizer_key_uses": [
+ {
+ "table": "`t1`",
+ "field": "b",
+ "equals": "2",
+ "null_rejecting": false
+ }
+ ] /* ref_optimizer_key_uses */
+ },
+ {
+ "rows_estimation": [
+ {
+ "table": "`t1`",
+ "range_analysis": {
+ "table_scan": {
+ "rows": 11,
+ "cost": 5.3
+ } /* table_scan */,
+ "potential_range_indices": [
+ {
+ "index": "PRIMARY",
+ "usable": true,
+ "key_parts": [
+ "a",
+ "b"
+ ] /* key_parts */
+ },
+ {
+ "index": "b_idx",
+ "usable": true,
+ "key_parts": [
+ "b",
+ "a"
+ ] /* key_parts */
+ }
+ ] /* potential_range_indices */,
+ "setup_range_conditions": [
+ ] /* setup_range_conditions */,
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not_group_by_or_distinct"
+ } /* group_index_range */,
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "PRIMARY",
+ "ranges": [
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2",
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": true,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 2.41,
+ "chosen": true
+ },
+ {
+ "index": "b_idx",
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 4.41,
+ "chosen": false,
+ "cause": "cost"
+ }
+ ] /* range_scan_alternatives */,
+ "analyzing_roworder_intersect": {
+ "usable": false,
+ "cause": "too_few_roworder_scans"
+ } /* analyzing_roworder_intersect */
+ } /* analyzing_range_alternatives */,
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "PRIMARY",
+ "rows": 2,
+ "ranges": [
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2",
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2"
+ ] /* ranges */
+ } /* range_access_plan */,
+ "rows_for_plan": 2,
+ "cost_for_plan": 2.41,
+ "chosen": true
+ } /* chosen_range_access_summary */
+ } /* range_analysis */
+ }
+ ] /* rows_estimation */
+ },
+ {
+ "considered_execution_plans": [
+ {
+ "plan_prefix": [
+ ] /* plan_prefix */,
+ "table": "`t1`",
+ "best_access_path": {
+ "considered_access_paths": [
+ {
+ "access_type": "ref",
+ "index": "b_idx",
+ "rows": 2,
+ "cost": 2.4,
+ "chosen": true
+ },
+ {
+ "access_type": "range",
+ "rows": 2,
+ "cost": 2.81,
+ "chosen": false
+ }
+ ] /* considered_access_paths */
+ } /* best_access_path */,
+ "cost_for_plan": 2.4,
+ "rows_for_plan": 2,
+ "chosen": true
+ }
+ ] /* considered_execution_plans */
+ },
+ {
+ "attaching_conditions_to_tables": {
+ "original_condition": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))",
+ "attached_conditions_computation": [
+ {
+ "rerunning_range_optimizer_for_single_index": [
+ {
+ "table_scan": {
+ "rows": 11,
+ "cost": 5.3
+ } /* table_scan */,
+ "potential_range_indices": [
+ {
+ "index": "PRIMARY",
+ "usable": false,
+ "cause": "not_applicable"
+ },
+ {
+ "index": "b_idx",
+ "usable": true,
+ "key_parts": [
+ "b",
+ "a"
+ ] /* key_parts */
+ }
+ ] /* potential_range_indices */,
+ "setup_range_conditions": [
+ ] /* setup_range_conditions */,
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not_group_by_or_distinct"
+ } /* group_index_range */,
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "b_idx",
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 4.41,
+ "chosen": true
+ }
+ ] /* range_scan_alternatives */,
+ "analyzing_roworder_intersect": {
+ "usable": false,
+ "cause": "too_few_roworder_scans"
+ } /* analyzing_roworder_intersect */
+ } /* analyzing_range_alternatives */,
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "b_idx",
+ "rows": 2,
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */
+ } /* range_access_plan */,
+ "rows_for_plan": 2,
+ "cost_for_plan": 4.41,
+ "chosen": true
+ } /* chosen_range_access_summary */
+ } /* range_analysis */
+ ] /* rerunning_range_optimizer_for_single_index */
+ },
+ {
+ "access_type_changed": {
+ "table": "`t1`",
+ "index": "b_idx",
+ "old_type": "ref",
+ "new_type": "range",
+ "cause": "uses_more_keyparts"
+ } /* access_type_changed */
+ }
+ ] /* attached_conditions_computation */,
+ "attached_conditions_summary": [
+ {
+ "table": "`t1`",
+ "attached": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))"
+ }
+ ] /* attached_conditions_summary */
+ } /* attaching_conditions_to_tables */
+ },
+ {
+ "refine_plan": [
+ {
+ "table": "`t1`",
+ "pushed_index_condition": "(`t1`.`b` = 2)",
+ "table_condition_attached": "(`t1`.`a` in ('a','b'))",
+ "access_type": "range"
+ }
+ ] /* refine_plan */
+ }
+ ] /* steps */
+ } /* join_optimization */
+ },
+ {
+ "join_explain": {
+ "select#": 1,
+ "steps": [
+ ] /* steps */
+ } /* join_explain */
+ }
+ ] /* steps */
+} 0 0
+SET optimizer_trace="enabled=off";
+SET @@session.optimizer_switch=@optimizer_switch_saved;
+DROP TABLE t1;
HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ;
field1 field2 field3 field4
DROP TABLE t1,t2,t3,t4;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE t1 (
+a TINYTEXT NOT NULL,
+b TINYINT(3) UNSIGNED NOT NULL,
+PRIMARY KEY (a(32),b),
+KEY b_idx(b)
+) ENGINE=INNODB;
+INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1),
+('c',4),('d',3),('e',2),('f',2);
+SET @optimizer_switch_saved=@@session.optimizer_switch;
+SET @@session.optimizer_switch=default;
+SET optimizer_trace="enabled=on";
+EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,b_idx b_idx 35 NULL 2 Using index condition; Using where
+SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
+EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2 {
+ "steps": [
+ {
+ "join_preparation": {
+ "select#": 1,
+ "steps": [
+ {
+ "expanded_query": "/* select#1 */ select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where ((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))"
+ }
+ ] /* steps */
+ } /* join_preparation */
+ },
+ {
+ "join_optimization": {
+ "select#": 1,
+ "steps": [
+ {
+ "condition_processing": {
+ "condition": "WHERE",
+ "original_condition": "((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))",
+ "steps": [
+ {
+ "transformation": "equality_propagation",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ },
+ {
+ "transformation": "constant_propagation",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ },
+ {
+ "transformation": "trivial_condition_removal",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ }
+ ] /* steps */
+ } /* condition_processing */
+ },
+ {
+ "table_dependencies": [
+ {
+ "table": "`t1`",
+ "row_may_be_null": false,
+ "map_bit": 0,
+ "depends_on_map_bits": [
+ ] /* depends_on_map_bits */
+ }
+ ] /* table_dependencies */
+ },
+ {
+ "ref_optimizer_key_uses": [
+ {
+ "table": "`t1`",
+ "field": "b",
+ "equals": "2",
+ "null_rejecting": false
+ }
+ ] /* ref_optimizer_key_uses */
+ },
+ {
+ "rows_estimation": [
+ {
+ "table": "`t1`",
+ "range_analysis": {
+ "table_scan": {
+ "rows": 11,
+ "cost": 5.3
+ } /* table_scan */,
+ "potential_range_indices": [
+ {
+ "index": "PRIMARY",
+ "usable": true,
+ "key_parts": [
+ "a",
+ "b"
+ ] /* key_parts */
+ },
+ {
+ "index": "b_idx",
+ "usable": true,
+ "key_parts": [
+ "b",
+ "a"
+ ] /* key_parts */
+ }
+ ] /* potential_range_indices */,
+ "setup_range_conditions": [
+ ] /* setup_range_conditions */,
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not_group_by_or_distinct"
+ } /* group_index_range */,
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "PRIMARY",
+ "ranges": [
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2",
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": true,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 2.41,
+ "chosen": true
+ },
+ {
+ "index": "b_idx",
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 4.41,
+ "chosen": false,
+ "cause": "cost"
+ }
+ ] /* range_scan_alternatives */,
+ "analyzing_roworder_intersect": {
+ "usable": false,
+ "cause": "too_few_roworder_scans"
+ } /* analyzing_roworder_intersect */
+ } /* analyzing_range_alternatives */,
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "PRIMARY",
+ "rows": 2,
+ "ranges": [
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2",
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2"
+ ] /* ranges */
+ } /* range_access_plan */,
+ "rows_for_plan": 2,
+ "cost_for_plan": 2.41,
+ "chosen": true
+ } /* chosen_range_access_summary */
+ } /* range_analysis */
+ }
+ ] /* rows_estimation */
+ },
+ {
+ "considered_execution_plans": [
+ {
+ "plan_prefix": [
+ ] /* plan_prefix */,
+ "table": "`t1`",
+ "best_access_path": {
+ "considered_access_paths": [
+ {
+ "access_type": "ref",
+ "index": "b_idx",
+ "rows": 2,
+ "cost": 2.4,
+ "chosen": true
+ },
+ {
+ "access_type": "range",
+ "rows": 2,
+ "cost": 2.81,
+ "chosen": false
+ }
+ ] /* considered_access_paths */
+ } /* best_access_path */,
+ "cost_for_plan": 2.4,
+ "rows_for_plan": 2,
+ "chosen": true
+ }
+ ] /* considered_execution_plans */
+ },
+ {
+ "attaching_conditions_to_tables": {
+ "original_condition": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))",
+ "attached_conditions_computation": [
+ {
+ "rerunning_range_optimizer_for_single_index": [
+ {
+ "table_scan": {
+ "rows": 11,
+ "cost": 5.3
+ } /* table_scan */,
+ "potential_range_indices": [
+ {
+ "index": "PRIMARY",
+ "usable": false,
+ "cause": "not_applicable"
+ },
+ {
+ "index": "b_idx",
+ "usable": true,
+ "key_parts": [
+ "b",
+ "a"
+ ] /* key_parts */
+ }
+ ] /* potential_range_indices */,
+ "setup_range_conditions": [
+ ] /* setup_range_conditions */,
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not_group_by_or_distinct"
+ } /* group_index_range */,
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "b_idx",
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 4.41,
+ "chosen": true
+ }
+ ] /* range_scan_alternatives */,
+ "analyzing_roworder_intersect": {
+ "usable": false,
+ "cause": "too_few_roworder_scans"
+ } /* analyzing_roworder_intersect */
+ } /* analyzing_range_alternatives */,
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "b_idx",
+ "rows": 2,
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */
+ } /* range_access_plan */,
+ "rows_for_plan": 2,
+ "cost_for_plan": 4.41,
+ "chosen": true
+ } /* chosen_range_access_summary */
+ } /* range_analysis */
+ ] /* rerunning_range_optimizer_for_single_index */
+ },
+ {
+ "access_type_changed": {
+ "table": "`t1`",
+ "index": "b_idx",
+ "old_type": "ref",
+ "new_type": "range",
+ "cause": "uses_more_keyparts"
+ } /* access_type_changed */
+ }
+ ] /* attached_conditions_computation */,
+ "attached_conditions_summary": [
+ {
+ "table": "`t1`",
+ "attached": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))"
+ }
+ ] /* attached_conditions_summary */
+ } /* attaching_conditions_to_tables */
+ },
+ {
+ "refine_plan": [
+ {
+ "table": "`t1`",
+ "pushed_index_condition": "(`t1`.`b` = 2)",
+ "table_condition_attached": "(`t1`.`a` in ('a','b'))",
+ "access_type": "range"
+ }
+ ] /* refine_plan */
+ }
+ ] /* steps */
+ } /* join_optimization */
+ },
+ {
+ "join_explain": {
+ "select#": 1,
+ "steps": [
+ ] /* steps */
+ } /* join_explain */
+ }
+ ] /* steps */
+} 0 0
+SET optimizer_trace="enabled=off";
+SET @@session.optimizer_switch=@optimizer_switch_saved;
+DROP TABLE t1;
HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ;
field1 field2 field3 field4
DROP TABLE t1,t2,t3,t4;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE t1 (
+a TINYTEXT NOT NULL,
+b TINYINT(3) UNSIGNED NOT NULL,
+PRIMARY KEY (a(32),b),
+KEY b_idx(b)
+) ENGINE=INNODB;
+INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1),
+('c',4),('d',3),('e',2),('f',2);
+SET @optimizer_switch_saved=@@session.optimizer_switch;
+SET @@session.optimizer_switch=default;
+SET optimizer_trace="enabled=on";
+EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,b_idx b_idx 35 NULL 2 Using index condition; Using where
+SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
+EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2 {
+ "steps": [
+ {
+ "join_preparation": {
+ "select#": 1,
+ "steps": [
+ {
+ "expanded_query": "/* select#1 */ select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where ((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))"
+ }
+ ] /* steps */
+ } /* join_preparation */
+ },
+ {
+ "join_optimization": {
+ "select#": 1,
+ "steps": [
+ {
+ "condition_processing": {
+ "condition": "WHERE",
+ "original_condition": "((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))",
+ "steps": [
+ {
+ "transformation": "equality_propagation",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ },
+ {
+ "transformation": "constant_propagation",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ },
+ {
+ "transformation": "trivial_condition_removal",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ }
+ ] /* steps */
+ } /* condition_processing */
+ },
+ {
+ "table_dependencies": [
+ {
+ "table": "`t1`",
+ "row_may_be_null": false,
+ "map_bit": 0,
+ "depends_on_map_bits": [
+ ] /* depends_on_map_bits */
+ }
+ ] /* table_dependencies */
+ },
+ {
+ "ref_optimizer_key_uses": [
+ {
+ "table": "`t1`",
+ "field": "b",
+ "equals": "2",
+ "null_rejecting": false
+ }
+ ] /* ref_optimizer_key_uses */
+ },
+ {
+ "rows_estimation": [
+ {
+ "table": "`t1`",
+ "range_analysis": {
+ "table_scan": {
+ "rows": 11,
+ "cost": 5.3
+ } /* table_scan */,
+ "potential_range_indices": [
+ {
+ "index": "PRIMARY",
+ "usable": true,
+ "key_parts": [
+ "a",
+ "b"
+ ] /* key_parts */
+ },
+ {
+ "index": "b_idx",
+ "usable": true,
+ "key_parts": [
+ "b",
+ "a"
+ ] /* key_parts */
+ }
+ ] /* potential_range_indices */,
+ "setup_range_conditions": [
+ ] /* setup_range_conditions */,
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not_group_by_or_distinct"
+ } /* group_index_range */,
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "PRIMARY",
+ "ranges": [
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2",
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": true,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 2.41,
+ "chosen": true
+ },
+ {
+ "index": "b_idx",
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 4.41,
+ "chosen": false,
+ "cause": "cost"
+ }
+ ] /* range_scan_alternatives */,
+ "analyzing_roworder_intersect": {
+ "usable": false,
+ "cause": "too_few_roworder_scans"
+ } /* analyzing_roworder_intersect */
+ } /* analyzing_range_alternatives */,
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "PRIMARY",
+ "rows": 2,
+ "ranges": [
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2",
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2"
+ ] /* ranges */
+ } /* range_access_plan */,
+ "rows_for_plan": 2,
+ "cost_for_plan": 2.41,
+ "chosen": true
+ } /* chosen_range_access_summary */
+ } /* range_analysis */
+ }
+ ] /* rows_estimation */
+ },
+ {
+ "considered_execution_plans": [
+ {
+ "plan_prefix": [
+ ] /* plan_prefix */,
+ "table": "`t1`",
+ "best_access_path": {
+ "considered_access_paths": [
+ {
+ "access_type": "ref",
+ "index": "b_idx",
+ "rows": 2,
+ "cost": 2.4,
+ "chosen": true
+ },
+ {
+ "access_type": "range",
+ "rows": 2,
+ "cost": 2.81,
+ "chosen": false
+ }
+ ] /* considered_access_paths */
+ } /* best_access_path */,
+ "cost_for_plan": 2.4,
+ "rows_for_plan": 2,
+ "chosen": true
+ }
+ ] /* considered_execution_plans */
+ },
+ {
+ "attaching_conditions_to_tables": {
+ "original_condition": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))",
+ "attached_conditions_computation": [
+ {
+ "rerunning_range_optimizer_for_single_index": [
+ {
+ "table_scan": {
+ "rows": 11,
+ "cost": 5.3
+ } /* table_scan */,
+ "potential_range_indices": [
+ {
+ "index": "PRIMARY",
+ "usable": false,
+ "cause": "not_applicable"
+ },
+ {
+ "index": "b_idx",
+ "usable": true,
+ "key_parts": [
+ "b",
+ "a"
+ ] /* key_parts */
+ }
+ ] /* potential_range_indices */,
+ "setup_range_conditions": [
+ ] /* setup_range_conditions */,
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not_group_by_or_distinct"
+ } /* group_index_range */,
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "b_idx",
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 4.41,
+ "chosen": true
+ }
+ ] /* range_scan_alternatives */,
+ "analyzing_roworder_intersect": {
+ "usable": false,
+ "cause": "too_few_roworder_scans"
+ } /* analyzing_roworder_intersect */
+ } /* analyzing_range_alternatives */,
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "b_idx",
+ "rows": 2,
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */
+ } /* range_access_plan */,
+ "rows_for_plan": 2,
+ "cost_for_plan": 4.41,
+ "chosen": true
+ } /* chosen_range_access_summary */
+ } /* range_analysis */
+ ] /* rerunning_range_optimizer_for_single_index */
+ },
+ {
+ "access_type_changed": {
+ "table": "`t1`",
+ "index": "b_idx",
+ "old_type": "ref",
+ "new_type": "range",
+ "cause": "uses_more_keyparts"
+ } /* access_type_changed */
+ }
+ ] /* attached_conditions_computation */,
+ "attached_conditions_summary": [
+ {
+ "table": "`t1`",
+ "attached": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))"
+ }
+ ] /* attached_conditions_summary */
+ } /* attaching_conditions_to_tables */
+ },
+ {
+ "refine_plan": [
+ {
+ "table": "`t1`",
+ "pushed_index_condition": "(`t1`.`b` = 2)",
+ "table_condition_attached": "(`t1`.`a` in ('a','b'))",
+ "access_type": "range"
+ }
+ ] /* refine_plan */
+ }
+ ] /* steps */
+ } /* join_optimization */
+ },
+ {
+ "join_explain": {
+ "select#": 1,
+ "steps": [
+ ] /* steps */
+ } /* join_explain */
+ }
+ ] /* steps */
+} 0 0
+SET optimizer_trace="enabled=off";
+SET @@session.optimizer_switch=@optimizer_switch_saved;
+DROP TABLE t1;
HAVING alias1.col_int_nokey IN ( SELECT 2 FROM DUAL ) ;
field1 field2 field3 field4
DROP TABLE t1,t2,t3,t4;
+#
+# Bug #23259872: OPTIMIZER CHOOSES TO USE NON PRIMARY
+# INDEX, EVEN THOUGH COST IS HIGHER
+#
+CREATE TABLE t1 (
+a TINYTEXT NOT NULL,
+b TINYINT(3) UNSIGNED NOT NULL,
+PRIMARY KEY (a(32),b),
+KEY b_idx(b)
+) ENGINE=INNODB;
+INSERT INTO t1 VALUES ('a',1),('a',2),('a',3),('b',1),('b',4),('c',1),('d',1),
+('c',4),('d',3),('e',2),('f',2);
+SET @optimizer_switch_saved=@@session.optimizer_switch;
+SET @@session.optimizer_switch=default;
+SET optimizer_trace="enabled=on";
+EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,b_idx b_idx 35 NULL 2 Using index condition; Using where
+SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
+EXPLAIN SELECT * FROM t1 WHERE a IN ('a', 'b') AND b = 2 {
+ "steps": [
+ {
+ "join_preparation": {
+ "select#": 1,
+ "steps": [
+ {
+ "expanded_query": "/* select#1 */ select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where ((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))"
+ }
+ ] /* steps */
+ } /* join_preparation */
+ },
+ {
+ "join_optimization": {
+ "select#": 1,
+ "steps": [
+ {
+ "condition_processing": {
+ "condition": "WHERE",
+ "original_condition": "((`t1`.`a` in ('a','b')) and (`t1`.`b` = 2))",
+ "steps": [
+ {
+ "transformation": "equality_propagation",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ },
+ {
+ "transformation": "constant_propagation",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ },
+ {
+ "transformation": "trivial_condition_removal",
+ "resulting_condition": "((`t1`.`a` in ('a','b')) and multiple equal(2, `t1`.`b`))"
+ }
+ ] /* steps */
+ } /* condition_processing */
+ },
+ {
+ "table_dependencies": [
+ {
+ "table": "`t1`",
+ "row_may_be_null": false,
+ "map_bit": 0,
+ "depends_on_map_bits": [
+ ] /* depends_on_map_bits */
+ }
+ ] /* table_dependencies */
+ },
+ {
+ "ref_optimizer_key_uses": [
+ {
+ "table": "`t1`",
+ "field": "b",
+ "equals": "2",
+ "null_rejecting": false
+ }
+ ] /* ref_optimizer_key_uses */
+ },
+ {
+ "rows_estimation": [
+ {
+ "table": "`t1`",
+ "range_analysis": {
+ "table_scan": {
+ "rows": 11,
+ "cost": 5.3
+ } /* table_scan */,
+ "potential_range_indices": [
+ {
+ "index": "PRIMARY",
+ "usable": true,
+ "key_parts": [
+ "a",
+ "b"
+ ] /* key_parts */
+ },
+ {
+ "index": "b_idx",
+ "usable": true,
+ "key_parts": [
+ "b",
+ "a"
+ ] /* key_parts */
+ }
+ ] /* potential_range_indices */,
+ "setup_range_conditions": [
+ ] /* setup_range_conditions */,
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not_group_by_or_distinct"
+ } /* group_index_range */,
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "PRIMARY",
+ "ranges": [
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2",
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": true,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 2.41,
+ "chosen": true
+ },
+ {
+ "index": "b_idx",
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 4.41,
+ "chosen": false,
+ "cause": "cost"
+ }
+ ] /* range_scan_alternatives */,
+ "analyzing_roworder_intersect": {
+ "usable": false,
+ "cause": "too_few_roworder_scans"
+ } /* analyzing_roworder_intersect */
+ } /* analyzing_range_alternatives */,
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "PRIMARY",
+ "rows": 2,
+ "ranges": [
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2",
+ "unprintable_blob_value <= a <= unprintable_blob_value AND 2 <= b <= 2"
+ ] /* ranges */
+ } /* range_access_plan */,
+ "rows_for_plan": 2,
+ "cost_for_plan": 2.41,
+ "chosen": true
+ } /* chosen_range_access_summary */
+ } /* range_analysis */
+ }
+ ] /* rows_estimation */
+ },
+ {
+ "considered_execution_plans": [
+ {
+ "plan_prefix": [
+ ] /* plan_prefix */,
+ "table": "`t1`",
+ "best_access_path": {
+ "considered_access_paths": [
+ {
+ "access_type": "ref",
+ "index": "b_idx",
+ "rows": 2,
+ "cost": 2.4,
+ "chosen": true
+ },
+ {
+ "access_type": "range",
+ "rows": 2,
+ "cost": 2.81,
+ "chosen": false
+ }
+ ] /* considered_access_paths */
+ } /* best_access_path */,
+ "cost_for_plan": 2.4,
+ "rows_for_plan": 2,
+ "chosen": true
+ }
+ ] /* considered_execution_plans */
+ },
+ {
+ "attaching_conditions_to_tables": {
+ "original_condition": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))",
+ "attached_conditions_computation": [
+ {
+ "rerunning_range_optimizer_for_single_index": [
+ {
+ "table_scan": {
+ "rows": 11,
+ "cost": 5.3
+ } /* table_scan */,
+ "potential_range_indices": [
+ {
+ "index": "PRIMARY",
+ "usable": false,
+ "cause": "not_applicable"
+ },
+ {
+ "index": "b_idx",
+ "usable": true,
+ "key_parts": [
+ "b",
+ "a"
+ ] /* key_parts */
+ }
+ ] /* potential_range_indices */,
+ "setup_range_conditions": [
+ ] /* setup_range_conditions */,
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not_group_by_or_distinct"
+ } /* group_index_range */,
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "b_idx",
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */,
+ "index_dives_for_eq_ranges": true,
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 2,
+ "cost": 4.41,
+ "chosen": true
+ }
+ ] /* range_scan_alternatives */,
+ "analyzing_roworder_intersect": {
+ "usable": false,
+ "cause": "too_few_roworder_scans"
+ } /* analyzing_roworder_intersect */
+ } /* analyzing_range_alternatives */,
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "b_idx",
+ "rows": 2,
+ "ranges": [
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value",
+ "2 <= b <= 2 AND unprintable_blob_value <= a <= unprintable_blob_value"
+ ] /* ranges */
+ } /* range_access_plan */,
+ "rows_for_plan": 2,
+ "cost_for_plan": 4.41,
+ "chosen": true
+ } /* chosen_range_access_summary */
+ } /* range_analysis */
+ ] /* rerunning_range_optimizer_for_single_index */
+ },
+ {
+ "access_type_changed": {
+ "table": "`t1`",
+ "index": "b_idx",
+ "old_type": "ref",
+ "new_type": "range",
+ "cause": "uses_more_keyparts"
+ } /* access_type_changed */
+ }
+ ] /* attached_conditions_computation */,
+ "attached_conditions_summary": [
+ {
+ "table": "`t1`",
+ "attached": "((`t1`.`b` = 2) and (`t1`.`a` in ('a','b')))"
+ }
+ ] /* attached_conditions_summary */
+ } /* attaching_conditions_to_tables */
+ },
+ {
+ "refine_plan": [
+ {
+ "table": "`t1`",
+ "pushed_index_condition": "(`t1`.`b` = 2)",
+ "table_condition_attached": "(`t1`.`a` in ('a','b'))",
+ "access_type": "range"
+ }
+ ] /* refine_plan */
+ }
+ ] /* steps */
+ } /* join_optimization */
+ },
+ {
+ "join_explain": {
+ "select#": 1,
+ "steps": [
+ ] /* steps */
+ } /* join_explain */
+ }
+ ] /* steps */
+} 0 0
+SET optimizer_trace="enabled=off";
+SET @@session.optimizer_switch=@optimizer_switch_saved;
+DROP TABLE t1;
--- /dev/null
+#!/usr/bin/perl
+use strict;
+use JSON;
+use File::Spec::Functions qw/ canonpath /;
+my $usage = "This is from WL#5257 \"first API for optimizer trace\".
+
+Usage:
+ %s [-q] <a_file> <another_file> <etc>
+
+ -q quiet mode: only display errors and warnings.
+
+It will verify that all optimizer traces of files (usually a_file
+is a .result or .reject file which contains
+SELECT * FROM OPTIMIZER_TRACE; ) are JSON-compliant, and that
+they contain no duplicates keys.
+Exit code is 0 if all ok.";
+my $retcode = 0;
+my @ignored;
+my @input = @ARGV;
+
+# Filter out "-q" options
+@input = grep {!/-q/} @input;
+
+if (!@input)
+{
+ print "$usage\n";
+ exit 1;
+}
+
+# If command line contains at least one "-q" option, it is quiet mode
+my $quiet= scalar(@input) <= scalar(@ARGV) -1;
+# On Windows, command line arguments specified using wildcards need to be evaluated.
+# On Unix too if the arguments are passed with single quotes.
+my $need_parse = grep(/\*/,@input);
+if ($need_parse)
+{
+ my $platform_independent_dir;
+ $platform_independent_dir= canonpath "@input";
+ @input= glob "$platform_independent_dir";
+}
+
+foreach my $input_file (@input)
+{
+ handle_one_file($input_file);
+ print "\n";
+}
+
+if ( @ignored )
+{
+ print STDERR "These files have been ignored:\n";
+ foreach my $ig ( @ignored )
+ {
+ print "$ig\n";
+ }
+ print "\n";
+}
+if ( $retcode )
+{
+ print STDERR "There are errors\n";
+}
+
+else
+{
+ print "\n";
+ print "ALL OK\n";
+}
+
+exit $retcode;
+
+sub handle_one_file {
+
+ my ( $input_file ) = @_;
+ if ( $input_file =~ /^.*(ctype_.*|mysqldump)\.result/ )
+ {
+ push @ignored ,$input_file;
+ return;
+ }
+ print "FILE $input_file\n";
+ print "\n";
+ open(DATA,"<$input_file") or die "Can't open file";
+ my @lines = <DATA>;
+ close(DATA);
+ my $first_trace_line = 0;
+ my $trace_line = 0;
+ my @trace = undef;
+ label_to: foreach my $i ( @lines )
+ {
+ $trace_line = $trace_line + 1;
+ if (( grep(/^.*(\t)?{\n/,$i) ) and ( $first_trace_line == 0 ))
+ {
+ @trace = undef;
+ $first_trace_line = $trace_line;
+ push @trace, "{\n";
+ next label_to;
+ }
+ if (( $i =~ /^}/ ) and ( $first_trace_line != 0))
+ {
+ push @trace, "}";
+ check($first_trace_line,@trace);
+ $first_trace_line = 0;
+ }
+ if ( $first_trace_line != 0 )
+ {
+ # Eliminate /* */ from end_marker=on (not valid JSON)
+ $i =~ s/\/\*.*\*\// /g;
+ push @trace, $i;
+ }
+
+ }
+}
+
+
+sub check {
+
+ my ( $first_trace_line, @trace ) = @_;
+ my $string = join("", @trace);
+ my $parsed;
+ eval { $parsed = decode_json($string); };
+ unless ( $parsed )
+ {
+ print "Parse error at line: $first_trace_line\n";
+ my $error = $@;
+ print "Error: $@\n";
+ # If there is a character position specified, put a mark ('&') in front of this character
+ if ($error =~ /invalid character.*at character offset (\d+)/)
+ {
+ substr($string,$1,0) = "&";
+ print "$string\n";
+ }
+ else
+ {
+ print "$string\n";
+ }
+ $retcode = 1;
+ print "\n";
+ return;
+ }
+ # Detect non-unique keys in one object, by counting
+ # number of quote symbols ("): the json module outputs only
+ # one of the non-unique keys, making the number of "
+ # smaller compared to the input string.
+
+ my $before = $string =~ tr/'"'//;
+ my $re_json;
+ $re_json= to_json($parsed);
+ my $after = $re_json =~ tr/'"'//;
+ if ( $before != $after )
+ {
+ print "Non-unique keys at line $first_trace_line ( $before vs $after )\n";
+ print "$string\n";
+ $retcode = 1;
+ print "\n";
+ return;
+ }
+ if ( !$quiet )
+ {
+ print "OK at line $first_trace_line\n";
+ }
+}
GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+--echo # FILE is needed to use the DATA DIRECTORY or INDEX DIRECTORY option
+GRANT FILE ON *.* TO test_user_2 IDENTIFIED BY 'testpw';
+
connect (session1, localhost, test_user_1,'testpw',test);
--sorted_result
SELECT * FROM t1 PARTITION (`p0-29`);
INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+# FILE is needed to use the DATA DIRECTORY or INDEX DIRECTORY option
+GRANT FILE ON *.* TO test_user_2 IDENTIFIED BY 'testpw';
connect session1, localhost, test_user_1,'testpw',test;
SELECT * FROM t1 PARTITION (`p0-29`);
a b
INSERT INTO t1 PARTITION (`p3000-299999`, subp14) VALUES (299999, '(p3000-299999-)subp14');
GRANT ALL PRIVILEGES ON test.* TO test_user_1 IDENTIFIED BY 'testpw';
GRANT ALL PRIVILEGES ON test.* TO test_user_2 IDENTIFIED BY 'testpw';
+# FILE is needed to use the DATA DIRECTORY or INDEX DIRECTORY option
+GRANT FILE ON *.* TO test_user_2 IDENTIFIED BY 'testpw';
connect session1, localhost, test_user_1,'testpw',test;
SELECT * FROM t1 PARTITION (`p0-29`);
a b
--- /dev/null
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t (i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+include/sync_slave_sql_with_master.inc
+SET @save_debug=@@debug;
+SET GLOBAL DEBUG='+d,die_if_autoinc_old_lock_style_used';
+[connection master]
+INSERT INTO t VALUES (1);
+DROP TABLE t;
+include/sync_slave_sql_with_master.inc
+SET GLOBAL DEBUG=@save_debug;
+include/rpl_end.inc
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
select * from t9;
a b c d e f g h i
-1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
-2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
-3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+1 b1b1b1b1b1b1b1b1 Kyle CURRENT_TIMESTAMP 0 NULL NULL
+2 b1b1b1b1b1b1b1b1 JOE CURRENT_TIMESTAMP 0 NULL NULL
+3 b1b1b1b1b1b1b1b1 QA CURRENT_TIMESTAMP 0 NULL NULL
+include/assert.inc [The values of column 'd' should have non-zero timetsamp.]
DROP TABLE t9;
*** Create t10 on slave ***
STOP SLAVE;
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
select * from t9;
a b c d e f g h i
-1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
-2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
-3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+1 b1b1b1b1b1b1b1b1 Kyle CURRENT_TIMESTAMP 0 NULL NULL
+2 b1b1b1b1b1b1b1b1 JOE CURRENT_TIMESTAMP 0 NULL NULL
+3 b1b1b1b1b1b1b1b1 QA CURRENT_TIMESTAMP 0 NULL NULL
+include/assert.inc [The values of column 'd' should have non-zero timetsamp.]
DROP TABLE t9;
*** Create t10 on slave ***
STOP SLAVE;
--- /dev/null
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+#### I. Initialize ####
+[connection slave]
+include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+set @@global.innodb_lock_wait_timeout=5 + 1000;
+include/start_slave.inc
+[connection master]
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+#### II. Prepare test scenario ####
+include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local');
+INSERT INTO d1.t VALUES (3, 'Slave local');
+[connection master]
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3');
+INSERT INTO d2.t VALUES (3, 'T4');
+INSERT INTO d1.t VALUES (2, 'T5');
+[connection slave1]
+# Now d1.t has two rows and d2.t has one row.
+[connection slave]
+CALL mtr.add_suppression("Recovery from master pos");
+include/rpl_start_server.inc [server_number=2 parameters: --skip_slave_start=FALSE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+After restart gaps should be filled.
+include/assert.inc [Table d1.t should contain 2 rows.]
+include/assert.inc [Table d2.t should contain 3 rows.]
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:d1.t, slave:d1.t]
+include/diff_tables.inc [master:d2.t, slave:d2.t]
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
+#### I. Initialize ####
+[connection slave]
+include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+set @@global.innodb_lock_wait_timeout=5 + 1000;
+include/start_slave.inc
+[connection master]
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+#### II. Prepare test scenario ####
+include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local');
+INSERT INTO d1.t VALUES (3, 'Slave local');
+[connection master]
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3');
+INSERT INTO d2.t VALUES (3, 'T4');
+INSERT INTO d1.t VALUES (2, 'T5');
+[connection slave1]
+# Now d1.t has two rows and d2.t has one row.
+[connection slave]
+CALL mtr.add_suppression("Recovery from master pos");
+include/rpl_start_server.inc [server_number=2 parameters: --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+After restart gaps should be filled.
+include/assert.inc [Table d1.t should contain 2 rows.]
+include/assert.inc [Table d2.t should contain 3 rows.]
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:d1.t, slave:d1.t]
+include/diff_tables.inc [master:d2.t, slave:d2.t]
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
+include/rpl_end.inc
--- /dev/null
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+call mtr.add_suppression("Duplicate entry*");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+call mtr.add_suppression("Failed to initialize the master info structure");
+call mtr.add_suppression("Slave failed to initialize relay log info*");
+call mtr.add_suppression("MTS recovery: automatic recovery failed.*");
+call mtr.add_suppression("Recovery from master pos");
+#### I. Initialize ####
+[connection slave]
+include/stop_slave.inc
+SET @save.innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout;
+set @@global.innodb_lock_wait_timeout=5 + 1000;
+include/start_slave.inc
+[connection master]
+CREATE DATABASE d1;
+CREATE DATABASE d2;
+CREATE TABLE d1.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+CREATE TABLE d2.t (a INT PRIMARY KEY, name text) ENGINE=INNODB;
+#### II. Prepare test scenario ####
+include/sync_slave_sql_with_master.inc
+BEGIN;
+INSERT INTO d2.t VALUES (2, 'Slave local');
+INSERT INTO d1.t VALUES (3, 'Slave local');
+[connection master]
+INSERT INTO d1.t VALUES (1, 'T1');
+INSERT INTO d2.t VALUES (1, 'T2');
+INSERT INTO d2.t VALUES (2, 'T3');
+INSERT INTO d2.t VALUES (3, 'T4');
+INSERT INTO d1.t VALUES (2, 'T5');
+[connection slave1]
+# Now d1.t has two rows and d2.t has one row.
+[connection slave]
+COMMIT;
+include/wait_for_slave_sql_error.inc [errno=1062]
+include/rpl_restart_server.inc [server_number=2 parameters: --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+[connection slave]
+Relay log recovery should fail as MTS stopped due to an error
+START SLAVE;
+ERROR HY000: Slave failed to initialize relay log info structure from the repository
+Eliminate the cause of MTS error
+DELETE FROM d2.t WHERE a=2;
+DELETE FROM d1.t WHERE a=3;
+include/rpl_restart_server.inc [server_number=2 parameters: --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1]
+MTS recovery should be successful. Check that gaps are filled.
+include/assert.inc [Table d1.t should contain 2 rows.]
+include/assert.inc [Table d2.t should contain 3 rows.]
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+include/diff_tables.inc [master:d1.t, slave:d1.t]
+include/diff_tables.inc [master:d2.t, slave:d2.t]
+[connection master]
+DROP DATABASE d1;
+DROP DATABASE d2;
+include/rpl_end.inc
SELECT @@global.relay_log_recovery as 'must be ON';
must be ON
1
-call mtr.add_suppression("--relay-log-recovery cannot be executed when the slave was stopped with an error or killed in MTS mode; consider using RESET SLAVE or restart the server with --relay-log-recovery = 0");
+call mtr.add_suppression("MTS recovery: automatic recovery failed.*");
call mtr.add_suppression("Failed to initialize the master info structure");
call mtr.add_suppression("It is not possible to change the type of the relay log repository because there are workers repositories with possible execution gaps. The value of --relay_log_info_repository is altered to one of the found Worker repositories");
include/rpl_restart_server.inc [server_number=2 parameters: --skip-slave-start]
include/wait_for_slave_sql_error.inc [errno=1032]
DROP TABLE t;
include/rpl_reset.inc
+CON: 'master', IMG: 'FULL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'slave', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CREATE TABLE t1(id INT PRIMARY KEY, a INT) ENGINE = INNODB;
+include/sync_slave_sql_with_master.inc
+INSERT INTO t1 (id, a) VALUES (1, 1);
+"Case: FULL - EXPLAIN output should not display Using temporary"
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 const 1 Using where
+UPDATE t1 SET a=a+1 WHERE id < 2;
+CON: 'master', IMG: 'NOBLOB', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+CON: 'slave', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image NOBLOB
+"Case: NOBLOB - EXPLAIN output should not display Using temporary"
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 const 1 Using where
+UPDATE t1 SET a=a+1 WHERE id < 2;
+CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+CON: 'slave', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image MINIMAL
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 const 1 Using where
+UPDATE t1 SET a=a+1 WHERE id < 2;
+DROP TABLE t1;
+include/sync_slave_sql_with_master.inc
SET GLOBAL binlog_row_image= @old_binlog_row_image;
SET SESSION binlog_row_image= @old_binlog_row_image;
SET GLOBAL binlog_row_image= @old_binlog_row_image;
--- /dev/null
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+CREATE TABLE t (name VARCHAR(25) DEFAULT NULL) ENGINE=InnoDB;
+include/sync_slave_sql_with_master.inc
+call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t. doesn.t exist., Error_code: 1146");
+call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t. cannot be converted from type.* Error_code: 1677");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+call mtr.add_suppression("Got error 1 during COMMIT");
+ALTER TABLE t CHANGE name name VARCHAR(255);
+[connection master]
+INSERT INTO t VALUE ('Amy');
+# Sync should be successful. Slave should not stop with an error
+# ER_SLAVE_CONVERSION_FAILED. It should be up and running in spite
+# of errors as we have set slave_skip_error=all.
+include/sync_slave_sql_with_master.inc
+DROP TABLE t;
+[connection master]
+UPDATE t SET name='New';
+# Sync should be successful. Slave should not stop with an error
+# ER_NO_SUCH_TABLE. It should be up and running in spite of errors
+# as we have set slave_skip_error=all.
+include/sync_slave_sql_with_master.inc
+# Enable a debug point to simulate failure during rows event cleanup.
+SET @@GLOBAL.DEBUG= 'd,simulate_rows_event_cleanup_failure';
+[connection master]
+UPDATE t SET name='Old';
+[connection slave]
+# Since this is not an ignored error slave should stop. We only ignore the
+# errors that are generated during the execution of an event. The other errors
+# that are generated during commit/rollback failure, which takes place during cleanup
+# cannot be ignored.
+include/wait_for_slave_sql_error.inc [errno=1180]
+==== Clean up ====
+SET @@GLOBAL.DEBUG= '$debug_saved';
+include/stop_slave_io.inc
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+[connection master]
+include/sync_slave_sql_with_master.inc
+[connection master]
+DROP TABLE t;
+include/rpl_end.inc
CALL mtr.add_suppression("Master's UUID has changed, although this should not happen unless you have changed it manually");
CALL mtr.add_suppression("Slave I/O: SET @master_heartbeat_period to master failed with error: Lost connection to MySQL server during query");
CALL mtr.add_suppression("Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error");
-CALL mtr.add_suppression("A slave with the same server_uuid as this slave has connected to the master");
+CALL mtr.add_suppression("A slave with the same server_uuid/server_id as this slave has connected to the master");
include/sync_slave_sql_with_master.inc
# Case 1:
--- /dev/null
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+[connection slave]
+CALL mtr.add_suppression("Relay log read failure");
+SET @save_debug=@@GLOBAL.debug;
+SET GLOBAL debug="d,force_sql_thread_error";
+START SLAVE SQL_THREAD;
+include/wait_for_slave_sql_to_stop.inc
+SET GLOBAL debug=@save_debug;
+include/start_slave.inc
+[connection master]
+CREATE TABLE t1(i INT);
+DROP TABLE t1;
+include/rpl_end.inc
--- /dev/null
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+include/stop_dump_threads.inc
+[connection slave]
+SET @save_debug = @@GLOBAL.debug;
+SET GLOBAL debug="d,fake_5_5_version_slave";
+include/start_slave_io.inc
+include/stop_slave_io.inc
+include/start_slave_io.inc
+[connection master]
+[connection slave]
+SET GLOBAL debug=@save_debug;
+include/rpl_end.inc
rpl_row_binlog_max_cache_size : BUG#14126780 May 29 2012 Vasil Dimov timeout if est number of rows is 3 instead of 4
rpl_test_framework : Too many servers started, so fails under Galera-enabled MTR
rpl_rotate_logs : codership/mysql-wsrep##71 Regression: Duplicate "file was not purged because it is the active log file" warning
-rpl.rpl_gtid_stress_failover : BUG#20630589 2015-10-06 parveez Test needs to be stabilized
--- /dev/null
+###############################################################################
+# Bug#22247668 SLAVE IS ~10X SLOWER TO EXECUTE SET OF STATEMENTS COMPARED TO
+# MASTER RBR
+# Problem: A new style of locking is implemented in Innodb. Starting from 5.6,
+# Innodb uses this new style of locking for all the cases except for the case
+# where for a simple (single/multi) row INSERTs, it fall back to old style
+# locking if another transaction has already acquired the AUTOINC lock on behalf of
+# a LOAD FILE or INSERT...SELECT etc. type of statement. But on
+# Slave, in RBR format, it is always using old style auto inc
+# algorithm.
+#
+# Steps to reproduce:
+# 1) Setup DEBUG simulation point on Slave to bring the server down
+# if the INSERT enters old style autoinc locking method.
+#
+# 2) Execute AUTOINC related work on Master.
+#
+# 3) Make sure that sync on slave happens without any issues.
+#
+###############################################################################
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+# Initial setup
+CREATE TABLE t (i INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+--source include/sync_slave_sql_with_master.inc
+
+# Step-1 : Setup DEBUG simulation point on Slave to bring the server down
+# if the INSERT enters old style autoinc locking method.
+SET @save_debug=@@debug;
+SET GLOBAL DEBUG='+d,die_if_autoinc_old_lock_style_used';
+
+# Step-2 :Execute AUTOINC related work on Master.
+--source include/rpl_connection_master.inc
+INSERT INTO t VALUES (1);
+DROP TABLE t;
+
+# Step-3: Due to above DEBUG simulation point, server will go down if it enters
+# old autoinc lock style. After fix, sync on Slave happens without any issues.
+--source include/sync_slave_sql_with_master.inc
+
+# Cleanup
+# Reset the simulation point on Slave.
+SET GLOBAL DEBUG=@save_debug;
+--source include/rpl_end.inc
--- /dev/null
+--slave-transaction-retries=0 --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1
--- /dev/null
+###############################################################################
+# Bug#21507981: REPLICATION POSITION LOST AFTER CRASH ON MTS CONFIGURED SLAVE
+#
+# Problem:
+# ========
+# Enable MTS along with crash-safe replication tables. Make sure that the
+# server
+# is busily inserting data with multiple threads in parallel. Shutdown mysqld
+# uncleanly (kill -9 or power off server without notice).
+#
+# Now users are restarting the server with --relay-log-recovery=1 to recover
+# the
+# crashed slave.
+#
+# This results in following error:
+# ================================
+# 2015-06-24 13:49:03 3895 [ERROR] --relay-log-recovery cannot
+# be executed when the slave was stopped with an error or
+# killed in MTS mode; consider using RESET SLAVE or restart
+# the server with --relay-log-recovery = 0 followed by
+# START SLAVE UNTIL SQL_AFTER_MTS_GAPS.
+#
+# i.e relay-log-recovery will not work in MTS mode.
+###############################################################################
+# Following test demonstrates that when gaps are generated due to MTS crash
+# but not due to an error then recovery should be successful with
+# --relay-log-recovery=1 option.
+
+--source include/force_restart.inc
+--source include/have_binlog_format_statement.inc
+--source include/only_mts_slave_parallel_workers.inc
+--source include/master-slave.inc
+
+--let $skip_slave_start_var= FALSE
+--source extra/rpl_tests/rpl_mts_relay_log_recovery.test
+
+--let $skip_slave_start_var= TRUE
+--source extra/rpl_tests/rpl_mts_relay_log_recovery.test
+
+--source include/rpl_end.inc
--- /dev/null
+--slave-transaction-retries=0 --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1
--- /dev/null
+###############################################################################
+# Bug#21507981: REPLICATION POSITION LOST AFTER CRASH ON MTS CONFIGURED SLAVE
+#
+# Problem:
+# ========
+# Enable MTS along with crash-safe replication tables. Make sure that the server
+# is busily inserting data with multiple threads in parallel. Shutdown mysqld
+# uncleanly (kill -9 or power off server without notice).
+#
+# Now users are restarting the server with --relay-log-recovery=1 to recover the
+# crashed slave.
+#
+# This results in following error:
+# ================================
+# 2015-06-24 13:49:03 3895 [ERROR] --relay-log-recovery cannot be executed when
+# the slave was stopped with an error or killed in MTS mode; consider using
+# RESET SLAVE or restart the server with --relay-log-recovery = 0 followed by
+# START SLAVE UNTIL SQL_AFTER_MTS_GAPS.
+#
+# i.e relay-log-recovery will not work in MTS mode.
+###############################################################################
+# Following test demonstrates that when a gap is generated because MTS has
+# stopped due to an error then attempting 'relay-log-recovery' will not be
+# successful. Once the route cause of the error is eliminated restarting the
+# recovery with relay-log-recovery=1 should fix the issue.
+#
+# Testing Method:
+# ===============
+# It first creates two databases (d1 and d2) and setup slave to use two parallel
+# workers. The test case then insert on the slave a tuple that will block
+# writes on d2 and generate gaps. Now COMMIT the blocking tuple on slave so
+# that workers will proceed and apply the pending transactions. This will
+# result in duplicate key error and slave will stop. Now crash the slave
+# server and initiate relay-log-recovery. It should fail as slave has stopped
+# due to an error. Eliminate the cause of duplicate key error by removing the
+# local changes on slave. Restart the recovery process it should be
+# successful.
+--source include/force_restart.inc
+--source include/have_binlog_format_statement.inc
+--source include/only_mts_slave_parallel_workers.inc
+--source include/master-slave.inc
+
+--source include/rpl_connection_slave.inc
+call mtr.add_suppression("Duplicate entry*");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+call mtr.add_suppression("Failed to initialize the master info structure");
+call mtr.add_suppression("Slave failed to initialize relay log info*");
+call mtr.add_suppression("MTS recovery: automatic recovery failed.*");
+call mtr.add_suppression("Recovery from master pos");
+
+--source extra/rpl_tests/rpl_generate_mts_gap.test
+
+--source include/rpl_connection_slave.inc
+COMMIT;
+--let $slave_sql_errno= convert_error(ER_DUP_ENTRY)
+source include/wait_for_slave_sql_error.inc;
+
+# Restart the slave server - Recovery will fail as MTS has stopped due to an
+# error.
+--let $rpl_server_number= 2
+--let $rpl_server_parameters= --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1
+--source include/rpl_restart_server.inc
+
+--source include/rpl_connection_slave.inc
+--exec echo "Relay log recovery should fail as MTS stopped due to an error"
+
+--error ER_SLAVE_RLI_INIT_REPOSITORY
+START SLAVE;
+
+# Remove the affending rows from slave.
+--exec echo "Eliminate the cause of MTS error"
+DELETE FROM d2.t WHERE a=2;
+DELETE FROM d1.t WHERE a=3;
+
+--let $table=d2.t
+--let $count=1
+--source include/wait_until_rows_count.inc
+
+--let $table=d1.t
+--let $count=2
+--source include/wait_until_rows_count.inc
+
+# Restart the slave server this should fix the gaps.
+--let $rpl_server_number= 2
+--let $rpl_server_parameters= --skip_slave_start=TRUE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1
+--source include/rpl_restart_server.inc
+
+--exec echo "MTS recovery should be successful. Check that gaps are filled."
+
+--let $assert_text= Table d1.t should contain 2 rows.
+--let $assert_cond= [select count(*) from d1.t] = 2
+--source include/assert.inc
+
+--let $assert_text= Table d2.t should contain 3 rows.
+--let $assert_cond= [select count(*) from d2.t] = 3
+--source include/assert.inc
+
+--source include/start_slave.inc
+
+# Check consistency
+--source include/rpl_connection_master.inc
+--source include/sync_slave_sql_with_master.inc
+--let $diff_tables= master:d1.t, slave:d1.t
+--source include/diff_tables.inc
+
+--let $diff_tables= master:d2.t, slave:d2.t
+--source include/diff_tables.inc
+
+#
+# Cleanup
+#
+--source include/rpl_connection_master.inc
+DROP DATABASE d1;
+DROP DATABASE d2;
+--source include/rpl_end.inc
--connection slave
SELECT @@global.relay_log_recovery as 'must be ON';
-call mtr.add_suppression("--relay-log-recovery cannot be executed when the slave was stopped with an error or killed in MTS mode; consider using RESET SLAVE or restart the server with --relay-log-recovery = 0");
+call mtr.add_suppression("MTS recovery: automatic recovery failed.*");
call mtr.add_suppression("Failed to initialize the master info structure");
#
# the following suppression applies to either restart.
source include/wait_for_slave_sql_error.inc;
DROP TABLE t;
--let $rpl_only_running_threads= 1
+
+# ==== Purpose ====
+#
+# Check that when binlog_row_image= FULL 'UPDATE' query should not using
+# temporary if the PRIMARY KEY not being modified as part of the query.
+#
+# ==== Implementation ====
+#
+# Set binlog_row_image= FULL. Create a table which has both a primary key and
+# a regular int field which is not a key. Execute an UPDATE statement in such
+# a way that it doesn't update the primary key field. See the 'EXPLAIN' output
+# it should not use a temporary table. Repeat the same test in case of
+# binlog_row_image= NOBLOB as well. No temporary table should be used in this
+# case as well.
+#
+# ==== References ====
+#
+# Bug#22510353: UNNECESSARY USING TEMPORARY FOR UPDATE
+#
+###############################################################################
-- source include/rpl_reset.inc
+-- connection master
+-- let $row_img_set=master:FULL:N,slave:FULL:Y
+-- source include/rpl_row_img_set.inc
+CREATE TABLE t1(id INT PRIMARY KEY, a INT) ENGINE = INNODB;
-## CLEAN UP
+--source include/sync_slave_sql_with_master.inc
+
+-- connection master
+-- let $row_img_query= INSERT INTO t1 (id, a) VALUES (1, 1)
+-- let $row_img_expected_master= | 1:1 2:1
+-- let $row_img_expected_slave = | 1:1 2:1
+-- source include/rpl_row_img_parts_master_slave.inc
+
+-- echo "Case: FULL - EXPLAIN output should not display Using temporary"
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+
+-- let $row_img_query= UPDATE t1 SET a=a+1 WHERE id < 2
+-- let $row_img_expected_master= 1:1 2:1 | 1:1 2:2
+-- let $row_img_expected_slave = 1:1 2:1 | 1:1 2:2
+-- source include/rpl_row_img_parts_master_slave.inc
+-- let $row_img_set=master:NOBLOB:N,slave:NOBLOB:Y
+-- source include/rpl_row_img_set.inc
+
+-- echo "Case: NOBLOB - EXPLAIN output should not display Using temporary"
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+
+-- let $row_img_query= UPDATE t1 SET a=a+1 WHERE id < 2
+-- let $row_img_expected_master= 1:1 2:2 | 1:1 2:3
+-- let $row_img_expected_slave = 1:1 2:2 | 1:1 2:3
+-- source include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_set=master:MINIMAL:N,slave:MINIMAL:Y
+-- source include/rpl_row_img_set.inc
+
+EXPLAIN UPDATE t1 SET a=a+1 WHERE id < 2;
+
+-- let $row_img_query= UPDATE t1 SET a=a+1 WHERE id < 2
+-- let $row_img_expected_master= 1:1 | 2:4
+-- let $row_img_expected_slave = 1:1 | 2:4
+-- source include/rpl_row_img_parts_master_slave.inc
+
+DROP TABLE t1;
+--source include/sync_slave_sql_with_master.inc
+
+## CLEAN UP
-- connection master
SET GLOBAL binlog_row_image= @old_binlog_row_image;
SET SESSION binlog_row_image= @old_binlog_row_image;
--- /dev/null
+--slave-skip-errors=all --log_warnings=2
--- /dev/null
+# ==== Purpose ====
+#
+# Check that slave-skip-errors skips following errors like
+# ER_SLAVE_CONVERSION_FAILED and ER_NO_SUCH_TABLE.
+#
+# ==== Implementation ====
+# On slave, set slave_skip_errors=all, so that slave skips all the errors that
+# are reported during application of row based events.
+#
+# On master, create a table t with a varchar filed of length 25. On slave
+# increase the varchar field width to 255, so that updates that are received
+# from master will fail on slave with error ER_SLAVE_CONVERSION_FAILED.
+#
+# Secondly drop the table t on slave and try to the update the table from
+# master. The updates will fail on slave with an error ER_NO_SUCH_TABLE.
+#
+# Verify that slave doesn't break inspite of these errors.
+# ==== References ====
+#
+# Bug#17653275:--SLAVE-SKIP-ERRORS WON'T SKIP MISSING DATABASE/TABLE
+################################################################################
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+# On master create table t which contains a field named 'name' with length
+# varchar(25).
+CREATE TABLE t (name VARCHAR(25) DEFAULT NULL) ENGINE=InnoDB;
+--source include/sync_slave_sql_with_master.inc
+
+# On slave alter the name field length to varchar(255).
+call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t. doesn.t exist., Error_code: 1146");
+call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t. cannot be converted from type.* Error_code: 1677");
+call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state");
+call mtr.add_suppression("Got error 1 during COMMIT");
+ALTER TABLE t CHANGE name name VARCHAR(255);
+
+--source include/rpl_connection_master.inc
+INSERT INTO t VALUE ('Amy');
+--echo # Sync should be successful. Slave should not stop with an error
+--echo # ER_SLAVE_CONVERSION_FAILED. It should be up and running in spite
+--echo # of errors as we have set slave_skip_error=all.
+--source include/sync_slave_sql_with_master.inc
+
+# Drop the table t on slave.
+DROP TABLE t;
+
+--source include/rpl_connection_master.inc
+UPDATE t SET name='New';
+--echo # Sync should be successful. Slave should not stop with an error
+--echo # ER_NO_SUCH_TABLE. It should be up and running in spite of errors
+--echo # as we have set slave_skip_error=all.
+--source include/sync_slave_sql_with_master.inc
+
+--echo # Enable a debug point to simulate failure during rows event cleanup.
+--let $debug_saved= `SELECT @@GLOBAL.DEBUG`
+SET @@GLOBAL.DEBUG= 'd,simulate_rows_event_cleanup_failure';
+
+--source include/rpl_connection_master.inc
+UPDATE t SET name='Old';
+--source include/rpl_connection_slave.inc
+--echo # Since this is not an ignored error slave should stop. We only ignore the
+--echo # errors that are generated during the execution of an event. The other errors
+--echo # that are generated during commit/rollback failure, which takes place during cleanup
+--echo # cannot be ignored.
+--let $slave_sql_errno= convert_error(ER_ERROR_DURING_COMMIT);
+--source include/wait_for_slave_sql_error.inc
+--echo ==== Clean up ====
+SET @@GLOBAL.DEBUG= '$debug_saved';
+--source include/stop_slave_io.inc
+RESET MASTER;
+RESET SLAVE;
+--source include/start_slave.inc
+
+--source include/rpl_connection_master.inc
+--source include/sync_slave_sql_with_master.inc
+
+--source include/rpl_connection_master.inc
+DROP TABLE t;
+--source include/rpl_end.inc
CALL mtr.add_suppression("Master's UUID has changed, although this should not happen unless you have changed it manually");
CALL mtr.add_suppression("Slave I/O: SET @master_heartbeat_period to master failed with error: Lost connection to MySQL server during query");
CALL mtr.add_suppression("Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error");
-CALL mtr.add_suppression("A slave with the same server_uuid as this slave has connected to the master");
+CALL mtr.add_suppression("A slave with the same server_uuid/server_id as this slave has connected to the master");
--let $uuid_file= auto.cnf
--let $assert_file=$MYSQLTEST_VARDIR/log/mysqld.2.err
# Assert only the occurrences after the last CHANGE MASTER
--let $assert_only_after=CHANGE MASTER .* executed
---let $assert_select= Slave .* Got fatal error .* from master .* slave with the same server_uuid as this slave
+--let $assert_select= Slave .* Got fatal error .* from master .* slave with the same server_uuid/server_id as this slave
--let $assert_text= Found the expected line in server 2 error log
--source include/assert_grep.inc
--- /dev/null
+###############################################################################
+#
+# Bug#21697821 RELAYLOG.LOG_LOCK IS NOT RELEASED IN
+# AN ERROR CASE (IN NEXT_EVENT())
+#
+# Problem: In an error case, relaylog.log_lock acquired by SQL thread is not
+# released which is causing all threads, which are looking to acquire
+# the lock, to hang forever.
+#
+# Steps to reproduce:
+#
+# 1) Inject sql thread error using a simulation point and start SQL thread.
+#
+# 2) Wait till SQL thread goes down (before fix, it wont release the log_lock).
+#
+# 3) start SQL thread (before fix, it will wait for log_lock)
+#
+# 4) After the fix, make sure the replication is working fine.
+#
+###############################################################################
+
+--source include/have_debug.inc
+--source include/have_binlog_format_statement.inc
+--let rpl_skip_start_slave=1
+--source include/master-slave.inc
+
+# Step 1) Set a simulation on Slave SQL thread so that it enters
+# into faulty code (before fix) path.
+--source include/rpl_connection_slave.inc
+CALL mtr.add_suppression("Relay log read failure");
+SET @save_debug=@@GLOBAL.debug;
+SET GLOBAL debug="d,force_sql_thread_error";
+
+# Start SQL thread
+START SLAVE SQL_THREAD;
+
+# Step 2) Wait for SQL thread to go down with the injected error.
+# Before fix, SQL thread would not have released
+# relay_log.log_lock.
+--source include/wait_for_slave_sql_to_stop.inc
+
+# Step 3) Before fix, when SQL thread is trying to acquire
+# relay_log.log_lock which was not released will hang
+# forever.
+SET GLOBAL debug=@save_debug;
+--source include/start_slave.inc
+
+# Step 4) Execute dummy statements on master and see that it
+# replication is working fine.
+--source include/rpl_connection_master.inc
+CREATE TABLE t1(i INT);
+DROP TABLE t1;
+--source include/rpl_end.inc
--- /dev/null
+###############################################################################
+# Bug#21179199 ZOMBIE DUMP THREADS ARE NOT DISCONNECTED,
+# CAN ALSO LEAD TO A CRASH
+#
+# Problem: Zombie dump threads on Master (>= MySQL-5.6 version)
+# that are created to server slaves which are on lower
+# versions than MySQL-5.6 version are not getting killed.
+# Steps to reproduce:
+#
+# 1) A simulation point on slave to fake that server MySQL version is lower
+# than MySQL-5.6 (i.e., no slave_uuid set in initial replication protocol)
+#
+# 2) Start IO thread on Slave which will start a dump thread on Master.
+#
+# 3) Restart the IO thread (Master should kill existing dump thread before
+# starting a new dump thread)
+#
+# 4) Now count the number of dump threads on Master, it should be only '1'.
+#
+###############################################################################
+--source include/have_debug.inc
+--source include/have_binlog_format_statement.inc
+--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 on counting the
+# active dump threads.
+--source include/stop_dump_threads.inc
+
+# Step-1) A simulation point on slave to fake that server MySQL version
+# is lower than MySQL-5.6 (i.e., no slave_uuid set in initial replication
+# protocol).
+--source include/rpl_connection_slave.inc
+SET @save_debug = @@GLOBAL.debug;
+SET GLOBAL debug="d,fake_5_5_version_slave";
+
+# Step-2) Start IO thread on Slave which will start a dump thread on Master.
+--source include/start_slave_io.inc
+
+# Step-3) Restart the IO thread (Master should kill existing dump thread before
+# starting a new dump thread)
+--source include/stop_slave_io.inc
+--source include/start_slave_io.inc
+
+# Step-4) Count the number of dump threads on Master, it should be eventually
+# become '1'.
+--source include/rpl_connection_master.inc
+--let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE COMMAND LIKE 'Binlog Dump%'
+--source include/wait_condition.inc
+
+# Cleanup
+--source include/rpl_connection_slave.inc
+SET GLOBAL debug=@save_debug;
+# We do not care about SQL thread for this test scenario
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc
--- /dev/null
+SELECT @@innodb_stats_include_delete_marked;
+@@innodb_stats_include_delete_marked
+0
+SET GLOBAL innodb_stats_include_delete_marked=1;
+SELECT @@innodb_stats_include_delete_marked;
+@@innodb_stats_include_delete_marked
+1
+SET SESSION innodb_stats_include_delete_marked=1;
+ERROR HY000: Variable 'innodb_stats_include_delete_marked' is a GLOBAL variable and should be set with SET GLOBAL
+SET GLOBAL innodb_stats_include_delete_marked=100;
+ERROR 42000: Variable 'innodb_stats_include_delete_marked' can't be set to the value of '100'
+SET GLOBAL innodb_stats_include_delete_marked=foo;
+ERROR 42000: Variable 'innodb_stats_include_delete_marked' can't be set to the value of 'foo'
+SET GLOBAL innodb_stats_include_delete_marked=OFF ;
+SELECT @@innodb_stats_include_delete_marked;
+@@innodb_stats_include_delete_marked
+0
+SET GLOBAL innodb_stats_include_delete_marked=ON ;
+SELECT @@innodb_stats_include_delete_marked;
+@@innodb_stats_include_delete_marked
+1
+SET GLOBAL innodb_stats_include_delete_marked=Default ;
+SELECT @@innodb_stats_include_delete_marked;
+@@innodb_stats_include_delete_marked
+0
--- /dev/null
+ ###############################################################################
+# #
+# Variable Name: innodb_stats_include_delete_marked #
+# Scope: Global #
+# Access Type: Dynamic #
+# Data Type: numeric #
+# #
+# #
+# Creation Date: 2016-08-29 #
+# Author : Aditya #
+# #
+# #
+# Description: #
+# * Value check #
+# * Scope check #
+# #
+###############################################################################
+
+--source include/have_innodb.inc
+
+####################################################################
+# Display default value #
+####################################################################
+SELECT @@innodb_stats_include_delete_marked;
+
+SET GLOBAL innodb_stats_include_delete_marked=1;
+
+SELECT @@innodb_stats_include_delete_marked;
+
+# check error
+--error ER_GLOBAL_VARIABLE
+SET SESSION innodb_stats_include_delete_marked=1;
+
+# check error
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_stats_include_delete_marked=100;
+
+# check error
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL innodb_stats_include_delete_marked=foo;
+
+SET GLOBAL innodb_stats_include_delete_marked=OFF ;
+
+SELECT @@innodb_stats_include_delete_marked;
+
+SET GLOBAL innodb_stats_include_delete_marked=ON ;
+
+SELECT @@innodb_stats_include_delete_marked;
+
+# Check with default setting
+SET GLOBAL innodb_stats_include_delete_marked=Default ;
+
+SELECT @@innodb_stats_include_delete_marked;
--list_files $test_dir `#sql-*.frm`
+DROP TABLE t1;
+
+
+--echo #
+--echo # Bug#19635706
+--echo # Verify that it is possible to add a unique key to a not-NULL POINT
+--echo # column and that this key is promoted to primary key
+--echo #
+
+CREATE TABLE t1(a INT NOT NULL, b POINT NOT NULL) ENGINE=INNODB;
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD UNIQUE INDEX (b);
+
+--echo # Note that SHOW CREATE TABLE does not list b as a primary key,
+--echo # even though it was promoted. This appears to be the case also
+--echo # for other column types.
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 ADD UNIQUE INDEX (a);
+SHOW CREATE TABLE t1;
+
+--echo # Verify that the expected indices have been created by Innodb
+SELECT T.NAME AS TABLE_NAME, I.NAME AS INDEX_NAME,
+ CASE I.TYPE
+ WHEN 0 THEN 'Secondary'
+ WHEN 1 THEN 'Clustered'
+ WHEN 2 THEN 'Unique'
+ WHEN 3 THEN 'Primary'
+ WHEN 32 THEN 'Full text'
+ WHEN 64 THEN 'Spatial'
+ ELSE 'Unknown'
+ END AS INDEX_TYPE,
+ F.NAME AS FIELD_NAME, F.POS AS FIELD_POS FROM
+ INFORMATION_SCHEMA.INNODB_SYS_TABLES AS T JOIN
+ INFORMATION_SCHEMA.INNODB_SYS_INDEXES AS I JOIN
+ INFORMATION_SCHEMA.INNODB_SYS_FIELDS AS F
+ ON I.INDEX_ID = F.INDEX_ID AND I.TABLE_ID = T.TABLE_ID
+ WHERE T.NAME = 'test/t1';
+
DROP TABLE t1;
# mysql.event intact checking end
#
-create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
+create event e_26 on schedule at '2038-01-19 03:14:07' disable do set @a = 5;
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
drop event e_26;
--error ER_WRONG_VALUE
SELECT id, insert(0x3a, 1, 0, d) FROM t1;
DROP TABLE t1;
+--echo #
+--echo # Bug#22888420 CONCAT_WS: ASSERTION FAILED: !S.USES_BUFFER_OWNED_BY(THIS)
+--echo #
+
+do concat('a',concat_ws('a', 0x2859, 'a' ,
+ trim(period_add('a',1) from (1&''))
+ )
+ );
+
--echo #
--echo # End of 5.6 tests
--echo #
set session default_storage_engine = InnoDB;
--let $innodb = 1
-# Next 2 variables control the JSON format output and validation in explain_utils.
+# Next variable controls the JSON format output in explain_utils.
# 1 = enable, 0 = disable
--let $json = 1
-# Validation disabled due to not having Python with JSON on all PB machines.
---let $validation = 0
---file_exists $MYSQL_TEST_DIR/suite/opt_trace/validate_json.py
+--file_exists $MYSQL_TEST_DIR/suite/opt_trace/validate_json.pl
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = InnoDB;
--let $innodb = 1
-# Next 2 variables control the JSON format output and validation in explain_utils.
+# Next variable controls the JSON format output in explain_utils.
# 1 = enable, 0 = disable
--let $json = 1
-# Validation disabled due to not having Python with JSON on all PB machines.
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set session default_storage_engine = InnoDB;
--let $innodb = 1
-# json validation in explain_util.inc can be switched off by setting to zero.
+# json format in explain_util.inc can be switched off by setting to zero.
--let $json = 0
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set session default_storage_engine = InnoDB;
--let $innodb = 1
--let $json = 0
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3;
DROP TABLE t2, t1;
+
+
+--echo #
+--echo # BUG#22037930: INSERT IGNORE FAILS TO IGNORE FOREIGN
+--echo # KEY CONSTRAINT
+
+CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= INNODB;
+
+CREATE TABLE t2 (fld1 VARCHAR(10), fld2 INT NOT NULL,
+CONSTRAINT fk FOREIGN KEY (fld2) REFERENCES t1(fld1)) ENGINE= INNODB;
+
+--echo # Without patch, reports incorrect error.
+--error ER_NO_REFERENCED_ROW_2
+INSERT INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
+--error ER_NO_REFERENCED_ROW_2
+REPLACE INTO t2 VALUES('abc', 2);
+
+--enable_warnings
+INSERT IGNORE INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
+--disable_warnings
+
+DROP TABLE t2, t1;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = MyISAM;
-# Next 2 variables control the JSON format output and validation in explain_utils.
+# Next variable controls the JSON format output in explain_utils.
# 1 = enable, 0 = disable
--let $json = 1
-# Validation disabled due to not having Python with JSON on all PB machines.
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = MyISAM;
-# Next 2 variables control the JSON format output and validation in explain_utils.
+# Next variable controls the JSON format output in explain_utils.
# 1 = enable, 0 = disable
--let $json = 1
-# Validation disabled due to not having Python with JSON on all PB machines.
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = MyISAM;
--let $json = 0
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
set @save_storage_engine= @@session.default_storage_engine;
set session default_storage_engine = MyISAM;
--let $json = 0
---let $validation = 0
--source include/explain_non_select.inc
set default_storage_engine= @save_storage_engine;
--- /dev/null
+--query_cache_type=1
--- /dev/null
+# This test should work in embedded server after we fix mysqltest
+-- source include/not_embedded.inc
+
+--echo # Bug#22559575 "the statement (1) has no open cursor" pops sometimes with
+--echo # prepared+query_cache
+--echo #
+--echo # Create relevent tables and call C API test cases
+--echo # Setup
+
+select VARIABLE_VALUE into @qcache_hit_val1 from
+ information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Qcache_hits';
+
+--echo
+--echo #Run C_API test case
+--exec echo "$MYSQL_CLIENT_TEST --silent test_bug22559575" > $MYSQLTEST_VARDIR/log/mysql_client_test_qcache.out.log 2>&1
+--exec $MYSQL_CLIENT_TEST --silent test_bug22559575 >> $MYSQLTEST_VARDIR/log/mysql_client_test_qcache.out.log 2>&1
+
+select VARIABLE_VALUE into @qcache_hit_val2 from
+ information_schema.GLOBAL_STATUS where VARIABLE_NAME = 'Qcache_hits';
+SELECT @qcache_hit_val2 - @qcache_hit_val1;
+
--echo #### End of test ####
+
+--echo #
+--echo # Bug #24557925: MYSQL_CONFIG_EDITOR CAN MAKE SERVER UNBOOTABLE
+--echo #
+
+
+--exec $MYSQL_CONFIG_EDITOR set --login-path=mysqld --host=test_user5
+
+--echo # Restarting the server. Should work
+--source include/restart_mysqld.inc
+
+--echo # Cleanup
+--exec $MYSQL_CONFIG_EDITOR remove --login-path=mysqld
+--remove_file $MYSQL_TEST_LOGIN_FILE
+
+--echo # End of 5.6 tests
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval SELECT
(@a:=LOAD_FILE("$binlog_file"))
-IS NOT NULL;
+IS NOT NULL AS Loaded;
let $s_id_unsigned= `SELECT @a LIKE "%server id $s_id_max%" /* must return 1 */`;
echo *** Unsigned server_id $s_id_max is found: $s_id_unsigned ***;
-- echo # test.t1 have partitions in mysqltest2-directory!
-- echo # user root:
CREATE USER mysqltest_1@localhost;
+-- echo # Need FILE permission to use external datadir or indexdir.
+ GRANT FILE ON *.* TO mysqltest_1@localhost;
CREATE DATABASE mysqltest2;
USE mysqltest2;
CREATE TABLE t1 (a INT) ENGINE = MyISAM;
--echo End of 5.0 tests
+--echo #
+--echo # Bug#21142859: FUNCTION UPDATING A VIEW FAILS TO FIND TABLE THAT ACTUALLY EXISTS
+--echo #
+
+CREATE TABLE t1 SELECT 1 AS fld1, 'A' AS fld2;
+CREATE TABLE t2 (fld3 INT, fld4 CHAR(1));
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+CREATE TRIGGER t1_au AFTER UPDATE ON t1
+FOR EACH ROW INSERT INTO t2 VALUES (new.fld1, new.fld2);
+
+DELIMITER !;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ UPDATE v1 SET fld2='B' WHERE fld1=1;
+ RETURN row_count();
+END !
+DELIMITER ;!
+
+--echo # Without the patch, an error was getting reported.
+SELECT f1();
+
+DROP FUNCTION f1;
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+--echo #
+--echo # Bug #16672723 "CAN'T FIND TEMPORARY TABLE".
+--echo #
+CREATE FUNCTION f1() RETURNS INT RETURN 1;
+CREATE TEMPORARY TABLE tmp1(a INT);
+PREPARE stmt1 FROM "CREATE TEMPORARY TABLE tmp2 AS SELECT b FROM (SELECT f1() AS b FROM tmp1) AS t";
+--echo # The below statement failed before the fix.
+EXECUTE stmt1;
+DROP TEMPORARY TABLES tmp1, tmp2;
+DEALLOCATE PREPARE stmt1;
+DROP FUNCTION f1;
--- /dev/null
+--ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem
+--ssl-key=$MYSQL_TEST_DIR/std_data/crl-server-key.pem
+--ssl-cert=$MYSQL_TEST_DIR/std_data/crl-server-cert.pem
--- /dev/null
+--source include/have_ssl.inc
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug#21920657: SSL-CA FAILS SILENTLY IF THE PATH CANNOT BE FOUND
+--echo #
+
+--echo # try to connect with wrong '--ssl-ca' path : should fail
+--error 1
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/wrong-crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2>&1
+
+--echo # try to connect with correct '--ssl-ca' path : should connect
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
+
+--echo #
+--echo # Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
+--echo # PATH SUBSTITUTION
+--echo #
+
+--let $mysql_test_dir_path= `SELECT REPLACE('$MYSQL_TEST_DIR', '$HOME', '~')`
+
+--echo # try to connect with '--ssl-ca' option using tilde home directoy
+--echo # path substitution : should connect
+--exec $MYSQL --ssl-ca=$mysql_test_dir_path/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
+
+--echo # try to connect with '--ssl-key' option using tilde home directoy
+--echo # path substitution : should connect
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$mysql_test_dir_path/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
+
+--echo # try to connect with '--ssl-cert' option using tilde home directoy
+--echo # path substitution : should connect
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$mysql_test_dir_path/std_data/crl-client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--error 1
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-revoked-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-revoked-cert.pem test -e "SHOW VARIABLES like '%ssl%';"
+
+--echo #
+--echo # Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
+--echo # PATH SUBSTITUTION
+--echo #
+
+--let $mysql_test_dir_path= `SELECT REPLACE('$MYSQL_TEST_DIR', '$HOME', '~')`
+
+--echo # try to connect with '--ssl-crl' option using tilde home directoy
+--echo # path substitution : should connect
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem test --ssl-crl=$mysql_test_dir_path/std_data/crl-client-revoked.crl -e "SHOW STATUS LIKE 'Ssl_cipher'"
+
+--echo # try to connect with '--ssl-crlpath' option using tilde home directoy
+--echo # path substitution : should connect
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/crl-ca-cert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/crl-client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/crl-client-cert.pem --ssl-crlpath=$mysql_test_dir_path/std_data/crldir test -e "SHOW STATUS LIKE 'Ssl_cipher'"
--- /dev/null
+$TESTUDFSERVICES_OPT
--- /dev/null
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug #20085672: CRYPTIC ERROR WHEN FAILING TO UNLOAD A DYNAMIC LIBRARY
+--echo #
+
+--echo # Install the plugin
+--replace_result $TESTUDFSERVICES TESTUDFSERVICES
+eval INSTALL PLUGIN test_udf_services SONAME '$TESTUDFSERVICES';
+
+--echo # Define the function
+--replace_result $TESTUDFSERVICES TESTUDFSERVICES
+eval CREATE FUNCTION test_udf_services_udf RETURNS INT
+ SONAME "$TESTUDFSERVICES";
+
+--echo # Uninstall the plugin
+UNINSTALL PLUGIN test_udf_services;
+
+--echo # Install the plugin again. Should not fail
+--replace_result $TESTUDFSERVICES TESTUDFSERVICES
+eval INSTALL PLUGIN test_udf_services SONAME '$TESTUDFSERVICES';
+
+--echo # Cleanup
+DROP FUNCTION test_udf_services_udf;
+UNINSTALL PLUGIN test_udf_services;
remove_file $MYSQLTEST_VARDIR/tmp/dictionary.txt;
remove_file $MYSQLTEST_VARDIR/tmp/dictionary2.txt;
+--echo #
+--echo # Bug#21616496: CREATE USER ACCEPTS PLUGIN AND PASSWORD HASH,
+--echo # BUT IGNORES THE PASSWORD HASH
+--echo #
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password';
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_old_password';
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*0D3CED9BEC10A777AEC23CCC353A8C08A633045E';
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER 'user1'@'localhost' IDENTIFIED WITH 'mysql_old_password' AS '*0D3CED9BEC10A777AEC23CCC353A8C08A633045E';
+
--echo # clean up after the test
UNINSTALL PLUGIN validate_password;
--- /dev/null
+--source include/windows.inc
+
+
+--echo #
+--echo # Bug #23747899: @@basedir sysvar value not normalized if set through
+--echo # the command line/ini file
+
+--echo # There should be no slashes in @@basedir and just backslashes
+--echo # since it's normalized
+SELECT
+ LOCATE('/', @@basedir) <> 0 AS have_slashes,
+ LOCATE('\\', @@basedir) <> 0 AS have_backslashes;
+
+
+--echo End of the 5.6 tests
my $count_warnings= $count_warnings;
print "Deprecation warning count : $count_warnings\n";
close(FILE);
+ # Truncate the log file so that repititions of the test don't pick up deprecation warnings from previous runs
+ open(FILE,">$logf") or die("Unable to open $logf for truncation $!\n");
+ close(FILE);
EOF
-- source include/mysql_upgrade_preparation.inc
fun:my_b_flush_io_cache
fun:_my_b_write
fun:_Z*10write_keysP10Sort_paramP13Filesort_infojP11st_io_cacheS4_
- fun:_Z*13find_all_keysP10Sort_paramP10SQL_SELECTP13Filesort_infoP11st_io_cacheS6_P13Bounded_queueIhhEPy
+ ...
fun:_Z8filesortP3THDP5TABLEP8FilesortbPyS5_
}
fun:malloc_info
}
-{
- GitHub codership/mysql-wsrep#176
- Memcheck:Leak
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
{
GitHub codership/galera#330
Memcheck:Leak
fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
}
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
-}
-
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z21wsrep_provider_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
{
codership/mysql-wsrep/issues#176
Memcheck:Leak
fun:_Z24do_handle_one_connectionP3THD
}
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- match-leak-kinds: possible
- fun:malloc
- fun:strdup
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- match-leak-kinds: definite
- fun:malloc
- fun:strdup
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z29wsrep_provider_options_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
-{
- codership/mysql-wsrep/issues#176
- Memcheck:Leak
- match-leak-kinds: definite
- fun:malloc
- fun:strdup
- fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
- fun:galera_parameters_get
- fun:_ZL24refresh_provider_optionsv
- fun:_Z21wsrep_provider_updateP7sys_varP3THD13enum_var_type
- fun:_ZN7sys_var6updateEP3THDP7set_var
- fun:_ZN7set_var6updateEP3THD
- fun:_Z17sql_set_variablesP3THDP4ListI12set_var_baseE
- fun:_Z21mysql_execute_commandP3THD
- fun:_Z11mysql_parseP3THDPcjP12Parser_state
- fun:_ZL17wsrep_mysql_parseP3THDPcjP12Parser_state
- fun:_Z16dispatch_command19enum_server_commandP3THDPcj
- fun:_Z10do_commandP3THD
- fun:_Z24do_handle_one_connectionP3THD
- fun:handle_one_connection
-}
-
{
codership/galera#331
Memcheck:Leak
-# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
- ${LIBNSL} ${LIBM} ${LIBRT})
+ ${LIBNSL} ${LIBM} ${LIBRT} ${LIBEXECINFO})
DTRACE_INSTRUMENT(mysys)
# Need explicit pthread for gcc -fsanitize=address
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#endif /* HAVE_UCA_COLLATIONS */
-my_bool init_compiled_charsets(myf flags __attribute__((unused)))
+my_bool init_compiled_charsets(myf flags MY_ATTRIBUTE((unused)))
{
CHARSET_INFO *cs;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Be silent by default: no warnings on the client side.
*/
static void
-default_reporter(enum loglevel level __attribute__ ((unused)),
- const char *format __attribute__ ((unused)),
+default_reporter(enum loglevel level MY_ATTRIBUTE ((unused)),
+ const char *format MY_ATTRIBUTE ((unused)),
...)
{
}
*to= 0;
return overflow ? (ulong)~0 : (ulong) (to - to_start);
}
+
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide Fedora symbols
+
+CHARSET_INFO *mysql_get_charset(uint cs_number, myf flags)
+{
+ return get_charset(cs_number, flags);
+}
+
+
+CHARSET_INFO * mysql_get_charset_by_csname(const char *cs_name, uint cs_flags, myf flags)
+{
+ return get_charset_by_csname(cs_name, cs_flags, flags);
+}
+
+#endif
+#endif /* EXPORT_SYMVER16 */
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* QQ: TODO multi-pinbox */
-/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
as necessary, old are pushed in the stack for reuse. ABA is solved by
versioning a pointer - because we use an array, a pointer to pins is 16 bit,
upper 16 bits are used for a version.
-
- It is assumed that pins belong to a THD and are not transferable
- between THD's (LF_PINS::stack_ends_here being a primary reason
- for this limitation).
*/
-#include <my_global.h>
-#include <my_sys.h>
-#include <lf.h>
+
+#include "lf.h"
+#include "mysys_priv.h" /* key_memory_lf_node */
#define LF_PINBOX_MAX_PINS 65536
DESCRIPTION
get a new LF_PINS structure from a stack of unused pins,
or allocate a new one out of dynarray.
-
- NOTE
- It is assumed that pins belong to a thread and are not transferable
- between threads.
*/
LF_PINS *_lf_pinbox_get_pins(LF_PINBOX *pinbox)
{
- struct st_my_thread_var *var;
uint32 pins, next, top_ver;
LF_PINS *el;
/*
pinstack_top_ver is 32 bits; 16 low bits are the index in the
array, to the first element of the list. 16 high bits are a version
(every time the 16 low bits are updated, the 16 high bits are
- incremented). Versioniong prevents the ABA problem.
+ incremented). Versioning prevents the ABA problem.
*/
top_ver= pinbox->pinstack_top_ver;
do
el->link= pins;
el->purgatory_count= 0;
el->pinbox= pinbox;
- var= my_thread_var;
- /*
- Threads that do not call my_thread_init() should still be
- able to use the LF_HASH.
- */
- el->stack_ends_here= (var ? & var->stack_ends_here : NULL);
return el;
}
} while (!my_atomic_cas32((int32 volatile*) &pinbox->pinstack_top_ver,
(int32*) &top_ver,
top_ver-pins->link+nr+LF_PINBOX_MAX_PINS));
- return;
}
-static int ptr_cmp(void **a, void **b)
+/*
+ Get the next pointer in the purgatory list.
+ Note that next_node is not used to avoid the extra volatile.
+*/
+#define pnext_node(P, X) (*((void **)(((char *)(X)) + (P)->free_ptr_offset)))
+
+static inline void add_to_purgatory(LF_PINS *pins, void *addr)
{
- return *a < *b ? -1 : *a == *b ? 0 : 1;
+ pnext_node(pins->pinbox, addr)= pins->purgatory;
+ pins->purgatory= addr;
+ pins->purgatory_count++;
}
-#define add_to_purgatory(PINS, ADDR) \
- do \
- { \
- *(void **)((char *)(ADDR)+(PINS)->pinbox->free_ptr_offset)= \
- (PINS)->purgatory; \
- (PINS)->purgatory= (ADDR); \
- (PINS)->purgatory_count++; \
- } while (0)
/*
Free an object allocated via pinbox allocator
void _lf_pinbox_free(LF_PINS *pins, void *addr)
{
add_to_purgatory(pins, addr);
- if (pins->purgatory_count % LF_PURGATORY_SIZE)
+ if (pins->purgatory_count % LF_PURGATORY_SIZE == 0)
_lf_pinbox_real_free(pins);
}
-struct st_harvester {
- void **granary;
- int npins;
+struct st_match_and_save_arg {
+ LF_PINS *pins;
+ LF_PINBOX *pinbox;
+ void *old_purgatory;
};
/*
- callback for _lf_dynarray_iterate:
- scan all pins of all threads and accumulate all pins
+ Callback for lf_dynarray_iterate:
+ Scan all pins of all threads, for each active (non-null) pin,
+ scan the current thread's purgatory. If present there, move it
+ to a new purgatory. At the end, the old purgatory will contain
+ pointers not pinned by any thread.
*/
-static int harvest_pins(LF_PINS *el, struct st_harvester *hv)
+static int match_and_save(LF_PINS *el, struct st_match_and_save_arg *arg)
{
int i;
- LF_PINS *el_end= el + MY_MIN(hv->npins, LF_DYNARRAY_LEVEL_LENGTH);
+ LF_PINS *el_end= el + LF_DYNARRAY_LEVEL_LENGTH;
for (; el < el_end; el++)
{
for (i= 0; i < LF_PINBOX_PINS; i++)
{
void *p= el->pin[i];
if (p)
- *hv->granary++= p;
+ {
+ void *cur= arg->old_purgatory;
+ void **list_prev= &arg->old_purgatory;
+ while (cur)
+ {
+ void *next= pnext_node(arg->pinbox, cur);
+
+ if (p == cur)
+ {
+ /* pinned - keeping */
+ add_to_purgatory(arg->pins, cur);
+ /* unlink from old purgatory */
+ *list_prev= next;
+ }
+ else
+ list_prev= (void **)((char *)cur+arg->pinbox->free_ptr_offset);
+ cur= next;
+ }
+ if (!arg->old_purgatory)
+ return 1;
+ }
}
}
- /*
- hv->npins may become negative below, but it means that
- we're on the last dynarray page and harvest_pins() won't be
- called again. We don't bother to make hv->npins() correct
- (that is 0) in this case.
- */
- hv->npins-= LF_DYNARRAY_LEVEL_LENGTH;
return 0;
}
-/*
- callback for _lf_dynarray_iterate:
- scan all pins of all threads and see if addr is present there
-*/
-static int match_pins(LF_PINS *el, void *addr)
-{
- int i;
- LF_PINS *el_end= el+LF_DYNARRAY_LEVEL_LENGTH;
- for (; el < el_end; el++)
- for (i= 0; i < LF_PINBOX_PINS; i++)
- if (el->pin[i] == addr)
- return 1;
- return 0;
-}
-
-#if STACK_DIRECTION < 0
-#define available_stack_size(CUR,END) (long) ((char*)(CUR) - (char*)(END))
-#else
-#define available_stack_size(CUR,END) (long) ((char*)(END) - (char*)(CUR))
-#endif
-
-#define next_node(P, X) (*((uchar * volatile *)(((uchar *)(X)) + (P)->free_ptr_offset)))
-#define anext_node(X) next_node(&allocator->pinbox, (X))
-
/*
Scan the purgatory and free everything that can be freed
*/
static void _lf_pinbox_real_free(LF_PINS *pins)
{
- int npins;
- void *list;
- void **addr= NULL;
- void *first= NULL, *last= NULL;
LF_PINBOX *pinbox= pins->pinbox;
- npins= pinbox->pins_in_array+1;
+ /* Store info about current purgatory. */
+ struct st_match_and_save_arg arg = {pins, pinbox, pins->purgatory};
+ /* Reset purgatory. */
+ pins->purgatory= NULL;
+ pins->purgatory_count= 0;
-#ifdef HAVE_ALLOCA
- if (pins->stack_ends_here != NULL)
- {
- int alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins;
- /* create a sorted list of pinned addresses, to speed up searches */
- if (available_stack_size(&pinbox, *pins->stack_ends_here) > alloca_size)
- {
- struct st_harvester hv;
- addr= (void **) alloca(alloca_size);
- hv.granary= addr;
- hv.npins= npins;
- /* scan the dynarray and accumulate all pinned addresses */
- _lf_dynarray_iterate(&pinbox->pinarray,
- (lf_dynarray_func)harvest_pins, &hv);
-
- npins= hv.granary-addr;
- /* and sort them */
- if (npins)
- qsort(addr, npins, sizeof(void *), (qsort_cmp)ptr_cmp);
- }
- }
-#endif
+ lf_dynarray_iterate(&pinbox->pinarray,
+ (lf_dynarray_func)match_and_save, &arg);
- list= pins->purgatory;
- pins->purgatory= 0;
- pins->purgatory_count= 0;
- while (list)
+ if (arg.old_purgatory)
{
- void *cur= list;
- list= *(void **)((char *)cur+pinbox->free_ptr_offset);
- if (npins)
- {
- if (addr) /* use binary search */
- {
- void **a, **b, **c;
- for (a= addr, b= addr+npins-1, c= a+(b-a)/2; (b-a) > 1; c= a+(b-a)/2)
- if (cur == *c)
- a= b= c;
- else if (cur > *c)
- a= c;
- else
- b= c;
- if (cur == *a || cur == *b)
- goto found;
- }
- else /* no alloca - no cookie. linear search here */
- {
- if (_lf_dynarray_iterate(&pinbox->pinarray,
- (lf_dynarray_func)match_pins, cur))
- goto found;
- }
- }
- /* not pinned - freeing */
- if (last)
- last= next_node(pinbox, last)= (uchar *)cur;
- else
- first= last= (uchar *)cur;
- continue;
-found:
- /* pinned - keeping */
- add_to_purgatory(pins, cur);
+ /* Some objects in the old purgatory were not pinned, free them. */
+ void *last= arg.old_purgatory;
+ while (pnext_node(pinbox, last))
+ last= pnext_node(pinbox, last);
+ pinbox->free_func(arg.old_purgatory, last, pinbox->free_func_arg);
}
- if (last)
- pinbox->free_func(first, last, pinbox->free_func_arg);
}
+#define next_node(P, X) (*((uchar * volatile *)(((uchar *)(X)) + (P)->free_ptr_offset)))
+#define anext_node(X) next_node(&allocator->pinbox, (X))
+
/* lock-free memory allocator for fixed-size objects */
LF_REQUIRE_PINS(1)
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
this, just remember the file name for later removal
*/
-static my_bool cache_remove_open_tmp(IO_CACHE *cache __attribute__((unused)),
+static my_bool cache_remove_open_tmp(IO_CACHE *cache MY_ATTRIBUTE((unused)),
const char *name)
{
#if O_TEMPORARY == 0
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
my_off_t seek_offset,
- pbool use_async_io __attribute__((unused)),
+ pbool use_async_io MY_ATTRIBUTE((unused)),
pbool clear_cache)
{
DBUG_ENTER("reinit_io_cache");
while (write_length)
{
size_t copy_length= MY_MIN(write_length, write_cache->buffer_length);
- int __attribute__((unused)) rc;
+ int MY_ATTRIBUTE((unused)) rc;
rc= lock_io_cache(write_cache, write_cache->pos_in_file);
/* The writing thread does always have the lock when it awakes. */
unlock_append_buffer(info);
int my_b_flush_io_cache(IO_CACHE *info,
- int need_append_buffer_lock __attribute__((unused)))
+ int need_append_buffer_lock MY_ATTRIBUTE((unused)))
{
size_t length;
my_off_t pos_in_file;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
uchar *key_cache_read(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int return_buffer __attribute__((unused)))
+ uint block_length MY_ATTRIBUTE((unused)),
+ int return_buffer MY_ATTRIBUTE((unused)))
{
my_bool locked_and_incremented= FALSE;
int error=0;
int key_cache_write(KEY_CACHE *keycache,
File file, my_off_t filepos, int level,
uchar *buff, uint length,
- uint block_length __attribute__((unused)),
+ uint block_length MY_ATTRIBUTE((unused)),
int dont_write)
{
my_bool locked_and_incremented= FALSE;
0 on success (always because it can't fail)
*/
-int reset_key_cache_counters(const char *name __attribute__((unused)),
+int reset_key_cache_counters(const char *name MY_ATTRIBUTE((unused)),
KEY_CACHE *key_cache)
{
DBUG_ENTER("reset_key_cache_counters");
/*
Test if disk-cache is ok
*/
-static void test_key_cache(KEY_CACHE *keycache __attribute__((unused)),
- const char *where __attribute__((unused)),
- my_bool lock __attribute__((unused)))
+static void test_key_cache(KEY_CACHE *keycache MY_ATTRIBUTE((unused)),
+ const char *where MY_ATTRIBUTE((unused)),
+ my_bool lock MY_ATTRIBUTE((unused)))
{
/* TODO */
}
-/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Get key and length for a SAFE_HASH_ENTRY */
static uchar *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=entry->length;
return (uchar*) entry->key;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
File create_temp_file(char *to, const char *dir, const char *prefix,
- int mode __attribute__((unused)),
- myf MyFlags __attribute__((unused)))
+ int mode MY_ATTRIBUTE((unused)),
+ myf MyFlags MY_ATTRIBUTE((unused)))
{
File file= -1;
#ifdef __WIN__
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@param to A pathname.
*/
-void to_unix_path(char *to __attribute__((unused)))
+void to_unix_path(char *to MY_ATTRIBUTE((unused)))
{
#if FN_LIBCHAR != '/'
{
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@return TRUE if the file name is allowed, FALSE otherwise.
*/
-my_bool is_filename_allowed(const char *name __attribute__((unused)),
- size_t length __attribute__((unused)),
- my_bool allow_current_dir __attribute__((unused)))
+my_bool is_filename_allowed(const char *name MY_ATTRIBUTE((unused)),
+ size_t length MY_ATTRIBUTE((unused)),
+ my_bool allow_current_dir MY_ATTRIBUTE((unused)))
{
/*
For Windows, check if the file name contains : character.
-/* Copyright (C) 2000 MySQL AB
- Use is subject to license terms
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* Function to set a varible when we got a alarm */
/* Used by my_lock samt functions in m_alarm.h */
#ifdef HAVE_ALARM
/* ARGSUSED */
-sig_handler my_set_alarm_variable(int signo __attribute__((unused)))
+sig_handler my_set_alarm_variable(int signo MY_ATTRIBUTE((unused)))
{
my_have_got_alarm=1; /* Tell program that time expired */
return;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
- size_t pre_alloc_size __attribute__((unused)))
+ size_t pre_alloc_size MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("init_alloc_root");
DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
*/
void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
- size_t pre_alloc_size __attribute__((unused)))
+ size_t pre_alloc_size MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(alloc_root_inited(mem_root));
/*
- Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
-static inline void bitmap_lock(MY_BITMAP *map __attribute__((unused)))
+static inline void bitmap_lock(MY_BITMAP *map MY_ATTRIBUTE((unused)))
{
if (map->mutex)
mysql_mutex_lock(map->mutex);
}
-static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused)))
+static inline void bitmap_unlock(MY_BITMAP *map MY_ATTRIBUTE((unused)))
{
if (map->mutex)
mysql_mutex_unlock(map->mutex);
my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
- my_bool thread_safe __attribute__((unused)))
+ my_bool thread_safe MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("bitmap_init");
if (!buf)
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* No close operation hook. */
-static int no_close(void *cookie __attribute__((unused)))
+static int no_close(void *cookie MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Seek to position in file */
my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
- myf MyFlags __attribute__((unused)))
+ myf MyFlags MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("my_fseek");
DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %d",
/* Tell current position of file */
-my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused)))
+my_off_t my_ftell(FILE *stream, myf MyFlags MY_ATTRIBUTE((unused)))
{
off_t pos;
DBUG_ENTER("my_ftell");
-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#else /* __FreeBSD__ || __linux__ || __WIN__ */
/* just fail */
-my_bool my_gethwaddr(uchar *to __attribute__((unused)))
+my_bool my_gethwaddr(uchar *to MY_ATTRIBUTE((unused)))
{
return 1;
}
#endif
#else /* MAIN */
-int main(int argc __attribute__((unused)),char **argv)
+int main(int argc MY_ATTRIBUTE((unused)),char **argv)
{
uchar mac[6];
uint i;
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@retval current time.
*/
-time_t my_time_possible_from_micro(ulonglong microtime __attribute__((unused)))
+time_t my_time_possible_from_micro(ulonglong microtime MY_ATTRIBUTE((unused)))
{
#ifdef _WIN32
time_t t;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <m_string.h>
#include <my_dir.h> /* Structs used by my_dir,includes sys/types */
#include "mysys_err.h"
-#if defined(HAVE_DIRENT_H)
+#if !defined(_WIN32)
# include <dirent.h>
-# define NAMLEN(dirent) strlen((dirent)->d_name)
-#else
-# define dirent direct
-# define NAMLEN(dirent) (dirent)->d_namlen
-# if defined(HAVE_SYS_NDIR_H)
-# include <sys/ndir.h>
-# endif
-# if defined(HAVE_SYS_DIR_H)
-# include <sys/dir.h>
-# endif
-# if defined(HAVE_NDIR_H)
-# include <ndir.h>
# endif
-# if defined(_WIN32)
-# ifdef __BORLANDC__
-# include <dir.h>
-# endif
-# endif
-#endif
-#if defined(HAVE_READDIR_R)
-#define READDIR(A,B,C) ((errno=readdir_r(A,B,&C)) != 0 || !C)
-#else
-#define READDIR(A,B,C) (!(C=readdir(A)))
-#endif
/*
We are assuming that directory we are reading is either has less than
#if !defined(_WIN32)
+static char* directory_file_name(char *dst, const char *src);
+
MY_DIR *my_dir(const char *path, myf MyFlags)
{
char *buffer;
DYNAMIC_ARRAY *dir_entries_storage;
MEM_ROOT *names_storage;
DIR *dirp;
- struct dirent *dp;
char tmp_path[FN_REFLEN + 2], *tmp_file;
- char dirent_tmp[sizeof(struct dirent)+_POSIX_PATH_MAX+1];
+ const struct dirent *dp;
DBUG_ENTER("my_dir");
DBUG_PRINT("my",("path: '%s' MyFlags: %d",path,MyFlags));
-#if !defined(HAVE_READDIR_R)
- mysql_mutex_lock(&THR_LOCK_open);
-#endif
-
dirp = opendir(directory_file_name(tmp_path,(char *) path));
#if defined(__amiga__)
if ((dirp->dd_fd) < 0) /* Directory doesn't exists */
tmp_file=strend(tmp_path);
- dp= (struct dirent*) dirent_tmp;
-
- while (!(READDIR(dirp,(struct dirent*) dirent_tmp,dp)))
+ for (dp= readdir(dirp) ; dp; dp= readdir(dirp))
{
if (!(finfo.name= strdup_root(names_storage, dp->d_name)))
goto error;
}
(void) closedir(dirp);
-#if !defined(HAVE_READDIR_R)
- mysql_mutex_unlock(&THR_LOCK_open);
-#endif
+
result->dir_entry= (FILEINFO *)dir_entries_storage->buffer;
result->number_off_files= dir_entries_storage->elements;
DBUG_RETURN(result);
error:
-#if !defined(HAVE_READDIR_R)
- mysql_mutex_unlock(&THR_LOCK_open);
-#endif
my_errno=errno;
if (dirp)
(void) closedir(dirp);
* Returns pointer to dst;
*/
-char * directory_file_name (char * dst, const char *src)
+static char* directory_file_name(char *dst, const char *src)
{
/* Process as Unix format: just remove test the final slash. */
char *end;
int my_fstat(File Filedes, MY_STAT *stat_area,
- myf MyFlags __attribute__((unused)))
+ myf MyFlags MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("my_fstat");
DBUG_PRINT("my",("fd: %d MyFlags: %d", Filedes, MyFlags));
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "mysys_priv.h"
-void my_message_stderr(uint error __attribute__((unused)),
+void my_message_stderr(uint error MY_ATTRIBUTE((unused)),
const char *str, myf MyFlags)
{
DBUG_ENTER("my_message_stderr");
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if MY_REDEL_MAKE_COPY is given, then the orginal file
is renamed to org_name-'current_time'.BAK
+
+ if MY_REDEL_NO_COPY_STAT is given, stats are not copied
+ from org_name to tmp_name.
*/
#define REDEL_EXT ".BAK"
DBUG_PRINT("my",("org_name: '%s' tmp_name: '%s' MyFlags: %d",
org_name,tmp_name,MyFlags));
- if (my_copystat(org_name,tmp_name,MyFlags) < 0)
- goto end;
+ if (!(MyFlags & MY_REDEL_NO_COPY_STAT))
+ {
+ if (my_copystat(org_name,tmp_name,MyFlags) < 0)
+ goto end;
+ }
if (MyFlags & MY_REDEL_MAKE_BACKUP)
{
char name_buff[FN_REFLEN+20];
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
void (*fatal_error_handler_hook)(uint error, const char *str, myf MyFlags)=
my_message_stderr;
-static void proc_info_dummy(void *a __attribute__((unused)),
- const PSI_stage_info *b __attribute__((unused)),
- PSI_stage_info *c __attribute__((unused)),
- const char *d __attribute__((unused)),
- const char *e __attribute__((unused)),
- const unsigned int f __attribute__((unused)))
+static void proc_info_dummy(void *a MY_ATTRIBUTE((unused)),
+ const PSI_stage_info *b MY_ATTRIBUTE((unused)),
+ PSI_stage_info *c MY_ATTRIBUTE((unused)),
+ const char *d MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)),
+ const unsigned int f MY_ATTRIBUTE((unused)))
{
return;
}
-/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#endif
-int my_is_symlink(const char *filename __attribute__((unused)))
+int my_is_symlink(const char *filename MY_ATTRIBUTE((unused)))
{
#if defined (HAVE_LSTAT) && defined (S_ISLNK)
struct stat stat_buff;
-/* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#else /* NEED_EXPLICIT_SYNC_DIR */
-int my_sync_dir(const char *dir_name __attribute__((unused)),
- myf my_flags __attribute__((unused)))
+int my_sync_dir(const char *dir_name MY_ATTRIBUTE((unused)),
+ myf my_flags MY_ATTRIBUTE((unused)))
{
return 0;
}
#else /* NEED_EXPLICIT_SYNC_DIR */
-int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
- myf my_flags __attribute__((unused)))
+int my_sync_dir_by_file(const char *file_name MY_ATTRIBUTE((unused)),
+ myf my_flags MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
mysql_mutex_init(key_my_thread_var_mutex, &tmp->mutex, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_my_thread_var_suspend, &tmp->suspend, NULL);
- tmp->stack_ends_here= (char*)&tmp +
- STACK_DIRECTION * (long)my_thread_stack_size;
-
mysql_mutex_lock(&THR_LOCK_threads);
tmp->id= ++thread_id;
++THR_thread_count;
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
C_MODE_START
-#define NNN __attribute__((unused))
+#define NNN MY_ATTRIBUTE((unused))
static void register_mutex_noop(const char *category NNN,
PSI_mutex_info *info NNN,
}
static int
-set_thread_connect_attrs_noop(const char *buffer __attribute__((unused)),
- uint length __attribute__((unused)),
- const void *from_cs __attribute__((unused)))
+set_thread_connect_attrs_noop(const char *buffer MY_ATTRIBUTE((unused)),
+ uint length MY_ATTRIBUTE((unused)),
+ const void *from_cs MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Special case for ORDER BY / GROUP BY CHAR(0) NOT NULL
*/
static
-int ptr_compare_zero_length(size_t *compare_length __attribute__((unused)),
- uchar **a __attribute__((unused)),
- uchar **b __attribute__((unused)))
+int ptr_compare_zero_length(size_t *compare_length MY_ATTRIBUTE((unused)),
+ uchar **a MY_ATTRIBUTE((unused)),
+ uchar **b MY_ATTRIBUTE((unused)))
{
return 0;
}
/* Get a pointer to a optimal byte-compare function for a given size */
#ifdef __sun
-qsort2_cmp get_ptr_compare (size_t size __attribute__((unused)))
+qsort2_cmp get_ptr_compare (size_t size MY_ATTRIBUTE((unused)))
{
return (qsort2_cmp) native_compare;
}
-/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <execinfo.h>
#endif
+#ifdef __linux__
+/* __bss_start doesn't seem to work on FreeBSD and doesn't exist on OSX/Solaris. */
#define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end)
-
static char *heap_start;
-
-#ifdef HAVE_BSS_START
extern char *__bss_start;
-#endif
+#else
+#define PTR_SANE(p) (p)
+#endif /* __linux */
void my_init_stacktrace()
{
-#ifdef HAVE_BSS_START
+#ifdef __linux__
heap_start = (char*) &__bss_start;
-#endif
+#endif /* __linux__ */
}
#ifdef __linux__
void my_safe_print_str(const char* val, int max_len)
{
+#ifdef __linux__
+/* Only needed by the linux version of PTR_SANE */
char *heap_end;
-#ifdef __linux__
if (!safe_print_str(val, max_len))
return;
-#endif
heap_end= (char*) sbrk(0);
+#endif
if (!PTR_SANE(val))
{
/* Use Solaris' symbolic stack trace routine. */
#include <ucontext.h>
-void my_print_stacktrace(uchar* stack_bottom __attribute__((unused)),
- ulong thread_stack __attribute__((unused)))
+void my_print_stacktrace(uchar* stack_bottom MY_ATTRIBUTE((unused)),
+ ulong thread_stack MY_ATTRIBUTE((unused)))
{
if (printstack(fileno(stderr)) == -1)
my_safe_printf_stderr("%s",
#if BACKTRACE_DEMANGLE
-char __attribute__ ((weak)) *
-my_demangle(const char *mangled_name __attribute__((unused)),
- int *status __attribute__((unused)))
+char MY_ATTRIBUTE ((weak)) *
+my_demangle(const char *mangled_name MY_ATTRIBUTE((unused)),
+ int *status MY_ATTRIBUTE((unused)))
{
return NULL;
}
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
void free_record(void *record);
static uchar *hash2_key(const uchar *rec,uint *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=(uint) (uchar) rec[reclength-1];
return (uchar*) rec;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM)
#endif
-static sig_handler thread_alarm(int sig __attribute__((unused)));
+static sig_handler thread_alarm(int sig MY_ATTRIBUTE((unused)));
-static int compare_ulong(void *not_used __attribute__((unused)),
+static int compare_ulong(void *not_used MY_ATTRIBUTE((unused)),
uchar *a_ptr,uchar* b_ptr)
{
ulong a=*((ulong*) a_ptr),b= *((ulong*) b_ptr);
every second.
*/
-sig_handler process_alarm(int sig __attribute__((unused)))
+sig_handler process_alarm(int sig MY_ATTRIBUTE((unused)))
{
sigset_t old_mask;
/*
}
-static sig_handler process_alarm_part2(int sig __attribute__((unused)))
+static sig_handler process_alarm_part2(int sig MY_ATTRIBUTE((unused)))
{
ALARM *alarm_data;
DBUG_ENTER("process_alarm");
*/
-static sig_handler thread_alarm(int sig __attribute__((unused)))
+static sig_handler thread_alarm(int sig MY_ATTRIBUTE((unused)))
{
#ifdef MAIN
printf("thread_alarm\n"); fflush(stdout);
/* set up a alarm thread with uses 'sleep' to sleep between alarms */
#ifdef USE_ALARM_THREAD
-static void *alarm_handler(void *arg __attribute__((unused)))
+static void *alarm_handler(void *arg MY_ATTRIBUTE((unused)))
{
int error;
struct timespec abstime;
/* Can't do this yet */
}
-sig_handler process_alarm(int sig __attribute__((unused)))
+sig_handler process_alarm(int sig MY_ATTRIBUTE((unused)))
{
/* Can't do this yet */
}
#endif /* USE_ONE_SIGNAL_HAND */
-static void *signal_hand(void *arg __attribute__((unused)))
+static void *signal_hand(void *arg MY_ATTRIBUTE((unused)))
{
sigset_t set;
int sig,error,err_count=0;;
}
-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char **argv MY_ATTRIBUTE((unused)))
{
pthread_t tid;
pthread_attr_t thr_attr;
#else /* !defined(DONT_USE_ALARM_THREAD) */
-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char **argv MY_ATTRIBUTE((unused)))
{
printf("thr_alarm disabled with DONT_USE_THR_ALARM\n");
exit(1);
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* The following functions is for WRITE_CONCURRENT_INSERT */
-static void test_get_status(void* param __attribute__((unused)),
- int concurrent_insert __attribute__((unused)))
+static void test_get_status(void* param MY_ATTRIBUTE((unused)),
+ int concurrent_insert MY_ATTRIBUTE((unused)))
{
}
-static void test_update_status(void* param __attribute__((unused)))
+static void test_update_status(void* param MY_ATTRIBUTE((unused)))
{
}
-static void test_copy_status(void* to __attribute__((unused)) ,
- void *from __attribute__((unused)))
+static void test_copy_status(void* to MY_ATTRIBUTE((unused)) ,
+ void *from MY_ATTRIBUTE((unused)))
{
}
-static my_bool test_check_status(void* param __attribute__((unused)))
+static my_bool test_check_status(void* param MY_ATTRIBUTE((unused)))
{
return 0;
}
}
-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char **argv MY_ATTRIBUTE((unused)))
{
pthread_t tid;
pthread_attr_t thr_attr;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int safe_mutex_init(safe_mutex_t *mp,
- const pthread_mutexattr_t *attr __attribute__((unused)),
+ const pthread_mutexattr_t *attr MY_ATTRIBUTE((unused)),
const char *file,
uint line)
{
This is ok, as this thread may not yet have been exited.
*/
-void safe_mutex_end(FILE *file __attribute__((unused)))
+void safe_mutex_end(FILE *file MY_ATTRIBUTE((unused)))
{
if (!safe_mutex_count) /* safetly */
pthread_mutex_destroy(&THR_LOCK_mutex);
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static int test_rb_tree(TREE_ELEMENT *element);
#endif
-void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
+void init_tree(TREE *tree, size_t default_alloc_size, ulong memory_limit,
int size, qsort_cmp2 compare, my_bool with_delete,
tree_element_free free_element, const void *custom_arg)
{
}
if (!(tree->with_delete=with_delete))
{
- init_alloc_root(&tree->mem_root, (uint) default_alloc_size, 0);
+ init_alloc_root(&tree->mem_root, default_alloc_size, 0);
tree->mem_root.min_malloc=(sizeof(TREE_ELEMENT)+tree->size_of_element);
}
DBUG_VOID_RETURN;
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
uint32 wt_success_stats;
static my_atomic_rwlock_t
- cycle_stats_lock __attribute__((unused)),
- wait_stats_lock __attribute__((unused)),
- success_stats_lock __attribute__((unused));
+ cycle_stats_lock MY_ATTRIBUTE((unused)),
+ wait_stats_lock MY_ATTRIBUTE((unused)),
+ success_stats_lock MY_ATTRIBUTE((unused));
#ifdef SAFE_STATISTICS
#define incr(VAR, LOCK) \
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static char my_defaults_file_buffer[FN_REFLEN];
static char my_defaults_extra_file_buffer[FN_REFLEN];
-static char my_login_file[FN_REFLEN];
-
static my_bool defaults_already_read= FALSE;
#ifdef WITH_WSREP
char wsrep_defaults_file[FN_REFLEN + 10]={0,};
char wsrep_defaults_group_suffix[FN_EXTLEN]={0,};
#endif /* WITH_WREP */
-/* Set to TRUE, if --no-defaults is found. */
-static my_bool found_no_defaults= FALSE;
-
-/* Set to TRUE, when login file is being processed. */
-static my_bool is_login_file= FALSE;
-
/* Which directories are searched for options (and in which order) */
#define MAX_DEFAULT_DIRS 6
};
static int search_default_file(Process_option_func func, void *func_ctx,
- const char *dir, const char *config_file);
+ const char *dir, const char *config_file,
+ my_bool is_login_file);
static int search_default_file_with_ext(Process_option_func func,
void *func_ctx,
const char *dir, const char *ext,
- const char *config_file, int recursion_level);
-static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file);
-
+ const char *config_file,
+ int recursion_level,
+ my_bool is_login_file);
+static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file,
+ my_bool is_login_file);
/**
Create the list of default directories.
func_ctx It's context. Usually it is the structure to
store additional options.
default_directories List of default directories.
+ found_no_defaults TRUE, if --no-defaults is specified.
DESCRIPTION
Process the default options from argc & argv
int my_search_option_files(const char *conf_file, int *argc, char ***argv,
uint *args_used, Process_option_func func,
- void *func_ctx, const char **default_directories)
+ void *func_ctx, const char **default_directories,
+ my_bool is_login_file, my_bool found_no_defaults)
{
const char **dirs, *forced_default_file, *forced_extra_defaults;
int error= 0;
(char **) &forced_default_file,
(char **) &forced_extra_defaults,
(char **) &my_defaults_group_suffix,
- (char **) &my_login_path);
+ (char **) &my_login_path, found_no_defaults);
if (! my_defaults_group_suffix)
my_defaults_group_suffix= getenv(STRINGIFY_ARG(DEFAULT_GROUP_SUFFIX_ENV));
// If conf_file is an absolute path, we only read it
if (dirname_length(conf_file))
{
- if ((error= search_default_file(func, func_ctx, NullS, conf_file)) < 0)
- goto err;
+ if ((error= search_default_file(func, func_ctx, NullS, conf_file,
+ is_login_file)) < 0)
+ goto err;
}
// If my defaults file is set (from a previous run), we read it
else if (my_defaults_file)
{
if ((error= search_default_file_with_ext(func, func_ctx, "", "",
- my_defaults_file, 0)) < 0)
+ my_defaults_file, 0,
+ is_login_file)) < 0)
goto err;
if (error > 0)
{
{
if (**dirs)
{
- if (search_default_file(func, func_ctx, *dirs, conf_file) < 0)
- goto err;
+ if (search_default_file(func, func_ctx, *dirs, conf_file,
+ is_login_file) < 0)
+ goto err;
}
else if (my_defaults_extra_file)
{
if ((error= search_default_file_with_ext(func, func_ctx, "", "",
- my_defaults_extra_file, 0)) < 0)
- goto err; /* Fatal error */
+ my_defaults_extra_file, 0,
+ is_login_file)) < 0)
+ goto err; /* Fatal error */
if (error > 0)
{
fprintf(stderr, "Could not open required defaults file: %s\n",
char **defaults,
char **extra_defaults,
char **group_suffix,
- char **login_path)
+ char **login_path,
+ my_bool found_no_defaults)
{
int org_argc= argc, prev_argc= 0, default_option_count= 0;
*defaults= *extra_defaults= *group_suffix= *login_path= 0;
return my_load_defaults(conf_file, groups, argc, argv, &default_directories);
}
+/** A global to turn off or on reading the mylogin file. On by default */
+my_bool my_defaults_read_login_file= TRUE;
/*
Read options from configurations files
char *ptr,**res;
struct handle_option_ctx ctx;
const char **dirs;
+ char my_login_file[FN_REFLEN];
+ my_bool found_no_defaults= false;
uint args_sep= my_getopt_use_args_separator ? 1 : 0;
DBUG_ENTER("load_defaults");
if ((error= my_search_option_files(conf_file, argc, argv,
&args_used, handle_default_option,
- (void *) &ctx, dirs)))
+ (void *) &ctx, dirs, false, found_no_defaults)))
{
free_root(&alloc,MYF(0));
DBUG_RETURN(error);
}
- /* Read options from login group. */
- is_login_file= TRUE;
- if (my_default_get_login_file(my_login_file, sizeof(my_login_file)) &&
- (error= my_search_option_files(my_login_file,argc, argv, &args_used,
- handle_default_option, (void *) &ctx,
- dirs)))
+ if (my_defaults_read_login_file)
{
- free_root(&alloc,MYF(0));
- DBUG_RETURN(error);
+ /* Read options from login group. */
+ if (my_default_get_login_file(my_login_file, sizeof(my_login_file)) &&
+ (error= my_search_option_files(my_login_file, argc, argv, &args_used,
+ handle_default_option, (void *) &ctx,
+ dirs, true, found_no_defaults)))
+ {
+ free_root(&alloc, MYF(0));
+ DBUG_RETURN(error);
+ }
}
- is_login_file= FALSE;
-
/*
Here error contains <> 0 only if we have a fully specified conf_file
or a forced default file
static int search_default_file(Process_option_func opt_handler,
void *handler_ctx,
const char *dir,
- const char *config_file)
+ const char *config_file,
+ my_bool is_login_file)
{
char **ext;
const char *empty_list[]= { "", 0 };
int error;
if ((error= search_default_file_with_ext(opt_handler, handler_ctx,
dir, *ext,
- config_file, 0)) < 0)
+ config_file, 0, is_login_file)) < 0)
return error;
}
return 0;
group groups to read
recursion_level the level of recursion, got while processing
"!include" or "!includedir"
+ is_login_file TRUE, when login file is being processed.
RETURN
0 Success
const char *dir,
const char *ext,
const char *config_file,
- int recursion_level)
+ int recursion_level,
+ my_bool is_login_file)
{
char name[FN_REFLEN + 10], buff[4096], curr_gr[4096], *ptr, *end, **tmp_ext;
char *value, option[4096+2], tmp[FN_REFLEN];
}
fn_format(name,name,"","",4);
- if ((rc= check_file_permissions(name)) < 2)
+ if ((rc= check_file_permissions(name, is_login_file)) < 2)
return (int) rc;
if (is_login_file)
strncpy(wsrep_defaults_file, name, sizeof(wsrep_defaults_file) - 1);
#endif /* WITH_WSREP */
- while (mysql_file_getline(buff, sizeof(buff) - 1, fp))
+ while (mysql_file_getline(buff, sizeof(buff) - 1, fp, is_login_file))
{
line++;
/* Ignore comment and empty lines */
MY_UNPACK_FILENAME | MY_SAFE_PATH);
search_default_file_with_ext(opt_handler, handler_ctx, "", "", tmp,
- recursion_level + 1);
+ recursion_level + 1, is_login_file);
}
}
goto err;
search_default_file_with_ext(opt_handler, handler_ctx, "", "", ptr,
- recursion_level + 1);
+ recursion_level + 1, is_login_file);
}
continue;
of scrambled login file, the line read is first
decrypted and then returned.
- @param str [out] Buffer to store the read text.
- @param size [in] At max, size-1 bytes to be read.
- @param file [in] Source file.
+ @param str [out] Buffer to store the read text.
+ @param size [in] At max, size-1 bytes to be read.
+ @param file [in] Source file.
+ @param is_login_file [in] TRUE, when login file is being processed.
@return 1 Success
0 Error
*/
-static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file)
+static my_bool mysql_file_getline(char *str, int size, MYSQL_FILE *file,
+ my_bool is_login_file)
{
uchar cipher[4096], len_buf[MAX_CIPHER_STORE_LEN];
static unsigned char my_key[LOGIN_KEY_LEN];
char buf[FN_REFLEN];
size_t len;
char *p;
- my_bool err __attribute__((unused));
+ my_bool err MY_ATTRIBUTE((unused));
len= normalize_dirname(buf, dir);
if (!(p= strmake_root(alloc, buf, len)))
/**
Check file permissions of the option file.
- @param file_name [in] Name of the option file.
+ @param file_name [in] Name of the option file.
+ @param is_login_file [in] TRUE, when login file is being processed.
@return 0 - Non-allowable file permissions.
1 - Failed to stat.
2 - Success.
*/
-int check_file_permissions(const char *file_name)
+int check_file_permissions(const char *file_name, my_bool is_login_file)
{
#if !defined(__WIN__)
MY_STAT stat_info;
-/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
static void fini_one_value(const struct my_option *option, void *variable,
- longlong value __attribute__ ((unused)))
+ longlong value MY_ATTRIBUTE ((unused)))
{
DBUG_ENTER("fini_one_value");
switch ((option->var_type & GET_TYPE_MASK)) {
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">\r
\r
<!--\r
- Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.\r
+ Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.\r
\r
This program is free software; you can redistribute it and/or modify\r
it under the terms of the GNU General Public License as published by\r
</InstallUISequence>\r
\r
<!-- Find previous installation -->\r
- <Property Id="INSTALLDIR">\r
+ <Property Id="GETINSTALLDIR">\r
<RegistrySearch Id="FindInstallLocation"\r
Root="HKLM"\r
Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[OLDERVERSIONBEINGUPGRADED]"\r
Name="InstallLocation"\r
Type="raw" />\r
</Property>\r
+ <CustomAction Id="SetInstall" Property="INSTALLDIR" Value="[GETINSTALLDIR]" />\r
+ <InstallUISequence>\r
+ <Custom Action="SetInstall" After="AppSearch">Installed</Custom>\r
+ </InstallUISequence>\r
<?if @Platform@ != "x64" ?>\r
<Property Id="OLDERVERSION"> \r
<RegistrySearch Id="FindOlderVersion"\r
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
case "$1" in
configure)
+# MySQL 5.6.34 needs this
+ MYSQLFILES=/var/lib/mysql-files
+ if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ];
+ then
+ mkdir ${MYSQLFILES}
+ chown mysql:mysql ${MYSQLFILES}
+ chmod 770 ${MYSQLFILES}
+ fi
+
if [ -z "$2" ];
then
set -e
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
MYSQLDATA=/var/lib/mysql
MYSQLLOG=/var/log/mysql
MYSQLRUN=/var/run/mysqld
+ MYSQLFILES=/var/lib/mysql-files
server_stop
rm -rf ${MYSQLDATA}
fi
+ if [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ];
+ then
+ rm -rf ${MYSQLFILES}
+ fi
+
if getent passwd mysql >/dev/null;
then
userdel mysql
rm -rf ${MYSQLDATA}
fi
+ if [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ];
+ then
+ rm -rf ${MYSQLFILES}
+ fi
+
if getent passwd mysql >/dev/null;
then
userdel mysql
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
fi
MYSQLDATA=/var/lib/mysql
+ MYSQLFILES=/var/lib/mysql-files
MYSQLLOG=/var/log/mysql
MYSQLRUN=/var/run/mysqld
chmod 750 ${MYSQLDATA}
fi
+ if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ];
+ then
+ mkdir ${MYSQLFILES}
+ chown mysql:mysql ${MYSQLFILES}
+ chmod 770 ${MYSQLFILES}
+ fi
+
if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
then
mkdir ${MYSQLLOG}
Default: false
Description: Remove data directory at /var/lib/mysql ?
This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ Additionally, any import or export files stored at '/var/lib/mysql-files' will be removed along with directory.
It is highly recommended to take data backup before removing the data directory.
Template: mysql-community-server/data-dir
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
+debian/extra/connection_control-plugin
/var/lib/mysql/ r,
/var/lib/mysql/** rwk,
+# Allow data files dir access
+ /var/lib/mysql-files/ r,
+ /var/lib/mysql-files/** rwk,
+
# Allow log file access
/var/log/mysql/ r,
/var/log/mysql/** rw,
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
case "$1" in
configure)
+# MySQL 5.6.34 needs this
+ MYSQLFILES=/var/lib/mysql-files
+ if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ];
+ then
+ mkdir ${MYSQLFILES}
+ chown mysql:mysql ${MYSQLFILES}
+ chmod 770 ${MYSQLFILES}
+ fi
+
if [ -z "$2" ];
then
set -e
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
MYSQLDATA=/var/lib/mysql
MYSQLLOG=/var/log/mysql
MYSQLRUN=/var/run/mysqld
+ MYSQLFILES=/var/lib/mysql-files
server_stop
rm -rf ${MYSQLDATA}
fi
+ if [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ];
+ then
+ rm -rf ${MYSQLFILES}
+ fi
+
if getent passwd mysql >/dev/null;
then
userdel mysql
rm -rf ${MYSQLDATA}
fi
+ if [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ];
+ then
+ rm -rf ${MYSQLFILES}
+ fi
+
if getent passwd mysql >/dev/null;
then
userdel mysql
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
fi
MYSQLDATA=/var/lib/mysql
+ MYSQLFILES=/var/lib/mysql-files
MYSQLLOG=/var/log/mysql
MYSQLRUN=/var/run/mysqld
chmod 750 ${MYSQLDATA}
fi
+ if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ];
+ then
+ mkdir ${MYSQLFILES}
+ chown mysql:mysql ${MYSQLFILES}
+ chmod 770 ${MYSQLFILES}
+ fi
+
if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
then
mkdir ${MYSQLLOG}
Default: false
Description: Remove data directory at /var/lib/mysql ?
This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ Additionally, any import or export files stored at '/var/lib/mysql-files' will be removed along with directory.
It is highly recommended to take data backup before removing the data directory.
Template: mysql-community-server/data-dir
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
+debian/extra/connection_control-plugin
/var/lib/mysql/ r,
/var/lib/mysql/** rwk,
+# Allow data files dir access
+ /var/lib/mysql-files/ r,
+ /var/lib/mysql-files/** rwk,
+
# Allow log file access
/var/log/mysql/ r,
/var/log/mysql/** rw,
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
case "$1" in
configure)
+# MySQL 5.6.34 needs this
+ MYSQLFILES=/var/lib/mysql-files
+ if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ];
+ then
+ mkdir ${MYSQLFILES}
+ chown mysql:mysql ${MYSQLFILES}
+ chmod 770 ${MYSQLFILES}
+ fi
+
if [ -z "$2" ];
then
set -e
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
MYSQLDATA=/var/lib/mysql
MYSQLLOG=/var/log/mysql
MYSQLRUN=/var/run/mysqld
+ MYSQLFILES=/var/lib/mysql-files
server_stop
rm -rf ${MYSQLDATA}
fi
+ if [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ];
+ then
+ rm -rf ${MYSQLFILES}
+ fi
+
if getent passwd mysql >/dev/null;
then
userdel mysql
rm -rf ${MYSQLDATA}
fi
+ if [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ];
+ then
+ rm -rf ${MYSQLFILES}
+ fi
+
if getent passwd mysql >/dev/null;
then
userdel mysql
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
fi
MYSQLDATA=/var/lib/mysql
+ MYSQLFILES=/var/lib/mysql-files
MYSQLLOG=/var/log/mysql
MYSQLRUN=/var/run/mysqld
chmod 750 ${MYSQLDATA}
fi
+ if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ];
+ then
+ mkdir ${MYSQLFILES}
+ chown mysql:mysql ${MYSQLFILES}
+ chmod 770 ${MYSQLFILES}
+ fi
+
if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
then
mkdir ${MYSQLLOG}
Default: false
Description: Remove data directory at /var/lib/mysql ?
This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ Additionally, any import or export files stored at '/var/lib/mysql-files' will be removed along with directory.
It is highly recommended to take data backup before removing the data directory.
Template: mysql-community-server/data-dir
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
+debian/extra/connection_control-plugin
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
case "$1" in
configure)
+# MySQL 5.6.34 needs this
+ MYSQLFILES=/var/lib/mysql-files
+ if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ];
+ then
+ mkdir ${MYSQLFILES}
+ chown mysql:mysql ${MYSQLFILES}
+ chmod 770 ${MYSQLFILES}
+ fi
+
if [ -z "$2" ];
then
set -e
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
MYSQLDATA=/var/lib/mysql
MYSQLLOG=/var/log/mysql
MYSQLRUN=/var/run/mysqld
+ MYSQLFILES=/var/lib/mysql-files
server_stop
rm -rf ${MYSQLDATA}
fi
+ if [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ];
+ then
+ rm -rf ${MYSQLFILES}
+ fi
+
if getent passwd mysql >/dev/null;
then
userdel mysql
rm -rf ${MYSQLDATA}
fi
+ if [ -d ${MYSQLFILES} ] || [ -L ${MYSQLFILES} ];
+ then
+ rm -rf ${MYSQLFILES}
+ fi
+
if getent passwd mysql >/dev/null;
then
userdel mysql
#!/bin/bash
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
fi
MYSQLDATA=/var/lib/mysql
+ MYSQLFILES=/var/lib/mysql-files
MYSQLLOG=/var/log/mysql
MYSQLRUN=/var/run/mysqld
chmod 750 ${MYSQLDATA}
fi
+ if [ ! -d ${MYSQLFILES} -a ! -L ${MYSQLFILES} ];
+ then
+ mkdir ${MYSQLFILES}
+ chown mysql:mysql ${MYSQLFILES}
+ chmod 770 ${MYSQLFILES}
+ fi
+
if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
then
mkdir ${MYSQLLOG}
Default: false
Description: Remove data directory at /var/lib/mysql ?
This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ Additionally, any import or export files stored at '/var/lib/mysql-files' will be removed along with directory.
It is highly recommended to take data backup before removing the data directory.
Template: mysql-community-server/data-dir
-# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2014, 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
+debian/extra/connection_control-plugin
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# 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
debian/extra/qa_auth_server-plugin
debian/extra/semisync_master-plugin
debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
debian/extra/validate_password-plugin
--- /dev/null
+mysql-community (5.6.31-1ubuntu16.04) xenial; urgency=medium
+
+ * New upstream release
+
+ -- Lars Tangvald <ltangval@atum23> Tue, 03 May 2016 09:30:33 +0200
+
+mysql-community (5.6.28-1ubuntu15.10) wily; urgency=low
+
+ * New upstream release
+
+ -- Lars Tangvald <lars.tangvald@oracle.com> Thu, 12 Nov 2015 10:34:23 +0100
+
+mysql-community (5.6.26-1ubuntu15.04) vivid; urgency=low
+
+ * new upstream release
+ * mysql-commercial-server now depends on perl, psmisc
+ mysql-commercial-test now depends on python, libmysqlclient-dev
+ (Closes: #20893836)
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Thu, 18 Jun 2015 16:34:10 +0530
+
+mysql-community (5.6.25-3ubuntu15.04) vivid; urgency=low
+
+ * new upstream release
+ * mysql-common now conflicts with
+ mysql-server-5.6, mysql-server-core-5.6
+ mysql-client-5.6, mysql-client-core-5.6
+ * mysql-*-server no more provides
+ mysql-server-5.6, mysql-server-core-5.6
+ * mysql-*-client no more provides
+ mysql-client-5.6, mysql-client-core-5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Mon, 15 Jun 2015 16:48:05 +0530
+
+mysql-community (5.6.24-3ubuntu15.04) vivid; urgency=low
+
+ * updated Standards-Version to 3.9.6 in d/control
+ * apparmor profile updated to allow read on all files under /etc/mysql
+ * added new conf files under d/extra/*.conf
+ * mysql_plugin moved from client to server pkg
+ * innochecksum moved from client to server pkg
+ * server pkg now replaces client pkg
+ * added systemd service profile and script
+ * new /etc/mysql/my.cnf management scheme added for Ubuntu 15.04
+ as discussed in Dec 2014 for native packaging source
+ * added dh "--with systemd" for enabling systemd
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 27 May 2015 11:35:35 +0530
+
+mysql-community (5.6.24-2ubuntu15.04) vivid; urgency=low
+
+ * new upstream release
+ * forked packaging source from utopic to vivid
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 15 Apr 2015 18:52:22 +0530
+
+mysql-community (5.6.24-1ubuntu14.10) utopic; urgency=low
+
+ * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Mon, 16 Feb 2014 15:45:09 +0530
+
+mysql-community (5.6.23-1ubuntu14.10) utopic; urgency=low
+
+ * new upstream release
+ * mysql-community-server now recommends mysql-client
+ * mysql-community-server now depends on apparmor
+ * removed template install-test-db; not installed by default
+ * d/compat incremented to 9 from 8
+ * d/control updated to build depend on debhelper 9
+ * added d/*.lintian-overrides and d/source/lintian-overrides
+ * d/rules updated to reflect correct file permissions
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 31 Dec 2014 10:51:07 +0530
+
+mysql-community (5.6.22-2ubuntu14.10) utopic; urgency=low
+
+ * new upstream release
+ * mysql-common now replaces mysql-server-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 28 Nov 2014 15:18:07 +0530
+
+mysql-community (5.6.22-1ubuntu14.10) utopic; urgency=low
+
+ * new upstream release
+ * fixed d/*server.postinst to allow dropping test db without
+ setting root password
+ * init script will now run my_i_db if data dir is not present or empty
+ * updated init script to read app armor profile on startup
+ * forked packaging source from trusty and rebranded for utopic
+ * updated d/m-c-source.install to pack *.xz packaging source archive
+ * added more system resources to app armor profile
+ * dh_apparmor to now run before dh_installinit in d/rules
+ * libmysqlclient-dev now replaces mysql-client-{,core-}5.6
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 05 Nov 2014 17:04:07 +0530
+
+mysql-community (5.6.21-1ubuntu14.04) trusty; urgency=low
+
+ * new upstream release
+ * updated d/rules to increment -j8 as make option
+ * updated d/source/include-binaries to add mysql_no_login plugin
+ * updated CMake option WITH_EXTRA_CHARSETS from complex to all
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 20 Aug 2014 19:12:30 +0530
+
+mysql-community (5.6.20-1ubuntu14.04) trusty; urgency=low
+
+ * new upstream release
+ * added fakeroot as build-dep in d/control
+ * added d/*.dirs for bench, dev and test pkg
+ * updated d/rules to make compilation verbose
+ * removed default CFLAGS, CXXFLAGS in d/rules
+ * added patch for testsuite search paths under d/patches
+ * modified cmake option for testsuite in d/rules
+ * updated patch d/fix-mysql_install_db.patch
+ * enabled two patches in d/patches/series
+ * removed extra permissions check in d/rules when fixed in source
+ * modified d/mysql-*-server.postinst to stop removing /usr/my.cnf
+ * modified d/*-test.* for updated location of testsuite
+ * updated d/{mysql-*-server.install,rules} to include debug plugins
+ * updated d/rules to remove storage engine cmake options
+ * modified data dir permission in d/*server.{pre,post}inst
+ * updated d/source/include-binaries to add debug plugins
+ * updated d/rules to rename debug plugins
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Wed, 02 Jul 2014 17:45:30 +0530
+
+mysql-community (5.6.19-1ubuntu14.04) trusty; urgency=low
+
+ * new upstream release
+ * d/rules updated to rid of files removed from source
+ * modified path for source tar in source pkg
+ * obscured actual filenames in d/source/include-binaries
+ * modified d/rules to handle obscured filenames
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Mon, 05 May 2014 15:45:10 +0530
+
+mysql-community (5.6.17-1ubuntu14.04) trusty; urgency=low
+
+ * new upstream release
+
+ -- Akhil Mohan <akhil.mohan@oracle.com> Fri, 28 Feb 2014 18:06:30 +0530
--- /dev/null
+Source: mysql-community
+Maintainer: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Section: database
+Priority: optional
+Standards-Version: 3.9.6
+Homepage: http://www.mysql.com/
+Build-Depends: debhelper (>= 9.0.0), libaio-dev[linux-any], libncurses5-dev (>= 5.0-6), perl, zlib1g-dev (>= 1:1.1.3-5), po-debconf, psmisc, bison, dh-apparmor, dh-systemd (>= 1.5), lsb-release, cmake, fakeroot, libnuma-dev
+
+Package: mysql-server
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Server meta package depending on latest version
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql server
+ package available in the repository.
+
+Package: mysql-community-server
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), adduser
+Depends: mysql-common (= ${binary:Version}), apparmor, perl, psmisc,
+ ${shlibs:Depends}, ${misc:Depends}
+Recommends: mysql-client (= ${binary:Version})
+Conflicts: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server
+Replaces: mysql,
+ mysql-server-5.0, mysql-server-core-5.0,
+ mysql-server-5.1, mysql-server-core-5.1,
+ mysql-server-5.5, mysql-server-core-5.5,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mysql-commercial-server,
+ mysql-community-client
+Provides: virtual-mysql-server, virtual-mysql-server-core
+Description: MySQL Server
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package includes the MySQL server binary as well as related
+ utilities to run and administer a MySQL server.
+
+Package: mysql-client
+Architecture: any
+Depends: mysql-community-client (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Client meta package depending on latest version
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql client
+ package available in the repository.
+
+Package: mysql-community-client
+Architecture: any
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Replaces: mysql,
+ mysql-client-5.0, mysql-client-core-5.0,
+ mysql-client-5.1, mysql-client-core-5.1,
+ mysql-client-5.5, mysql-client-core-5.5,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mysql-commercial-client
+Provides: virtual-mysql-client, virtual-mysql-client-core
+Description: MySQL Client
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the standard MySQL clients and
+ administration tools.
+
+Package: libmysqlclient18
+Architecture: any
+Section: libs
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
+Depends: mysql-common (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL shared client libraries
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the shared libraries for MySQL client
+ applications.
+
+Package: mysql-common
+Architecture: any
+Pre-depends: debconf (>= 0.2.17), ${misc:Pre-Depends}
+Multi-Arch: foreign
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-server-5.6, mysql-server-core-5.6,
+ mysql-client-5.6, mysql-client-core-5.6,
+ mariadb-server-5.5, percona-xtradb-cluster-common-5.5
+Replaces: mysql, mysql-server-5.5, mysql-server-core-5.5, libmysqlclient-dev,
+ mysql-server-5.6, mysql-server-core-5.6,
+ mariadb-server-5.5, percona-xtradb-cluster-common-5.5
+Provides: mysql-common, mysql-common-5.6
+Description: MySQL Common
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains common files needed by MySQL client
+ library, MySQL database server, and MySQL embedded server.
+
+Package: libmysqlclient-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient18 (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Replaces: mysql-client-5.6, mysql-client-core-5.6
+Description: MySQL development headers
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the development header files necessary
+ to develop MySQL client applications.
+
+Package: libmysqld-dev
+Architecture: any
+Section: libdevel
+Depends: libmysqlclient-dev (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Description: MySQL embedded server library
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL server as an embedded library.
+
+Package: mysql-testsuite
+Architecture: any
+Depends: mysql-community-test (= ${binary:Version}), ${misc:Depends}
+Description: MySQL Testsuite meta package depending on latest version
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This is a meta package that depends on the latest mysql test
+ package available in the repository.
+
+Package: mysql-community-test
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ mysql-community-client (= ${binary:Version}), python,
+ libmysqlclient-dev, ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql,
+ mysql-testsuite-5.0, mysql-testsuite-5.1, mysql-testsuite-5.5,
+ mysql-testsuite-5.6, mysql-commercial-test
+Description: MySQL Test Run MTR - The MySQL testsuite
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle. This package contains the MySQL regression test suite for MySQL
+ database server.
+
+Package: mysql-community-bench
+Architecture: any
+Depends: mysql-community-server (= ${binary:Version}),
+ ${shlibs:Depends}, ${misc:Depends}
+Conflicts: mysql, mysql-commercial-bench
+Description: MySQL Bench
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
+
+Package: mysql-community-source
+Architecture: any
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: MySQL source
+ The MySQL(TM) software delivers a very fast, multi-threaded, multi-user,
+ and robust SQL (Structured Query Language) database server. MySQL Server
+ is intended for mission-critical, heavy-load production systems as well
+ as for embedding into mass-deployed software. MySQL is a trademark of
+ Oracle.
--- /dev/null
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: MySQL Server 5.6
+Upstream-Contact: MySQL Release Engineering <mysql-build@oss.oracle.com>
+Source: http://dev.mysql.com/
+
+Copyright: 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+License:
+ This is a release of MySQL, a dual-license SQL database server.
+ For the avoidance of doubt, this particular copy of the software
+ is released under the version 2 of the GNU General Public License.
+ MySQL is brought to you by Oracle.
+ .
+ MySQL FOSS License Exception
+ We want free and open source software applications under certain
+ licenses to be able to use specified GPL-licensed MySQL client
+ libraries despite the fact that not all such FOSS licenses are
+ compatible with version 2 of the GNU General Public License.
+ Therefore there are special exceptions to the terms and conditions
+ of the GPLv2 as applied to these client libraries, which are
+ identified and described in more detail in the FOSS License
+ Exception at
+ <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
+ .
+ This distribution may include materials developed by third
+ parties. For license and attribution notices for these
+ materials, please refer to the documentation that accompanies
+ this distribution (see the "Licenses for Third-Party Components"
+ appendix) or view the online documentation at
+ <http://dev.mysql.com/doc/>.
+ .
+ GPLv2 Disclaimer
+ For the avoidance of doubt, except that if any license choice
+ other than GPL or LGPL is available it will apply instead,
+ Oracle elects to use only the General Public License version 2
+ (GPLv2) at this time for any software where a choice of GPL
+ license versions is made available with the language indicating
+ that GPLv2 or any later version may be used, or where a choice
+ .
+ The full text of the GNU General Public License version 2 can
+ be found in the file
+ `/usr/share/mysql/doc/COPYING'.
--- /dev/null
+# vim:syntax=apparmor
+# Last Modified: Fri Feb 28 18:06:30 2014
+#include <tunables/global>
+
+/usr/sbin/mysqld {
+ #include <abstractions/base>
+ #include <abstractions/nameservice>
+ #include <abstractions/user-tmp>
+
+# Allow system resource access
+ /sys/devices/system/cpu/ r,
+ capability sys_resource,
+ capability dac_override,
+ capability setuid,
+ capability setgid,
+
+# Allow config access
+ /etc/mysql/** r,
+
+# Allow pid and socket file access
+ /run/mysqld/mysqld.pid rw,
+ /run/mysqld/mysqld.sock rw,
+
+# Allow read/ write to /tmp
+ /tmp/ r,
+ /tmp/* rw,
+
+# Allow execution of server binary
+ /usr/sbin/mysqld mr,
+ /usr/sbin/mysqld-debug mr,
+
+# Allow plugin access
+ /usr/lib/mysql/plugin/ r,
+ /usr/lib/mysql/plugin/*.so* mr,
+
+# Allow error msg and charset access
+ /usr/share/mysql/ r,
+ /usr/share/mysql/** r,
+
+# Allow data dir access
+ /var/lib/mysql/ r,
+ /var/lib/mysql/** rwk,
+
+# Allow log file access
+ /var/log/mysql/ r,
+ /var/log/mysql/** rw,
+}
--- /dev/null
+# 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
+
+#
+# The MySQL Commercial Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# * IMPORTANT: Additional settings that can override those from this file!
+# The files must end with '.cnf', otherwise they'll be ignored.
+#
+!includedir /etc/mysql/conf.d/
--- /dev/null
+#!/bin/bash
+
+# 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
+
+# Scripts to run by MySQL systemd service
+#
+# Needed argument: pre | post
+#
+# pre mode : try to perform sanity check for configuration, log, data
+# post mode : ping server until answer is received
+
+pinger () {
+ while /bin/true ; do
+ sleep 1
+ mysqladmin ping >/dev/null 2>&1 && break
+ done
+}
+
+sanity () {
+ MYSQLRUN=/var/run/mysqld
+ MYSQLDATA=/var/lib/mysql
+ MYSQLLOG=/var/log/mysql
+
+ if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+ then
+ mkdir ${MYSQLDATA}
+ chown mysql:mysql ${MYSQLDATA}
+ chmod 750 ${MYSQLDATA}
+ fi
+
+ if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+ then
+ mkdir ${MYSQLDATA}/mysql
+ chown mysql:mysql ${MYSQLDATA}/mysql
+ chmod 750 ${MYSQLDATA}/mysql
+ fi
+
+ if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+ then
+ mysql_install_db --user=mysql > /dev/null
+ fi
+
+ if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+ then
+ mkdir ${MYSQLLOG}
+ chown mysql:adm ${MYSQLLOG}
+ chmod 750 ${MYSQLLOG}
+ touch ${MYSQLLOG}/error.log
+ chmod 640 ${MYSQLLOG}/error.log
+ chown mysql:adm ${MYSQLLOG}/error.log
+ fi
+
+ if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+ then
+ mkdir ${MYSQLRUN}
+ chown mysql:mysql ${MYSQLRUN}
+ chmod 755 ${MYSQLRUN}
+ fi
+
+ /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+ if [ ! -r /etc/mysql/my.cnf ]; then
+ echo "MySQL configuration not found at /etc/mysql/my.cnf. Please install one using update-alternatives."
+ exit 1
+ fi
+}
+
+case $1 in
+ "pre") sanity ;;
+ "post") pinger ;;
+esac
--- /dev/null
+# 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
+
+#
+# The MySQL Community Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+# * IMPORTANT: Additional settings that can override those from this file!
+# The files must end with '.cnf', otherwise they'll be ignored.
+#
+!includedir /etc/mysql/conf.d/
+!includedir /etc/mysql/mysql.conf.d/
--- /dev/null
+# 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
+
+#
+# The MySQL Commercial Client configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[mysql]
--- /dev/null
+.so man1/mysql.1
--- /dev/null
+# 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
+
+#
+# The MySQL Commercial Server configuration file.
+#
+# For explanations see
+# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
+
+[mysqld_safe]
+pid-file = /var/run/mysqld/mysqld.pid
+socket = /var/run/mysqld/mysqld.sock
+nice = 0
+
+[mysqld]
+user = mysql
+pid-file = /var/run/mysqld/mysqld.pid
+socket = /var/run/mysqld/mysqld.sock
+port = 3306
+basedir = /usr
+datadir = /var/lib/mysql
+tmpdir = /tmp
+lc-messages-dir = /usr/share/mysql
+explicit_defaults_for_timestamp
+
+# Instead of skip-networking the default is now to listen only on
+# localhost which is more compatible and is not less secure.
+bind-address = 127.0.0.1
+
+log-error = /var/log/mysql/error.log
+
+# Recommended in standard MySQL setup
+sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
+
+# Disabling symbolic-links is recommended to prevent assorted security risks
+symbolic-links=0
--- /dev/null
+# 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/include/mysql/*.h
+usr/include/mysql/mysql/*.h
+usr/include/mysql/mysql/*.h.pp
+usr/include/mysql/mysql/psi/*.h
+usr/lib/*/libmysqlclient.a
+usr/lib/*/libmysqlclient.so
+usr/lib/*/libmysqlservices.a
+usr/bin/mysql_config
+usr/bin/mysql_config_editor
+usr/share/man/man1/mysql_config.1
+usr/share/man/man1/mysql_config_editor.1
+# legal
+usr/share/doc/libmysqlclient-dev/COPYING
+usr/share/doc/libmysqlclient-dev/README
--- /dev/null
+# 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
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/LICENSE.mysql
+libmysqlclient-dev: extra-license-file usr/share/doc/libmysqlclient-dev/COPYING.gz
+libmysqlclient-dev: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient-dev: embedded-library
--- /dev/null
+# 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/*/libmysqlclient.so.*
+# legal
+usr/share/doc/libmysqlclient18/COPYING
+usr/share/doc/libmysqlclient18/README
--- /dev/null
+# 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
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/LICENSE.mysql
+libmysqlclient18: extra-license-file usr/share/doc/libmysqlclient18/COPYING.gz
+libmysqlclient18: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+libmysqlclient18: embedded-library
--- /dev/null
+# 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/*/libmysqld.a
+usr/lib/*/libmysqld-debug.a
+# legal
+usr/share/doc/libmysqld-dev/COPYING
+usr/share/doc/libmysqld-dev/README
--- /dev/null
+# 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
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/LICENSE.mysql
+libmysqld-dev: extra-license-file usr/share/doc/libmysqld-dev/COPYING.gz
+libmysqld-dev: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# 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
+
+# legal
+usr/share/doc/mysql-client/COPYING
+usr/share/doc/mysql-client/README
--- /dev/null
+# 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-client: extra-license-file usr/share/doc/mysql-client/LICENSE.mysql
+mysql-client: extra-license-file usr/share/doc/mysql-client/COPYING.gz
+mysql-client: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# 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
+
+etc/mysql/conf.d
--- /dev/null
+# 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
+
+# configuration file and script
+debian/extra/my.cnf.fallback etc/mysql/
+debian/extra/mysql.conf.cnf etc/mysql/conf.d/mysql.cnf
+
+usr/share/aclocal/mysql.m4
+usr/share/mysql/docs/INFO_SRC
+usr/share/mysql/docs/INFO_BIN
+usr/share/mysql/docs/ChangeLog
+# localized error msgs
+usr/share/mysql/*/errmsg.sys
+usr/share/mysql/errmsg-utf8.txt
+# charsets
+usr/share/mysql/charsets/*.xml
+usr/share/mysql/charsets/README
+# legal
+usr/share/doc/mysql-common/COPYING
+usr/share/doc/mysql-common/README
--- /dev/null
+# 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-common: extra-license-file usr/share/doc/mysql-common/LICENSE.mysql
+mysql-common: extra-license-file usr/share/doc/mysql-common/COPYING.gz
+mysql-common: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+#!/bin/sh
+
+# 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
+
+set -e
+
+if [ "$1" = "configure" ]; then
+ # Low priority fallback for client use when no server is installed.
+ update-alternatives --install /etc/mysql/my.cnf my.cnf /etc/mysql/my.cnf.fallback 100
+fi
+
+#DEBHELPER#
--- /dev/null
+#!/bin/bash
+
+# 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
+
+set -e
+
+if [ "$1" = "purge" ]; then
+ rmdir /etc/mysql 2>/dev/null || true
+ update-alternatives --remove-all my.cnf
+fi
+
+#DEBHELPER#
--- /dev/null
+# 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-community-bench/COPYING
+usr/share/doc/mysql-community-bench/README
--- /dev/null
+# 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-community-bench: extra-license-file usr/share/doc/mysql-community-bench/LICENSE.mysql
+mysql-community-bench: extra-license-file usr/share/doc/mysql-community-bench/COPYING.gz
+mysql-community-bench: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# 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
+
+# binaries
+usr/bin/myisam_ftdump
+usr/bin/mysql
+usr/bin/mysql_embedded
+usr/bin/mysqlaccess
+usr/bin/mysqlaccess.conf
+usr/bin/mysqladmin
+usr/bin/mysqlbug
+usr/bin/mysqlcheck
+usr/bin/mysql_client_test
+usr/bin/mysql_client_test_embedded
+usr/bin/mysqldump
+usr/bin/mysqldumpslow
+usr/bin/mysql_find_rows
+usr/bin/mysql_fix_extensions
+usr/bin/mysqlimport
+usr/bin/mysqlshow
+usr/bin/mysqlslap
+usr/bin/mysql_waitpid
+# man pages
+usr/share/man/man1/myisam_ftdump.1
+usr/share/man/man1/mysql.1
+usr/share/man/man1/mysql_embedded.1
+usr/share/man/man1/mysqlaccess.1
+usr/share/man/man1/mysqladmin.1
+usr/share/man/man1/mysqlbug.1
+usr/share/man/man1/mysqlcheck.1
+usr/share/man/man1/mysql_client_test.1
+usr/share/man/man1/mysql_client_test_embedded.1
+usr/share/man/man1/mysqldump.1
+usr/share/man/man1/mysqldumpslow.1
+usr/share/man/man1/mysql_find_rows.1
+usr/share/man/man1/mysql_fix_extensions.1
+usr/share/man/man1/mysqlimport.1
+usr/share/man/man1/mysqlman.1
+usr/share/man/man1/mysqlshow.1
+usr/share/man/man1/mysqlslap.1
+usr/share/man/man1/mysql_waitpid.1
+# legal
+usr/share/doc/mysql-community-client/COPYING
+usr/share/doc/mysql-community-client/README
--- /dev/null
+# 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-community-client: extra-license-file usr/share/doc/mysql-community-client/LICENSE.mysql
+mysql-community-client: extra-license-file usr/share/doc/mysql-community-clienti/COPYING.gz
+mysql-community-client: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-client: embedded-library
--- /dev/null
+#!/bin/bash
+
+# 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/share/debconf/confmodule
+
+if [ "$1" = "configure" ] && [ -z "$2" ];
+then
+
+ set -e
+
+ PKG_LIST=mysql-server-5.5:mysql-server-5.6:mysql-community-server:mysql-commercial-server
+ INSTALLED_PKG=none
+ MYSQLDATA=/var/lib/mysql
+
+ IFS_BACKUP=${IFS}
+ IFS=":"
+ for PKG in ${PKG_LIST};
+ do
+ STATUS=$(dpkg -s ${PKG} 2> /dev/null | grep Status: | cut -d' ' -f4)
+ if [ "${STATUS}" = "installed" ];
+ then
+ INSTALLED_PKG=${PKG}
+ break
+ fi
+ done
+ IFS=${IFS_BACKUP}
+
+ if [ "${INSTALLED_PKG}" = "none" ];
+ then
+ if [ -d ${MYSQLDATA} -o -L ${MYSQLDATA} ];
+ then
+ db_input high mysql-community-server/data-dir || true
+ else
+ db_fset mysql-community-server/data-dir seen true
+ fi
+
+ while :; do
+ PASSWD=""
+ db_input high mysql-community-server/root-pass || true
+ db_go
+
+ db_get mysql-community-server/root-pass
+ if [ -z "${RET}" ];
+ then
+ db_fset mysql-community-server/root-pass seen true
+ db_fset mysql-community-server/re-root-pass seen true
+ break
+ fi
+ PASSWD="${RET}"
+
+ db_input high mysql-community-server/re-root-pass || true
+ db_go
+
+ db_get mysql-community-server/re-root-pass
+ if [ "${RET}" == "${PASSWD}" ];
+ then
+ PASSWD=""
+ break
+ fi
+
+ db_fset mysql-community-server/root-pass-mismatch seen false
+ db_input critical mysql-community-server/root-pass-mismatch
+ db_set mysql-community-server/root-pass ""
+ db_set mysql-community-server/re-root-pass ""
+ done
+
+ else
+ db_fset mysql-community-server/data-dir seen true
+ db_fset mysql-community-server/root-pass seen true
+ db_fset mysql-community-server/re-root-pass seen true
+ fi
+
+ set +e
+fi
--- /dev/null
+# 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
+
+etc/mysql/mysql.conf.d
+etc/init.d
+usr/lib/mysql
+usr/lib/mysql/plugin
--- /dev/null
+# 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
+
+# binaries
+usr/bin/innochecksum
+usr/bin/msql2mysql
+usr/bin/myisamchk
+usr/bin/myisamlog
+usr/bin/myisampack
+usr/bin/my_print_defaults
+usr/bin/mysqlbinlog
+usr/bin/mysql_convert_table_format
+usr/bin/mysqld_multi
+usr/bin/mysqld_safe
+usr/bin/mysqlhotcopy
+usr/bin/mysql_install_db
+usr/bin/mysql_plugin
+usr/bin/mysql_secure_installation
+usr/bin/mysql_setpermission
+usr/bin/mysqltest
+usr/bin/mysqltest_embedded
+usr/bin/mysql_tzinfo_to_sql
+usr/bin/mysql_upgrade
+usr/bin/mysql_zap
+usr/bin/perror
+usr/bin/replace
+usr/bin/resolveip
+usr/bin/resolve_stack_dump
+usr/sbin/mysqld
+# debug binary
+usr/sbin/mysqld-debug
+# man pages
+usr/share/man/man1/innochecksum.1
+usr/share/man/man1/comp_err.1
+usr/share/man/man1/msql2mysql.1
+usr/share/man/man1/myisamchk.1
+usr/share/man/man1/myisamlog.1
+usr/share/man/man1/myisampack.1
+usr/share/man/man1/my_print_defaults.1
+usr/share/man/man1/mysqlbinlog.1
+usr/share/man/man1/mysql_convert_table_format.1
+usr/share/man/man1/mysqld_multi.1
+usr/share/man/man1/mysqld_safe.1
+usr/share/man/man1/mysqlhotcopy.1
+usr/share/man/man1/mysql_install_db.1
+usr/share/man/man1/mysql_plugin.1
+usr/share/man/man1/mysql_secure_installation.1
+usr/share/man/man1/mysql.server.1
+usr/share/man/man1/mysql_setpermission.1
+usr/share/man/man1/mysql-stress-test.pl.1
+usr/share/man/man1/mysqltest.1
+usr/share/man/man1/mysqltest_embedded.1
+usr/share/man/man1/mysql_tzinfo_to_sql.1
+usr/share/man/man1/mysql_upgrade.1
+usr/share/man/man1/mysql_zap.1
+usr/share/man/man1/perror.1
+usr/share/man/man1/replace.1
+usr/share/man/man1/resolveip.1
+usr/share/man/man1/resolve_stack_dump.1
+usr/share/man/man8/mysqld.8
+# confguration files
+debian/extra/mysql.cnf etc/mysql/
+debian/extra/mysqld.cnf etc/mysql/mysql.conf.d/
+# app armor profile
+etc/apparmor.d/usr.sbin.mysqld
+# SQL files
+usr/share/mysql/*.sql
+# plugins
+usr/lib/mysql/plugin/*.so
+usr/lib/mysql/plugin/debug/*.so
+usr/lib/mysql/plugin/daemon_example.ini
+usr/lib/mysql/plugin/debug/daemon_example.ini
+# support files
+usr/share/mysql/mysqld_multi.server
+usr/share/mysql/magic
+usr/share/mysql/mysql-log-rotate
+usr/share/mysql/mysql-systemd-start
+usr/share/mysql/my-default.cnf
+usr/share/mysql/dictionary.txt
+# legal
+usr/share/doc/mysql-community-server/COPYING
+usr/share/doc/mysql-community-server/README
--- /dev/null
+# 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-community-server: extra-license-file usr/share/doc/mysql-community-server/LICENSE.mysql
+mysql-community-server: extra-license-file usr/share/doc/mysql-community-server/COPYING.gz
+mysql-community-server: copyright-should-refer-to-common-license-file-for-lgpl
+# Due to static linking this cannot be avoided and hence being overridden
+mysql-community-server: embedded-library
+# Since we ship debug plugins so this error is overridden
+mysql-community-server: unstripped-binary-or-object usr/lib/mysql/plugin/debug/*
--- /dev/null
+#!/bin/bash
+#
+### BEGIN INIT INFO
+# Provides: mysql
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Should-Start: $network $time
+# Should-Stop: $network $time
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start/ Stop MySQL Community Server daemon
+# Description: This service script facilitates startup and shutdown of
+# mysqld daemon throught its wrapper script mysqld_safe
+### END INIT INFO
+#
+
+# Copyright (c) 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
+
+. /lib/lsb/init-functions
+
+cd /
+umask 077
+
+MYSQLDATA=/var/lib/mysql
+VERSION=$(mysqld --version | grep mysqld | cut -d' ' -f4)
+
+get_mysql_option() {
+ RESULT=$(my_print_defaults "$1" | sed -n "s/^--$2=//p" | tail -n 1)
+ if [ -z "$RESULT" ];
+ then
+ RESULT="$3"
+ fi
+ echo $RESULT
+}
+
+get_running () {
+ PIDFILE=$(get_mysql_option mysqld_safe pid-file "")
+ if [ -z "$PIDFILE" ];
+ then
+ PIDFILE=$(get_mysql_option mysqld pid-file "$MYSQLDATA/$(hostname).pid")
+ fi
+ if [ -e "$PIDFILE" ] && [ -d "/proc/$(cat "$PIDFILE")" ];
+ then
+ echo 1
+ else
+ echo 0
+ fi
+}
+
+server_stop () {
+ RUNNING=$(get_running)
+ COUNT=0
+ while :; do
+ COUNT=$(( COUNT+1 ))
+ echo -n .
+ if [ "${RUNNING}" -eq 0 ];
+ then
+ echo
+ break
+ fi
+ if [ "${COUNT}" -gt 15 ];
+ then
+ echo
+ return 1
+ fi
+ RUNNING=$(get_running)
+ sleep 1
+ done
+ return 0
+}
+
+case "$1" in
+ 'start')
+ RUNNING=$(get_running)
+ if [ "${RUNNING}" -eq 1 ];
+ then
+ log_action_msg "A MySQL Server is already started"
+ else
+ MYSQLRUN=/var/run/mysqld
+ MYSQLDATA=/var/lib/mysql
+ MYSQLLOG=/var/log/mysql
+
+ if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+ then
+ mkdir ${MYSQLDATA}
+ chown mysql:mysql ${MYSQLDATA}
+ chmod 750 ${MYSQLDATA}
+ fi
+
+ if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+ then
+ mkdir ${MYSQLDATA}/mysql
+ chown mysql:mysql ${MYSQLDATA}/mysql
+ chmod 750 ${MYSQLDATA}/mysql
+ fi
+
+ if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+ then
+ mysql_install_db --user=mysql > /dev/null
+ fi
+
+ if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+ then
+ mkdir ${MYSQLLOG}
+ chown mysql:adm ${MYSQLLOG}
+ chmod 750 ${MYSQLLOG}
+ touch ${MYSQLLOG}/error.log
+ chmod 640 ${MYSQLLOG}/error.log
+ chown mysql:adm ${MYSQLLOG}/error.log
+ fi
+
+ if [ ! -d "${MYSQLRUN}" -a ! -L "${MYSQLRUN}" ];
+ then
+ mkdir ${MYSQLRUN}
+ chown mysql:mysql ${MYSQLRUN}
+ chmod 755 ${MYSQLRUN}
+ fi
+
+ /lib/init/apparmor-profile-load usr.sbin.mysqld
+
+ su - mysql -s /bin/bash -c "mysqld_safe > /dev/null &"
+ for i in 1 2 3 4 5 6;
+ do
+ sleep 1
+ echo -n .
+ done
+ echo
+ RUNNING=$(get_running)
+ if [ "${RUNNING}" -eq 1 ];
+ then
+ log_action_msg "MySQL Community Server ${VERSION} is started"
+ else
+ log_action_msg "MySQL Community Server ${VERSION} did not start. Please check logs for more details."
+ fi
+ fi
+ ;;
+
+ 'stop')
+ RUNNING=$(get_running)
+ if [ "${RUNNING}" -eq 1 ];
+ then
+ killall -15 mysqld
+ server_stop
+ if [ "$?" -eq 0 ];
+ then
+ log_action_msg "MySQL Community Server ${VERSION} is stopped"
+ else
+ log_action_msg "Attempt to shutdown MySQL Community Server ${VERSION} timed out"
+ fi
+ else
+ log_action_msg "MySQL Community Server ${VERSION} is already stopped"
+ fi
+ ;;
+
+ 'restart'|'reload'|'force-reload')
+ log_action_msg "Stopping MySQL Community Server ${VERSION}"
+ $0 stop
+ log_action_msg "Re-starting MySQL Community Server ${VERSION}"
+ $0 start
+ ;;
+
+ 'status')
+ RUNNING=$(get_running)
+ if [ ${RUNNING} -eq 1 ];
+ then
+ log_action_msg "MySQL Community Server ${VERSION} is running"
+ else
+ log_action_msg "MySQL Community Server ${VERSION} is not running"
+ exit 3
+ fi
+ ;;
+
+ *)
+ echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
+ exit 1
+ ;;
+esac
+
+exit 0
--- /dev/null
+# 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
+
+# MySQL systemd service file
+
+[Unit]
+Description=MySQL Community Server
+After=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+User=mysql
+Group=mysql
+PermissionsStartOnly=true
+ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
+ExecStart=/usr/bin/mysqld_safe
+ExecStartPost=/usr/share/mysql/mysql-systemd-start post
+TimeoutSec=600
+Restart=on-failure
--- /dev/null
+#!/bin/bash
+
+# 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/share/debconf/confmodule
+
+take_upstart_job_backup () {
+ if [ -e "/etc/init/mysql.conf" ] && [ -d "/var/lib/mysql" ];
+ then
+ mv /etc/init/mysql.conf /var/lib/mysql/.mysql.conf.backup
+ fi
+}
+
+case "$1" in
+ configure)
+
+ if [ -z "$2" ];
+ then
+ set -e
+
+ update-alternatives --install /etc/mysql/my.cnf my.cnf "/etc/mysql/mysql.cnf" 200
+
+ MYSQLDATA=/var/lib/mysql
+
+ if [ ! -d "${MYSQLDATA}/mysql" -a ! -L "${MYSQLDATA}/mysql" ];
+ then
+ mkdir ${MYSQLDATA}/mysql
+ chown mysql:mysql ${MYSQLDATA}/mysql
+ chmod 750 ${MYSQLDATA}/mysql
+ if [ ! "$(ls -A ${MYSQLDATA}/mysql)" ];
+ then
+ mysql_install_db --user=mysql > /dev/null
+ fi
+ fi
+
+ db_get mysql-community-server/root-pass && PASSWD=${RET}
+ if [ ! -z "${PASSWD}" ];
+ then
+ db_set mysql-community-server/root-pass ""
+ db_set mysql-community-server/re-root-pass ""
+ PASSWD="UPDATE user SET password=PASSWORD('${PASSWD}') WHERE user='root';"
+ else
+ PASSWD=""
+ fi
+
+ SQL=`mktemp`
+ if [ -f "${SQL}" ];
+ then
+ chmod 700 ${SQL}
+ cat << EOF > ${SQL}
+USE mysql;
+${PASSWD}
+DELETE FROM user WHERE user='';
+FLUSH PRIVILEGES;
+EOF
+ mysqld --basedir=/usr --bootstrap --user=mysql --skip-grant-tables < $SQL
+ PASSWD=""
+ rm -f ${SQL}
+ fi
+
+ set +e
+
+ fi
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-configure)
+
+ ;;
+
+ *)
+ exit 1
+ ;;
+esac
+
+db_stop
+
+take_upstart_job_backup
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+# 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
+
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ];
+then
+. /usr/share/debconf/confmodule
+fi
+
+place_upstart_job_back () {
+ if [ -e "/var/lib/mysql/.mysql.conf.backup" ];
+ then
+ mv /var/lib/mysql/.mysql.conf.backup /etc/init/mysql.conf
+ fi
+}
+
+get_pcount () {
+ PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+ echo "${PSCOUNT}"
+}
+
+server_stop () {
+ PSCOUNT=$(get_pcount)
+ COUNT=0
+ while :; do
+ COUNT=$(( COUNT+1 ))
+ echo -n .
+ if [ "${PSCOUNT}" -eq 1 ];
+ then
+ echo
+ break
+ fi
+ if [ "${COUNT}" -gt 15 ];
+ then
+ echo
+ return 1
+ fi
+ PSCOUNT=$(get_pcount)
+ sleep 1
+ done
+ return 0
+}
+
+case "$1" in
+ remove)
+
+ set -e
+
+ place_upstart_job_back
+ update-alternatives --remove my.cnf "/etc/mysql/mysql.cnf"
+
+ set +e
+
+ ;;
+
+ purge)
+
+ set -e
+
+ place_upstart_job_back
+
+ MYSQLDATA=/var/lib/mysql
+ MYSQLLOG=/var/log/mysql
+ MYSQLRUN=/var/run/mysqld
+
+ server_stop
+
+ db_input high mysql-community-server/remove-data-dir || true
+ db_go
+ db_get mysql-community-server/remove-data-dir && RMDATADIR=${RET}
+ if [ "${RMDATADIR}" = "true" ];
+ then
+ if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+ then
+ rm -rf ${MYSQLRUN}
+ fi
+
+ if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+ then
+ rm -rf ${MYSQLLOG}
+ fi
+
+ if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+ then
+ rm -rf ${MYSQLDATA}
+ fi
+
+ if getent passwd mysql >/dev/null;
+ then
+ userdel mysql
+ fi
+ fi
+
+ set +e
+ ;;
+
+ abort-install)
+
+ set -e
+
+ place_upstart_job_back
+
+ if [ -x "/etc/init.d/mysql" ];
+ then
+ invoke-rc.d mysql start || exit $?
+ else
+ if [ -d ${MYSQLRUN} ] || [ -L ${MYSQLRUN} ];
+ then
+ rm -rf ${MYSQLRUN}
+ fi
+
+ if [ -d ${MYSQLLOG} ] || [ -L ${MYSQLLOG} ];
+ then
+ rm -rf ${MYSQLLOG}
+ fi
+
+ if [ -d ${MYSQLDATA} ] || [ -L ${MYSQLDATA} ];
+ then
+ rm -rf ${MYSQLDATA}
+ fi
+
+ if getent passwd mysql >/dev/null;
+ then
+ userdel mysql
+ fi
+ fi
+
+ set +e
+ ;;
+
+ upgrade|abort-upgrade)
+
+ ;;
+
+ *)
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+# 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
+
+get_pcount () {
+ PSCOUNT=$(ps -ef | grep "/usr/sbin/mysqld" | wc -l)
+ echo "${PSCOUNT}"
+}
+
+server_stop () {
+ PSCOUNT=$(get_pcount)
+ COUNT=0
+ while :; do
+ COUNT=$(( COUNT+1 ))
+ echo -n .
+ if [ "${PSCOUNT}" -eq 1 ];
+ then
+ echo
+ break
+ fi
+ if [ "${COUNT}" -gt 15 ];
+ then
+ echo
+ return 1
+ fi
+ PSCOUNT=$(get_pcount)
+ sleep 1
+ done
+ return 0
+}
+
+case "$1" in
+ install)
+
+ if [ -z "$2" ];
+ then
+
+ set -e
+
+ if [ -x "/etc/init.d/mysql" ];
+ then
+ invoke-rc.d mysql stop || exit $?
+ server_stop
+ fi
+
+ MYSQLDATA=/var/lib/mysql
+ MYSQLLOG=/var/log/mysql
+ MYSQLRUN=/var/run/mysqld
+
+ if ! getent group mysql >/dev/null;
+ then
+ addgroup --system mysql >/dev/null
+ fi
+
+ if ! getent passwd mysql >/dev/null;
+ then
+ adduser --ingroup mysql --system --disabled-login --no-create-home --home ${MYSQLDATA} --shell /bin/false --gecos "MySQL Server" mysql >/dev/null
+ fi
+
+ if [ ! -d ${MYSQLDATA} -a ! -L ${MYSQLDATA} ];
+ then
+ mkdir ${MYSQLDATA}
+ chown mysql:mysql ${MYSQLDATA}
+ chmod 750 ${MYSQLDATA}
+ fi
+
+ if [ ! -d ${MYSQLLOG} -a ! -L ${MYSQLLOG} ];
+ then
+ mkdir ${MYSQLLOG}
+ chown mysql:adm ${MYSQLLOG}
+ chmod 750 ${MYSQLLOG}
+ touch ${MYSQLLOG}/error.log
+ chmod 640 ${MYSQLLOG}/error.log
+ chown mysql:adm ${MYSQLLOG}/error.log
+ fi
+
+ if [ ! -d ${MYSQLRUN} -a ! -L ${MYSQLRUN} ];
+ then
+ mkdir ${MYSQLRUN}
+ chown mysql:mysql ${MYSQLRUN}
+ chmod 755 ${MYSQLRUN}
+ fi
+
+ set +e
+
+ fi
+
+ ;;
+
+ upgrade)
+
+ set -e
+
+ #DEBHELPER#
+ server_stop
+
+ set +e
+
+ ;;
+
+ abort-upgrade)
+
+ ;;
+
+ *)
+ exit 1
+ ;;
+esac
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+# 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
+
+set -e
+
+#DEBHELPER#
+
+set +e
+
+exit 0
--- /dev/null
+Template: mysql-community-server/root-pass
+Type: password
+Description: Enter root password:
+ Please provide a strong password that will be set for the root account of your MySQL database.
+ Leave it blank if you do not wish to set or change the root password at this time.
+
+Template: mysql-community-server/re-root-pass
+Type: password
+Description: Re-enter root password:
+ Now that you have selected a password for the root account, please confirm by typing it again. Do not share the password with anyone.
+
+Template: mysql-community-server/root-pass-mismatch
+Type: error
+Description: The two passwords did not match
+ Please try again. Make sure you type the exact same password twice.
+
+Template: mysql-community-server/remove-data-dir
+Type: boolean
+Default: false
+Description: Remove data directory at /var/lib/mysql ?
+ This operation will remove the data directory that stores all the databases, tables and related meta-data.
+ It is highly recommended to take data backup before removing the data directory.
+
+Template: mysql-community-server/data-dir
+Type: note
+Description: Data directory found when no MySQL server package is installed
+ A data directory '/var/lib/mysql' is present on this system when no MySQL server
+ package is currently installed on the system. The directory may be under control of
+ server package received from third-party vendors. It may also be an unclaimed data
+ directory from previous removal of mysql packages.
+ .
+ It is highly recommended to take data backup. If you have not done so, now would be
+ the time to take backup in another shell. Once completed, press 'Ok' to continue.
--- /dev/null
+# 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
+
+../*.dsc usr/src/mysql/
+../*.tar.gz usr/src/mysql/
+../*.tar.xz usr/src/mysql/
+# legal
+usr/share/doc/mysql-community-source/COPYING
+usr/share/doc/mysql-community-source/README
--- /dev/null
+# 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-community-source: extra-license-file usr/share/doc/mysql-community-source/LICENSE.mysql
+mysql-community-source: extra-license-file usr/share/doc/mysql-community-source/COPYING.gz
+mysql-community-source: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# 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-test/*
+usr/share/man/man1/mysql-test-run.pl.1
+# legal
+usr/share/doc/mysql-community-test/COPYING
+usr/share/doc/mysql-community-test/README
--- /dev/null
+# 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-test/mysql-test-run.pl usr/lib/mysql-test/mysql-test-run
+usr/lib/mysql-test/mysql-test-run.pl usr/lib/mysql-test/mtr
--- /dev/null
+# 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-community-test: extra-license-file usr/share/doc/mysql-community-test/LICENSE.mysql
+mysql-community-test: extra-license-file usr/share/doc/mysql-community-test/COPYING.gz
+mysql-community-test: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# 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
+
+# legal
+usr/share/doc/mysql-server/COPYING
+usr/share/doc/mysql-server/README
--- /dev/null
+# 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-server: extra-license-file usr/share/doc/mysql-server/LICENSE.mysql
+mysql-server: extra-license-file usr/share/doc/mysql-server/COPYING.gz
+mysql-server: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+# 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
+
+# legal
+usr/share/doc/mysql-testsuite/COPYING
+usr/share/doc/mysql-testsuite/README
--- /dev/null
+# 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-testsuite: extra-license-file usr/share/doc/mysql-testsuite/LICENSE.mysql
+mysql-testsuite: extra-license-file usr/share/doc/mysql-testsuite/COPYING.gz
+mysql-testsuite: copyright-should-refer-to-common-license-file-for-lgpl
--- /dev/null
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Fix path in man page link.
+Bug: http://bugs.mysql.com/bug.php?id=70952
+
+--- a/man/mysql_client_test_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysql_client_test_embedded.1 2013-11-14 19:29:56.768315219 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysql_client_test.1
++.so man1/mysql_client_test.1
+--- a/man/mysqltest_embedded.1 2013-11-08 19:00:22.000000000 +0530
++++ b/man/mysqltest_embedded.1 2013-11-14 19:31:19.079280675 +0530
+@@ -1 +1 @@
+-.so man-gpl-tmp2/mysqltest.1
++.so man1/mysqltest.1
--- /dev/null
+From: Akhil Mohan <akhil.mohan@oracle.com>
+Description: Adding extra search path for testsuite.
+
+--- a/mysql-test/lib/mtr_cases.pm 2014-02-24 13:14:37 +0530
++++ b/mysql-test/lib/mtr_cases.pm 2014-07-02 11:46:24 +0530
+@@ -288,6 +288,7 @@
+ {
+ $suitedir= my_find_dir($::basedir,
+ ["share/mysql-test/suite",
++ "lib/mysql-test/suite",
+ "mysql-test/suite",
+ "internal/mysql-test/suite",
+ "mysql-test",
--- /dev/null
+From: Terje Røsten <terje.rosten@oracle.com>
+Description: Maintains the pending --skip-my-cnf option in mainline
+Bug: <TODO>
+
+diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
+index 440a977..7d068fc 100644
+--- a/scripts/mysql_install_db.pl.in
++++ b/scripts/mysql_install_db.pl.in
+@@ -113,6 +113,7 @@ EOF2
+ print <<EOF3;
+ --rpm For internal use. This option is used by RPM files
+ during the MySQL installation process.
++ Implies --keep-my-cnf option.
+ --skip-name-resolve Use IP addresses rather than hostnames when creating
+ grant table entries. This option can be useful if
+ your DNS does not work.
+@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} )
+ {
+ error($opt,"Specify either --basedir or --srcdir, not both");
+ }
+-if ( $opt->{'keep-my-cnf'} )
++if ( $opt->{rpm} || $opt->{'keep-my-cnf'} )
+ {
+ $keep_my_cnf = 1;
+ }
+@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
+ }
+
+ # ----------------------------------------------------------------------
+-# Create database directories mysql & test
++# Create database directory mysql
+ # ----------------------------------------------------------------------
+
+ # FIXME The shell variant uses "mkdir -p":
+@@ -697,7 +698,7 @@ if ($opt_user)
+ }
+ }
+
+-foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
++foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql")
+ {
+ mkdir($dir, 0700) unless -d $dir;
+ if ($opt_user and -w "/")
--- /dev/null
+# 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
+
+#fix-man-page-links.patch
+fix-mysql_install_db.patch
+fix-mtr-search-paths.patch
--- /dev/null
+#!/usr/bin/make -f
+
+# 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
+
+%:
+ dh $@
+
+export DH_VERBOSE=1
+export CFLAGS=
+export CXXFLAGS=
+
+override_dh_auto_configure:
+ @echo "RULES.$@"
+ cmake . \
+ -DBUILD_CONFIG=mysql_release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DINSTALL_DOCDIR=share/mysql/docs \
+ -DINSTALL_DOCREADMEDIR=share/mysql \
+ -DINSTALL_INCLUDEDIR=include/mysql \
+ -DINSTALL_INFODIR=share/mysql/docs \
+ -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
+ -DINSTALL_MANDIR=share/man \
+ -DINSTALL_MYSQLSHAREDIR=share/mysql \
+ -DINSTALL_MYSQLTESTDIR=lib/mysql-test \
+ -DINSTALL_PLUGINDIR=lib/mysql/plugin \
+ -DINSTALL_SBINDIR=sbin \
+ -DINSTALL_SCRIPTDIR=bin \
+ -DINSTALL_SQLBENCHDIR=lib/mysql \
+ -DINSTALL_SUPPORTFILESDIR=share/mysql \
+ -DMYSQL_DATADIR=/var/lib/mysql \
+ -DSYSCONFDIR=/etc/mysql \
+ -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
+ -DWITH_SSL=bundled \
+ -DWITH_ZLIB=system \
+ -DWITH_EXTRA_CHARSETS=all \
+ -DWITH_INNODB_MEMCACHED=1 \
+ -DCOMPILATION_COMMENT="MySQL Community Server (GPL)" \
+ -DINSTALL_LAYOUT=DEB
+
+ cat CMakeCache.txt
+ touch $@
+
+override_dh_auto_build:
+ @echo "RULES.$@"
+ $(MAKE) -j8 VERBOSE=1
+ touch $@
+
+override_dh_auto_test:
+ @echo "RULES.$@"
+ echo "No tests run because test 9: pfs_connect_attr is failing unreasonably"
+ touch $@
+
+override_dh_auto_install:
+
+ @echo "RULES.$@"
+ # complete install first
+ $(MAKE) install DESTDIR=debian/tmp
+ # remove all redundant files and links
+ rm debian/tmp/usr/lib/*/*_r*
+ rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
+ rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
+ rm debian/tmp/usr/lib/mysql-test/Makefile
+ # add missing man pages
+ install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
+ # add MySQL Server debug binary and library to package
+ install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
+ install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
+ # add debug plugin libraries to package
+ install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
+ for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
+ install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
+ install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
+ # add apparmor profile
+ install -g root -o root -m 0644 -D debian/extra/apparmor-profile debian/tmp/etc/apparmor.d/usr.sbin.mysqld
+ # add systemd script
+ install -m 0755 debian/extra/mysql-systemd-start debian/tmp/usr/share/mysql/
+ # add directory for legal docs
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-server
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-server
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-client
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-client
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-common
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient18
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqlclient-dev
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/libmysqld-dev
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-bench
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-testsuite
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-test
+ install -g root -o root -m 0755 -d debian/tmp/usr/share/doc/mysql-community-source
+ # add COPYING file to each package
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-server/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-server/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-client/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-client/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-common/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient18/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqlclient-dev/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/libmysqld-dev/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-bench/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-testsuite/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-test/COPYING
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/COPYING debian/tmp/usr/share/doc/mysql-community-source/COPYING
+ # add README file to each package
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-server/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-server/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-client/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-client/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-common/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient18/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqlclient-dev/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/libmysqld-dev/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-bench/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-testsuite/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-test/README
+ install -g root -o root -m 0644 debian/tmp/usr/share/mysql/README debian/tmp/usr/share/doc/mysql-community-source/README
+ touch $@
+
+override_dh_installinit:
+ @echo "RULES.$@"
+ dh_apparmor -pmysql-community-server --profile-name=usr.sbin.mysqld
+ dh_systemd_enable --name=mysql
+ dh_installinit --name=mysql -- defaults 19 21
+ dh_systemd_start --restart-after-upgrade
+ touch $@
--- /dev/null
+3.0 (quilt)
--- /dev/null
+# 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
+
+# obscured filename for mysqld-debug, libmysqld-debug.a and debug plugins
+debian/extra/server-binary
+debian/extra/embedded-server
+debian/extra/adt_null-plugin
+debian/extra/auth-plugin
+debian/extra/auth_socket-plugin
+debian/extra/auth_test_plugin-plugin
+debian/extra/innodb_engine-plugin
+debian/extra/libdaemon_example-plugin
+debian/extra/libmemcached-plugin
+debian/extra/mypluglib-plugin
+debian/extra/mysql_no_login-plugin
+debian/extra/qa_auth_client-plugin
+debian/extra/qa_auth_interface-plugin
+debian/extra/qa_auth_server-plugin
+debian/extra/semisync_master-plugin
+debian/extra/semisync_slave-plugin
+debian/extra/test_udf_services-plugin
+debian/extra/validate_password-plugin
--- /dev/null
+version=3
+http://mysql.mirrors.pair.com/Downloads/MySQL-5.6/mysql-([\d\.]+).tar.gz
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Remove test plugins
for p in auth.so auth_test_plugin.so daemon_example.ini libdaemon_example.so qa_auth_client.so \
- qa_auth_interface.so qa_auth_server.so replication_observers_example_plugin.so ha_example.so ; do
+ qa_auth_interface.so qa_auth_server.so replication_observers_example_plugin.so ha_example.so \
+ test_udf_services.so ; do
rm -f %{buildroot}%{_libdir}/mysql/plugin/$p
done
%dir %{_libdir}/mysql/plugin
%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/connection_control.so
%attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so
%attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so
%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
%dir %attr(750, mysql, mysql) /var/lib/mysql-files
%changelog
+* Tue Sep 13 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.34-1
+- Add connection_control.so to server subpackage
+
+* Mon Mar 14 2016 Georgi Kodinov <georgi.kodinov@oracle.com> - 5.6.31-1
+- Add test_udf_services.so plugin
+
* Thu Jun 25 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.26-1
- Update package names
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
FOREACH(fedfile my.cnf my_config.h mysql_config.sh
mysqld.service mysql-systemd-start mysql.conf
- mysql-5.6.16-mysql-install.patch mysql-5.6-libmysqlclient-symbols.patch)
+ mysql-5.6.16-mysql-install.patch)
CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY)
ENDFOREACH()
ENDIF()
datadir=$(get_option mysqld datadir "/var/lib/mysql")
# Restore log, dir, perms and SELinux contexts
- [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
+ if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
+ install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
+ fi
log=/var/log/mysqld.log
[ -e $log ] || touch $log
chmod 0640 $log
if [ -x /usr/sbin/restorecon ]; then
/usr/sbin/restorecon "$datadir"
/usr/sbin/restorecon $log
+ for dir in /var/lib/mysql-files ; do
+ if [ -x /usr/sbin/semanage -a -d /var/lib/mysql -a -d $dir ] ; then
+ /usr/sbin/semanage fcontext -a -e /var/lib/mysql $dir >/dev/null 2>&1
+ /sbin/restorecon $dir
+ fi
+ done
fi
# If special mysql dir is in place, skip db install
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
%global license_type GPLv2
%endif
+%global min 5.6.10
+
Name: mysql-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Source3: mysql.conf
Source4: my_config.h
Source6: mysql_config.sh
-Patch0: mysql-5.6-libmysqlclient-symbols.patch
-Patch1: mysql-5.6.16-mysql-install.patch
+Patch0: mysql-5.6.16-mysql-install.patch
BuildRequires: cmake
BuildRequires: perl
BuildRequires: time
Requires: net-tools
%if 0%{?commercial}
Obsoletes: mysql-community-server < %{version}-%{release}
-Requires: mysql-commercial-client%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-client%{?_isa} >= %{min}
Requires: mysql-commercial-common%{?_isa} = %{version}-%{release}
%else
-Requires: mysql-community-client%{?_isa} = %{version}-%{release}
+Requires: mysql-community-client%{?_isa} >= %{min}
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
%endif
Obsoletes: mariadb-server
Obsoletes: mariadb-galera-server
+Obsoletes: mariadb-server-galera
Obsoletes: community-mysql-server < %{version}-%{release}
Obsoletes: mysql-server < %{version}-%{release}
Provides: mysql-server = %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-client < %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: mariadb
Obsoletes: community-mysql < %{version}-%{release}
Summary: Test suite for the MySQL database server
Group: Applications/Databases
%if 0%{?commercial}
-Requires: mysql-commercial-server%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-server%{?_isa} >= %{min}
Obsoletes: mysql-community-test < %{version}-%{release}
%else
-Requires: mysql-community-server%{?_isa} = %{version}-%{release}
+Requires: mysql-community-server%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-test
Obsoletes: community-mysql-test < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-bench < %{version}-%{release}
-Requires: mysql-commercial-server%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-server%{?_isa} >= %{min}
%else
-Requires: mysql-community-server%{?_isa} = %{version}-%{release}
+Requires: mysql-community-server%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-bench
Obsoletes: community-mysql-bench < %{obs_ver}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-devel < %{version}-%{release}
-Requires: mysql-enterprise-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-devel
Obsoletes: community-mysql-devel < %{obs_ver}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-libs < %{version}-%{release}
-Requires: mysql-commercial-common%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-common%{?_isa} >= %{min}
%else
-Requires: mysql-community-common%{?_isa} = %{version}-%{release}
+Requires: mysql-community-common%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-libs
Obsoletes: community-mysql-libs < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-embedded-devel < %{version}-%{release}
-Requires: mysql-commercial-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-commercial-embedded%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-devel%{?_isa} >= %{min}
+Requires: mysql-commercial-embedded%{?_isa} >= %{min}
%else
-Requires: mysql-community-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-community-embedded%{?_isa} = %{version}-%{release}
+Requires: mysql-community-devel%{?_isa} >= %{min}
+Requires: mysql-community-embedded%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-embedded-devel
Obsoletes: community-mysql-embedded-devel < %{version}-%{release}
%setup -q -T -a 0 -c -n %{src_dir}
pushd %{src_dir}
%patch0 -p1
-%patch1 -p1
%build
# Fail quickly and obviously if user tries to build as root
-DINSTALL_SQLBENCHDIR=share \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
+ -DWITH_SYMVER16=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \
-DINSTALL_SQLBENCHDIR=share \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
+ -DWITH_SYMVER16=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \
install -d -m 0755 %{buildroot}%{_datadir}/mysql/SELinux/RHEL4
install -d -m 0755 %{buildroot}/var/lib/mysql
install -d -m 0755 %{buildroot}/var/run/mysqld
+install -d -m 0750 %{buildroot}/var/lib/mysql-files
# Install all binaries
pushd $MBD/release
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir" >/dev/null 2>&1 || :
/bin/touch /var/log/mysqld.log >/dev/null 2>&1 || :
+/bin/chown mysql:mysql /var/log/mysqld.log >/dev/null 2>&1 || :
%systemd_post mysqld.service
/usr/bin/systemctl enable mysqld >/dev/null 2>&1 || :
%dir %{_libdir}/mysql/plugin
%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/connection_control.so
%attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so
%attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so
%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
%dir %{_libdir}/mysql/plugin/debug
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/connection_control.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
%dir %attr(755, mysql, mysql) /var/lib/mysql
%dir %attr(755, mysql, mysql) /var/run/mysqld
+%dir %attr(750, mysql, mysql) /var/lib/mysql-files
%files common
%defattr(-, root, root, -)
%attr(755, root, root) %{_bindir}/mysqlimport
%attr(755, root, root) %{_bindir}/mysqlshow
%attr(755, root, root) %{_bindir}/mysqlslap
-%attr(755, root, root) %{_bindir}/mysql_config
-%attr(755, root, root) %{_bindir}/mysql_config-%{__isa_bits}
%attr(755, root, root) %{_bindir}/mysql_config_editor
%attr(644, root, root) %{_mandir}/man1/msql2mysql.1*
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/libmysqld.so
%changelog
+* Mon Oct 31 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.35-1
+- Add connection_control.so to server subpackage
+
+* Mon Sep 26 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.34-1
+- Include mysql-files directory
+
+* Tue Jul 05 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.32-1
+- Remove mysql_config from client subpackage
+
+* Mon Mar 14 2016 Georgi Kodinov <georgi.kodinov@oracle.com> - 5.6.31-1
+- Add test_udf_services.so plugin
+
* Wed Jan 14 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.24-1
- Add mysql_no_login.so plugin
#
# Wrapper script for mysql_config to support multilib
#
-# Only works on OEL6/RHEL6 and similar
#
-# This command respects setarch
+# This command respects setarch, works on OL6/RHEL6 and later
bits=$(rpm --eval %__isa_bits)
case $bits in
- 32|64) status=known ;;
- *) status=unknown ;;
+ 32|64) ;;
+ *) bits=unknown ;;
esac
-if [ "$status" = "unknown" ] ; then
- echo "$0: error: command 'rpm --eval %__isa_bits' returned unknown value: $bits"
- exit 1
+# Try mapping by uname if rpm command failed
+if [ "$bits" = "unknown" ] ; then
+ arch=$(uname -m)
+ case $arch in
+ x86_64|ppc64|ppc64le|aarch64|s390x|sparc64) bits=64 ;;
+ i386|i486|i586|i686|pentium3|pentium4|athlon|ppc|s390|sparc) bits=32 ;;
+ *) bits=unknown ;;
+ esac
fi
+if [ "$bits" == "unknown" ] ; then
+ echo "$0: error: failed to determine isa bits on your arch."
+ exit 1
+fi
if [ -x /usr/bin/mysql_config-$bits ] ; then
/usr/bin/mysql_config-$bits "$@"
echo "$0: error: needed binary: /usr/bin/mysql_config-$bits is missing. Please check your MySQL installation."
exit 1
fi
-
ExecStartPre=/usr/bin/mysql-systemd-start pre
# Start main service
-ExecStart=/usr/bin/mysqld_safe
+ExecStart=/usr/bin/mysqld_safe --basedir=/usr
# Don't signal startup success before a ping works
ExecStartPost=/usr/bin/mysql-systemd-start post
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
FOREACH(fedfile my.cnf my_config.h mysql_config.sh
mysqld.service mysql-systemd-start mysql.conf
mysql-5.6.16-mysql-install.patch mysql.init
- filter-requires.sh filter-provides.sh
- mysql-5.6-libmysqlclient-symbols.patch)
+ filter-requires.sh filter-provides.sh)
CONFIGURE_FILE(${fedfile} ${CMAKE_CURRENT_BINARY_DIR}/${fedfile} COPYONLY)
ENDFOREACH()
ENDIF()
datadir=$(get_option mysqld datadir "/var/lib/mysql")
# Restore log, dir, perms and SELinux contexts
- [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
+ if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
+ install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
+ fi
log=/var/log/mysqld.log
[ -e $log ] || touch $log
chmod 0640 $log
if [ -x /usr/sbin/restorecon ]; then
/usr/sbin/restorecon "$datadir"
/usr/sbin/restorecon $log
+ for dir in /var/lib/mysql-files ; do
+ if [ -x /usr/sbin/semanage -a -d /var/lib/mysql -a -d $dir ] ; then
+ /usr/sbin/semanage fcontext -a -e /var/lib/mysql $dir >/dev/null 2>&1
+ /sbin/restorecon $dir
+ fi
+ done
fi
# If special mysql dir is in place, skip db install
ret=0
else
# prepare for start
- touch "$errlogfile"
- chown mysql:mysql "$errlogfile"
- chmod 0640 "$errlogfile"
+ if [ ! -e "$errlogfile" -a ! -h "$errlogfile" -a "x$(dirname "$errlogfile")" = "x/var/log" ]; then
+ install /dev/null -m0640 -omysql -gmysql "$errlogfile"
+ fi
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
if [ ! -d "$datadir/mysql" ] ; then
# First, make sure $datadir is there with correct permissions
- if [ ! -e "$datadir" -a ! -h "$datadir" ]
- then
- mkdir -p "$datadir" || exit 1
+ if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
+ install -d -m0755 -omysql -gmysql "$datadir" || exit 1
+ fi
+ if [ ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
+ chown mysql:mysql "$datadir"
+ chmod 0755 "$datadir"
+ fi
+ if [ -x /sbin/restorecon ]; then
+ /sbin/restorecon "$datadir"
+ for dir in /var/lib/mysql-files ; do
+ if [ -x /usr/sbin/semanage -a -d /var/lib/mysql -a -d $dir ] ; then
+ /usr/sbin/semanage fcontext -a -e /var/lib/mysql $dir >/dev/null 2>&1
+ /sbin/restorecon $dir
+ fi
+ done
fi
- chown mysql:mysql "$datadir"
- chmod 0755 "$datadir"
- [ -x /sbin/restorecon ] && /sbin/restorecon "$datadir"
# Now create the database
action $"Initializing MySQL database: " /usr/bin/mysql_install_db --rpm --datadir="$datadir" --user=mysql
ret=$?
- chown -R mysql:mysql "$datadir"
if [ $ret -ne 0 ] ; then
return $ret
fi
fi
- chown mysql:mysql "$datadir"
- chmod 0755 "$datadir"
+ if [ ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
+ chown mysql:mysql "$datadir"
+ chmod 0755 "$datadir"
+ fi
# Pass all the options determined above, to ensure consistent behavior.
# In many cases mysqld_safe would arrive at the same conclusions anyway
# but we need to be sure. (An exception is that we don't force the
# alarms, per bug #547485
$exec --datadir="$datadir" --socket="$socketfile" \
--pid-file="$mypidfile" \
- --basedir=/usr --user=mysql >/dev/null 2>&1 &
+ --basedir=/usr --user=mysql >/dev/null &
safe_pid=$!
# Spin for a maximum of N seconds waiting for the server to come up;
# exit the loop immediately if mysqld_safe process disappears.
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
%global license_type GPLv2
%endif
+%global min 5.6.10
+
Name: mysql-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Source90: filter-provides.sh
Source91: filter-requires.sh
Patch0: mysql-5.6.16-mysql-install.patch
-Patch1: mysql-5.6-libmysqlclient-symbols.patch
BuildRequires: cmake
BuildRequires: perl
%{?el7:BuildRequires: perl(Time::HiRes)}
Provides: MySQL-server-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-server-advanced < %{version}-%{release}
Obsoletes: mysql-community-server < %{version}-%{release}
-Requires: mysql-commercial-client%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-client%{?_isa} >= %{min}
Requires: mysql-commercial-common%{?_isa} = %{version}-%{release}
%else
Provides: MySQL-server%{?_isa} = %{version}-%{release}
-Requires: mysql-community-client%{?_isa} = %{version}-%{release}
+Requires: mysql-community-client%{?_isa} >= %{min}
Requires: mysql-community-common%{?_isa} = %{version}-%{release}
%endif
Obsoletes: MySQL-server < %{version}-%{release}
Provides: MySQL-client-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-client-advanced < %{version}-%{release}
Obsoletes: mysql-community-client < %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
Provides: MySQL-client%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-client < %{version}-%{release}
Obsoletes: mariadb
%endif
Provides: mysql-common = %{version}-%{release}
Provides: mysql-common%{?_isa} = %{version}-%{release}
-%{?el5:Requires: mysql%{?_isa} = %{version}-%{release}}
+%{?el5:Requires: mysql%{?_isa} >= %{min}}
%description common
This packages contains common files needed by MySQL client library,
Provides: MySQL-test-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-test-advanced < %{version}-%{release}
Obsoletes: mysql-community-test < %{version}-%{release}
-Requires: mysql-commercial-server%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-server%{?_isa} >= %{min}
%else
Provides: MySQL-test%{?_isa} = %{version}-%{release}
-Requires: mysql-community-server%{?_isa} = %{version}-%{release}
+Requires: mysql-community-server%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-test < %{version}-%{release}
Obsoletes: mysql-test < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-bench < %{version}-%{release}
-Requires: mysql-commercial-server%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-server%{?_isa} >= %{min}
%else
-Requires: mysql-community-server%{?_isa} = %{version}-%{release}
+Requires: mysql-community-server%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-bench
Obsoletes: community-mysql-bench < %{version}-%{release}
Provides: MySQL-devel-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-devel-advanced < %{version}-%{release}
Obsoletes: mysql-community-devel < %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
Provides: MySQL-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-devel < %{version}-%{release}
Obsoletes: mysql-devel < %{version}-%{release}
Provides: MySQL-shared-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-shared-advanced < %{version}-%{release}
Obsoletes: mysql-community-libs < %{version}-%{release}
-Requires: mysql-commercial-common%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-common%{?_isa} >= %{min}
%else
Provides: MySQL-shared%{?_isa} = %{version}-%{release}
-Requires: mysql-community-common%{?_isa} = %{version}-%{release}
+Requires: mysql-community-common%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-shared < %{version}-%{release}
Obsoletes: mysql-libs < %{version}-%{release}
Provides: MySQL-shared-compat-advanced%{?_isa} = %{version}-%{release}
Obsoletes: MySQL-shared-compat-advanced < %{version}-%{release}
Obsoletes: mysql-community-libs-compat < %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
%else
Provides: MySQL-shared-compat%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
+Requires: mysql-community-libs%{?_isa} >= %{min}
%endif
Obsoletes: MySQL-shared-compat < %{version}-%{release}
%if 0%{?rhel} > 5
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-embedded-devel < %{version}-%{release}
-Requires: mysql-commercial-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-commercial-embedded%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-devel%{?_isa} >= %{min}
+Requires: mysql-commercial-embedded%{?_isa} >= %{min}
%else
-Requires: mysql-community-devel%{?_isa} = %{version}-%{release}
-Requires: mysql-community-embedded%{?_isa} = %{version}-%{release}
+Requires: mysql-community-devel%{?_isa} >= %{min}
+Requires: mysql-community-embedded%{?_isa} >= %{min}
%endif
Obsoletes: mariadb-embedded-devel
Obsoletes: mysql-embedded-devel < %{version}-%{release}
Summary: Convenience package for easy upgrades of MySQL package set
Group: Applications/Databases
%if 0%{?commercial}
-Requires: mysql-commercial-client%{?_isa} = %{version}-%{release}
-Requires: mysql-commercial-libs%{?_isa} = %{version}-%{release}
-Requires: mysql-commercial-libs-compat%{?_isa} = %{version}-%{release}
+Requires: mysql-commercial-client%{?_isa} >= %{min}
+Requires: mysql-commercial-libs%{?_isa} >= %{min}
+Requires: mysql-commercial-libs-compat%{?_isa} >= %{min}
%else
-Requires: mysql-community-client%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs%{?_isa} = %{version}-%{release}
-Requires: mysql-community-libs-compat%{?_isa} = %{version}-%{release}
+Requires: mysql-community-client%{?_isa} >= %{min}
+Requires: mysql-community-libs%{?_isa} >= %{min}
+Requires: mysql-community-libs-compat%{?_isa} >= %{min}
%endif
%description -n mysql
%endif # 0%{?compatlib}
pushd %{src_dir}
%patch0 -p1
-%{?el7:%patch1 -p1}
%build
# Fail quickly and obviously if user tries to build as root
-DINSTALL_SQLBENCHDIR=share \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
+ %{?el7:-DWITH_SYMVER16=1} \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \
-DINSTALL_SQLBENCHDIR=share \
-DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \
-DFEATURE_SET="%{feature_set}" \
+ %{?el7:-DWITH_SYMVER16=1} \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_EMBEDDED_SHARED_LIBRARY=1 \
%{?ssl_option} \
install -d -m 0755 %{buildroot}%{_datadir}/mysql/SELinux/RHEL4
install -d -m 0755 %{buildroot}/var/lib/mysql
install -d -m 0755 %{buildroot}/var/run/mysqld
+install -d -m 0750 %{buildroot}/var/lib/mysql-files
# Install all binaries
cd $MBD/release
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir" >/dev/null 2>&1 || :
/bin/touch /var/log/mysqld.log >/dev/null 2>&1 || :
+/bin/chown mysql:mysql /var/log/mysqld.log >/dev/null 2>&1 || :
%if 0%{?systemd}
%systemd_post mysqld.service
/usr/bin/systemctl enable mysqld >/dev/null 2>&1 || :
%dir %{_libdir}/mysql/plugin
%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/connection_control.so
%attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so
%attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so
%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
%dir %{_libdir}/mysql/plugin/debug
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/connection_control.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
%dir %attr(755, mysql, mysql) /var/lib/mysql
%dir %attr(755, mysql, mysql) /var/run/mysqld
+%dir %attr(750, mysql, mysql) /var/lib/mysql-files
%files common
%defattr(-, root, root, -)
%attr(755, root, root) %{_bindir}/mysqlimport
%attr(755, root, root) %{_bindir}/mysqlshow
%attr(755, root, root) %{_bindir}/mysqlslap
-%attr(755, root, root) %{_bindir}/mysql_config
-%attr(755, root, root) %{_bindir}/mysql_config-%{__isa_bits}
%attr(755, root, root) %{_bindir}/mysql_config_editor
%attr(644, root, root) %{_mandir}/man1/msql2mysql.1*
%endif
%changelog
+* Mon Oct 31 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.35-1
+- Add connection_control.so to server subpackage
+
+* Mon Sep 26 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.34-1
+- Include mysql-files directory
+
+* Tue Jul 05 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.32-1
+- Remove mysql_config from client subpackage
+
+* Mon Mar 14 2016 Georgi Kodinov <georgi.kodinov@oracle.com> - 5.6.31-1
+- Add test_udf_services.so plugin
+
* Tue Sep 29 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.28-1
- Added conflicts to mysql-connector-c-shared dependencies
#
# This command respects setarch, works on OL6/RHEL6 and later
-isa_bits=$(rpm --eval %__isa_bits)
+bits=$(rpm --eval %__isa_bits)
case $bits in
- 32|64) bits=$isa_bits ;;
+ 32|64) ;;
*) bits=unknown ;;
esac
if [ "$bits" = "unknown" ] ; then
arch=$(uname -m)
case $arch in
- x86_64|ppc64) bits=64 ;;
- i386|i486|i586|i686|pentium3|pentium4|athlon|ppc) bits=32 ;;
+ x86_64|ppc64|ppc64le|aarch64|s390x|sparc64) bits=64 ;;
+ i386|i486|i586|i686|pentium3|pentium4|athlon|ppc|s390|sparc) bits=32 ;;
*) bits=unknown ;;
esac
fi
echo "$0: error: needed binary: /usr/bin/mysql_config-$bits is missing. Please check your MySQL installation."
exit 1
fi
-
ExecStartPre=/usr/bin/mysql-systemd-start pre
# Start main service
-ExecStart=/usr/bin/mysqld_safe
+ExecStart=/usr/bin/mysqld_safe --basedir=/usr
# Don't signal startup success before a ping works
ExecStartPost=/usr/bin/mysql-systemd-start post
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
# Restore log, dir, perms and SELinux contexts
- [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
+ if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
+ install -d -m 0755 -omysql -gmysql "$datadir" || exit 1
+ fi
log=/var/log/mysql/mysqld.log
[ -e $log ] || touch $log
chmod 0640 $log
datadir=$(get_option mysqld datadir "/var/lib/mysql")
socket=$(get_option mysqld socket "$datadir/mysql.sock")
pidfile=$(get_option mysqld_safe pid-file "/var/run/mysql/mysqld.pid")
-logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log")
install_db () {
# Note: something different than datadir=/var/lib/mysql requires
logfile=$(get_option mysqld_safe log-error "/var/log/mysql/mysqld.log")
# Restore log, dir, perms and SELinux contexts
- [ -d "$datadir" ] || install -d -m 0755 -omysql -gmysql "$datadir" || return 1
+ if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then
+ install -d -m 0755 -omysql -gmysql "$datadir" || return 1
+ fi
- [ -e $logfile ] || touch $logfile || return 1
- chmod 0640 $logfile
- chown mysql:mysql $logfile || return 1
+ if [ ! -e "$logfile" -a ! -h "$logfile" -a "x$(dirname "$logfile")" = "x/var/log/mysql" ]; then
+ install /dev/null -omysql -gmysql "$logfile" || return 1
+ fi
if [ -x /usr/sbin/restorecon ]; then
/usr/sbin/restorecon "$datadir"
- /usr/sbin/restorecon $logfile
+ /usr/sbin/restorecon "$logfile"
fi
# If special mysql dir is in place, skip db install
rc_failed 6 ; rc_status -v ; rc_exit
fi
- $PROG --basedir=/usr --datadir="$datadir" --pid-file="$pidfile" >/dev/null 2>&1 &
+ $PROG --basedir=/usr --datadir="$datadir" --pid-file="$pidfile" >/dev/null &
if pinger $! ; then
echo -n "Starting service MySQL:"
touch $lockfile
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
%{?sles12: %global systemd 1}
%{!?_tmpfilesdir: %global _tmpfilesdir /usr/lib/tmpfiles.d}
+%global min 5.6.10
+
Name: mysql-%{product_suffix}
Summary: A very fast and reliable SQL database server
Group: Applications/Databases
Provides: MySQL-server-advanced = %{version}-%{release}
Obsoletes: MySQL-server-advanced < %{version}-%{release}
Obsoletes: mysql-community-server < %{version}-%{release}
-Requires: mysql-commercial-client = %{version}-%{release}
-Requires: mysql-commercial-common = %{version}-%{release}
+Requires: mysql-commercial-client >= %{min}
+Requires: mysql-commercial-common >= %{min}
%else
Provides: MySQL-server = %{version}-%{release}
-Requires: mysql-community-client = %{version}-%{release}
-Requires: mysql-community-common = %{version}-%{release}
+Requires: mysql-community-client >= %{min}
+Requires: mysql-community-common >= %{min}
%endif
Obsoletes: MySQL-server < %{version}-%{release}
Obsoletes: mysql < %{version}-%{release}
Provides: MySQL-client-advanced = %{version}-%{release}
Obsoletes: MySQL-client-advanced < %{version}-%{release}
Obsoletes: mysql-community-client < %{version}-%{release}
-Requires: mysql-commercial-libs = %{version}-%{release}
+Requires: mysql-commercial-libs >= %{min}
%else
Provides: MySQL-client = %{version}-%{release}
-Requires: mysql-community-libs = %{version}-%{release}
+Requires: mysql-community-libs >= %{min}
%endif
Obsoletes: MySQL-client < %{version}-%{release}
Provides: mysql-client = %{version}-%{release}
Provides: MySQL-test-advanced = %{version}-%{release}
Obsoletes: MySQL-test-advanced < %{version}-%{release}
Obsoletes: mysql-community-test < %{version}-%{release}
-Requires: mysql-commercial-server = %{version}-%{release}
+Requires: mysql-commercial-server >= %{min}
%else
Provides: MySQL-test = %{version}-%{release}
-Requires: mysql-community-server = %{version}-%{release}
+Requires: mysql-community-server >= %{min}
%endif
Obsoletes: MySQL-test < %{version}-%{release}
Obsoletes: mysql-test < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-bench < %{version}-%{release}
-Requires: mysql-commercial-server = %{version}-%{release}
+Requires: mysql-commercial-server >= %{min}
%else
-Requires: mysql-community-server = %{version}-%{release}
+Requires: mysql-community-server >= %{min}
%endif
Obsoletes: mariadb-bench
Obsoletes: community-mysql-bench < %{version}-%{release}
Provides: MySQL-devel-advanced = %{version}-%{release}
Obsoletes: MySQL-devel-advanced < %{version}-%{release}
Obsoletes: mysql-community-devel < %{version}-%{release}
-Requires: mysql-commercial-libs = %{version}-%{release}
+Requires: mysql-commercial-libs >= %{min}
%else
Provides: MySQL-devel = %{version}-%{release}
-Requires: mysql-community-libs = %{version}-%{release}
+Requires: mysql-community-libs >= %{min}
%endif
Obsoletes: MySQL-devel < %{version}-%{release}
Obsoletes: mysql-devel < %{version}-%{release}
Provides: MySQL-shared-advanced = %{version}-%{release}
Obsoletes: MySQL-shared-advanced < %{version}-%{release}
Obsoletes: mysql-community-libs < %{version}-%{release}
-Requires: mysql-commercial-common = %{version}-%{release}
+Requires: mysql-commercial-common >= %{min}
%else
Provides: MySQL-shared = %{version}-%{release}
-Requires: mysql-community-common = %{version}-%{release}
+Requires: mysql-community-common >= %{min}
%endif
Obsoletes: MySQL-shared < %{version}-%{release}
Obsoletes: mysql-libs < %{version}-%{release}
Provides: MySQL-embedded-advanced = %{version}-%{release}
Obsoletes: MySQL-embedded-advanced < %{version}-%{release}
Obsoletes: mysql-community-embedded < %{version}-%{release}
-Requires: mysql-commercial-common = %{version}-%{release}
+Requires: mysql-commercial-common >= %{min}
%else
Provides: MySQL-embedded = %{version}-%{release}
-Requires: mysql-community-common = %{version}-%{release}
+Requires: mysql-community-common >= %{min}
%endif
Obsoletes: mariadb-embedded
Obsoletes: MySQL-embedded < %{version}-%{release}
Group: Applications/Databases
%if 0%{?commercial}
Obsoletes: mysql-community-embedded-devel < %{version}-%{release}
-Requires: mysql-commercial-devel = %{version}-%{release}
-Requires: mysql-commercial-embedded = %{version}-%{release}
+Requires: mysql-commercial-devel >= %{min}
+Requires: mysql-commercial-embedded >= %{min}
%else
-Requires: mysql-community-devel = %{version}-%{release}
-Requires: mysql-community-embedded = %{version}-%{release}
+Requires: mysql-community-devel >= %{min}
+Requires: mysql-community-embedded >= %{min}
%endif
Obsoletes: mariadb-embedded-devel
Obsoletes: mysql-embedded-devel < %{version}-%{release}
install -d -m 0755 %{buildroot}/var/lib/mysql
install -d -m 0755 %{buildroot}/var/run/mysql
install -d -m 0750 %{buildroot}/var/log/mysql
+install -d -m 0750 %{buildroot}/var/lib/mysql-files
# Install all binaries
cd $MBD/release
datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n 's/--datadir=//p' | tail -n 1)
/bin/chmod 0755 "$datadir"
/bin/touch /var/log/mysql/mysqld.log
+/bin/chown mysql:mysql /var/log/mysql/mysqld.log >/dev/null 2>&1 || :
%if 0%{?systemd}
%service_add_post mysql.service
/usr/bin/systemd-tmpfiles --create %{_tmpfilesdir}/mysql.conf >/dev/null 2>&1 || :
%dir %{_libdir}/mysql/plugin
%attr(755, root, root) %{_libdir}/mysql/plugin/adt_null.so
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/connection_control.so
%attr(755, root, root) %{_libdir}/mysql/plugin/innodb_engine.so
%attr(755, root, root) %{_libdir}/mysql/plugin/libmemcached.so
%attr(755, root, root) %{_libdir}/mysql/plugin/mypluglib.so
%dir %{_libdir}/mysql/plugin/debug
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/adt_null.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_socket.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/connection_control.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/innodb_engine.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libmemcached.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/mypluglib.so
%dir %attr(755, mysql, mysql) /var/lib/mysql
%dir %attr(755, mysql, mysql) /var/run/mysql
%dir %attr(750, mysql, mysql) /var/log/mysql
+%dir %attr(750, mysql, mysql) /var/lib/mysql-files
%files common
%defattr(-, root, root, -)
%attr(755, root, root) %{_bindir}/mysqlimport
%attr(755, root, root) %{_bindir}/mysqlshow
%attr(755, root, root) %{_bindir}/mysqlslap
-%attr(755, root, root) %{_bindir}/mysql_config
%attr(755, root, root) %{_bindir}/mysql_config_editor
%attr(644, root, root) %{_mandir}/man1/msql2mysql.1*
%attr(755, root, root) %{_libdir}/mysql/plugin/auth_test_plugin.so
%attr(644, root, root) %{_libdir}/mysql/plugin/daemon_example.ini
%attr(755, root, root) %{_libdir}/mysql/plugin/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/auth_test_plugin.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/libdaemon_example.so
+%attr(755, root, root) %{_libdir}/mysql/plugin/debug/test_udf_services.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_client.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_interface.so
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/qa_auth_server.so
%attr(755, root, root) %{_libdir}/mysql/libmysqld.so
%changelog
+* Mon Oct 31 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.35-1
+- Add connection_control.so to server subpackage
+
+* Mon Sep 26 2016 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.34-1
+- Include mysql-files directory
+
+* Mon Mar 14 2016 Georgi Kodinov <georgi.kodinov@oracle.com> - 5.6.31-1
+- Add test_udf_services.so plugin
+
* Tue Sep 29 2015 Balasubramanian Kandasamy <balasubramanian.kandasamy@oracle.com> - 5.6.28-1
- Added conflicts to mysql-connector-c-shared dependencies
ExecStartPre=/usr/bin/mysql-systemd-start pre
# Start main service
-ExecStart=/usr/bin/mysqld_safe
+ExecStart=/usr/bin/mysqld_safe --basedir=/usr
# Don't signal startup success before a ping works
ExecStartPost=/usr/bin/mysql-systemd-start post
#!/bin/sh
#
-# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
myuser=mysql
mydatadir=/var/lib/mysql
basedir=@@basedir@@
+mysecurefiledir=/var/lib/mysql-files
if [ -n "$BASEDIR" ] ; then
basedir="$BASEDIR"
chown -R $myuser:$mygroup $mydatadir
+# Create securefile directory
+[ -d "$mysecurefiledir" ] || mkdir -p -m 770 "$mysecurefiledir" || exit 1
+chown -R $myuser:$mygroup $mysecurefiledir
+
# Solaris patch 119255 (somewhere around revision 42) changes the behaviour
# of pkgadd to set TMPDIR internally to a root-owned install directory. This
# has the unfortunate side effect of breaking running mysql_install_db with
-/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include <mysql/plugin.h>
#include <mysql/plugin_audit.h>
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#define __attribute__(A)
-#endif
+#include "my_attribute.h"
static volatile int number_of_calls; /* for SHOW STATUS, see below */
/* Count MYSQL_AUDIT_GENERAL_CLASS event instances */
1 failure (cannot happen)
*/
-static int audit_null_plugin_init(void *arg __attribute__((unused)))
+static int audit_null_plugin_init(void *arg MY_ATTRIBUTE((unused)))
{
number_of_calls= 0;
number_of_calls_general_log= 0;
*/
-static int audit_null_plugin_deinit(void *arg __attribute__((unused)))
+static int audit_null_plugin_deinit(void *arg MY_ATTRIBUTE((unused)))
{
return(0);
}
DESCRIPTION
*/
-static void audit_null_notify(MYSQL_THD thd __attribute__((unused)),
+static void audit_null_notify(MYSQL_THD thd MY_ATTRIBUTE((unused)),
unsigned int event_class,
const void *event)
{
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
static mysql_authentication_dialog_ask_t ask;
-static char *builtin_ask(MYSQL *mysql __attribute__((unused)),
- int type __attribute__((unused)),
+static char *builtin_ask(MYSQL *mysql MY_ATTRIBUTE((unused)),
+ int type MY_ATTRIBUTE((unused)),
const char *prompt,
char *buf, int buf_len)
{
or fall back to the default implementation.
*/
-static int init_dialog(char *unused1 __attribute__((unused)),
- size_t unused2 __attribute__((unused)),
- int unused3 __attribute__((unused)),
- va_list unused4 __attribute__((unused)))
+static int init_dialog(char *unused1 MY_ATTRIBUTE((unused)),
+ size_t unused2 MY_ATTRIBUTE((unused)),
+ int unused3 MY_ATTRIBUTE((unused)),
+ va_list unused4 MY_ATTRIBUTE((unused)))
{
void *sym= dlsym(RTLD_DEFAULT, "mysql_authentication_dialog_ask");
ask= sym ? (mysql_authentication_dialog_ask_t) sym : builtin_ask;
-/* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2014, 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
#include <stdlib.h>
static int mysql_no_login(
- MYSQL_PLUGIN_VIO *vio __attribute__((unused)),
- MYSQL_SERVER_AUTH_INFO *info __attribute__((unused)))
+ MYSQL_PLUGIN_VIO *vio MY_ATTRIBUTE((unused)),
+ MYSQL_SERVER_AUTH_INFO *info MY_ATTRIBUTE((unused)))
{
return CR_ERROR;
}
--- /dev/null
+# 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
+
+MYSQL_ADD_PLUGIN(connection_control
+ connection_control_coordinator.cc
+ connection_control.cc
+ security_context_wrapper.cc
+ connection_delay.cc
+ MODULE_ONLY)
+
--- /dev/null
+/* 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 */
+
+#include <mysql/plugin_audit.h> /* mysql_event_connection */
+#include "mysql_version.h"
+#include <my_global.h>
+#include <my_pthread.h>
+#include <my_atomic.h>
+
+#include "connection_control.h"
+#include "connection_delay_api.h" /* connection_delay apis */
+#include "connection_control_coordinator.h" /* g_connection_event_coordinator */
+
+namespace connection_control
+{
+ class Connection_control_error_handler : public Error_handler
+ {
+ public:
+ Connection_control_error_handler(MYSQL_PLUGIN plugin_info)
+ : m_plugin_info(plugin_info)
+ {}
+
+ void handle_error(const char * error_message)
+ {
+ my_plugin_log_message(&m_plugin_info,
+ MY_ERROR_LEVEL,
+ error_message);
+ }
+ private:
+ MYSQL_PLUGIN m_plugin_info;
+ };
+}
+
+using connection_control::Connection_event_coordinator;
+using connection_control::Connection_event_coordinator_services;
+using connection_control::Connection_control_statistics;
+using connection_control::Connection_control_variables;
+using connection_control::Error_handler;
+using connection_control::Connection_control_error_handler;
+
+typedef unsigned int mysql_event_class_t;
+
+Connection_control_statistics g_statistics;
+Connection_control_variables g_variables;
+
+Connection_event_coordinator *g_connection_event_coordinator= 0;
+MYSQL_PLUGIN connection_control_plugin_info= 0;
+
+
+/**
+ event_notify() implementation for connection_control
+
+ For connection event, notify Connection_event_coordinator
+ which in turn will notify subscribers.
+
+ @param thd [in] Handle to THD
+ @param event_class [in] Event class.
+ We are interested in MYSQL_AUDIT_CONNECTION_CLASS.
+ @param event [in] mysql_event_connection handle
+*/
+
+static void
+connection_control_notify(MYSQL_THD thd,
+ mysql_event_class_t event_class,
+ const void *event)
+{
+ DBUG_ENTER("connection_control_notify");
+ try
+ {
+ if (event_class == MYSQL_AUDIT_CONNECTION_CLASS)
+ {
+ const struct mysql_event_connection *connection_event=
+ (const struct mysql_event_connection *) event;
+ Connection_control_error_handler error_handler(connection_control_plugin_info);
+ /** Notify event coordinator */
+ g_connection_event_coordinator->notify_event(thd, &error_handler,
+ connection_event);
+ }
+ }
+ catch (...)
+ {
+ /* Happily ignore any bad behavior */
+ }
+
+ DBUG_VOID_RETURN;
+}
+
+
+/**
+ Plugin initialization function
+
+ @param plugin_info [in] MYSQL_PLUGIN information
+
+ @returns initialization status
+ @retval 0 Success
+ @retval 1 Failure
+*/
+
+static int
+connection_control_init(MYSQL_PLUGIN plugin_info)
+{
+ connection_control_plugin_info= plugin_info;
+ Connection_control_error_handler error_handler(connection_control_plugin_info);
+ g_connection_event_coordinator= new Connection_event_coordinator();
+ if (!g_connection_event_coordinator)
+ {
+ error_handler.handle_error("Failed to initialize Connection_event_coordinator");
+ return 1;
+ }
+
+ if (init_connection_delay_event((Connection_event_coordinator_services *)
+ g_connection_event_coordinator,
+ &error_handler))
+ {
+ delete g_connection_event_coordinator;
+ return 1;
+ }
+ return 0;
+}
+
+
+/**
+ Plugin deinitialization
+
+ @param arg Unused
+
+ @returns success
+*/
+
+static int
+connection_control_deinit(void *arg MY_ATTRIBUTE((unused)))
+{
+ delete g_connection_event_coordinator;
+ g_connection_event_coordinator= 0;
+ connection_control::deinit_connection_delay_event();
+ connection_control_plugin_info= 0;
+ return 0;
+}
+
+
+/** Connection_control plugin descriptor */
+static struct st_mysql_audit connection_control_descriptor=
+{
+ MYSQL_AUDIT_INTERFACE_VERSION, /* interface version */\r
+ NULL, /* release_thd() */\r
+ connection_control_notify, /* event_notify() */\r
+ {(ulong)MYSQL_AUDIT_CONNECTION_CLASSMASK} /* class mask */
+};
+
+
+/**
+ check() function for connection_control_failed_connections_threshold
+
+ Check whether new value is within valid bounds or not.
+
+ @param thd Not used.
+ @param var Not used.
+ @param save Not used.
+ @param value New value for the option.
+
+ @returns whether new value is within valid bounds or not.
+ @retval 0 Value is ok
+ @retval 1 Value is not within valid bounds
+*/
+
+static int
+check_failed_connections_threshold(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
+ void *save MY_ATTRIBUTE((unused)),
+ struct st_mysql_value *value)
+{
+ longlong new_value;
+ if (value->val_int(value, &new_value))
+ return 1; /* NULL value */
+
+ if (new_value >= connection_control::MIN_THRESHOLD &&
+ new_value <= connection_control::MAX_THRESHOLD)
+ {
+ *(reinterpret_cast<longlong *>(save))= new_value;
+ return 0;
+ }
+
+ return 1;
+}
+
+
+/**
+ update() function for connection_control_failed_connections_threshold
+
+ Updates g_connection_event_coordinator with new value.
+ Also notifies observers about the update.
+
+ @param thd Not used.
+ @param var Not used.
+ @param var_ptr Variable information
+ @param save New value for connection_control_failed_connections_threshold
+*/
+
+static void
+update_failed_connections_threshold(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
+ void *var_ptr, const void *save)
+{
+ /*
+ This won't result in overflow because we have already checked that this is
+ within valid bounds.
+ */
+ longlong new_value= *(reinterpret_cast<const longlong *>(save));
+ g_variables.failed_connections_threshold= (int64)new_value;
+ Connection_control_error_handler error_handler(connection_control_plugin_info);
+ g_connection_event_coordinator->notify_sys_var(&error_handler,
+ OPT_FAILED_CONNECTIONS_THRESHOLD,
+ &new_value);
+ return;
+}
+
+
+/** Declaration of connection_control_failed_connections_threshold */
+static MYSQL_SYSVAR_LONGLONG(
+ failed_connections_threshold,
+ g_variables.failed_connections_threshold,
+ PLUGIN_VAR_RQCMDARG,
+ "Failed connection threshold to trigger delay. Default is 3.",
+ check_failed_connections_threshold,
+ update_failed_connections_threshold,
+ connection_control::DEFAULT_THRESHOLD,
+ connection_control::MIN_THRESHOLD,
+ connection_control::MAX_THRESHOLD,
+ 1
+);
+
+
+/**
+ check() function for connection_control_min_connection_delay
+
+ Check whether new value is within valid bounds or not.
+
+ @param thd Not used.
+ @param var Not used.
+ @param save Not used.
+ @param value New value for the option.
+
+ @returns whether new value is within valid bounds or not.
+ @retval 0 Value is ok
+ @retval 1 Value is not within valid bounds
+*/
+
+static int
+check_min_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
+ void *save MY_ATTRIBUTE((unused)),
+ struct st_mysql_value *value)
+{
+ long long new_value;
+ int64 existing_value= g_variables.max_connection_delay;
+ if (value->val_int(value, &new_value))
+ return 1; /* NULL value */
+
+ if (new_value >= connection_control::MIN_DELAY &&
+ new_value <= connection_control::MAX_DELAY &&
+ new_value <= existing_value)
+ {
+ *(reinterpret_cast<longlong *>(save))= new_value;
+ return 0;
+ }
+ return 1;
+}
+
+
+/**
+ update() function for connection_control_min_connection_delay
+
+ Updates g_connection_event_coordinator with new value.
+ Also notifies observers about the update.
+
+ @param thd Not used.
+ @param var Not used.
+ @param var_ptr Variable information
+ @param save New value for connection_control_min_connection_delay
+*/
+
+static void
+update_min_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
+ void *var_ptr, const void *save)
+{
+ longlong new_value= *(reinterpret_cast<const longlong *>(save));
+ g_variables.min_connection_delay= (int64)new_value;
+ Connection_control_error_handler error_handler(connection_control_plugin_info);
+ g_connection_event_coordinator->notify_sys_var(&error_handler,
+ OPT_MIN_CONNECTION_DELAY,
+ &new_value);
+ return;
+}
+
+
+/** Declaration of connection_control_max_connection_delay */
+static MYSQL_SYSVAR_LONGLONG(
+ min_connection_delay,
+ g_variables.min_connection_delay,
+ PLUGIN_VAR_RQCMDARG,
+ "Maximum delay to be introduced. Default is 1000.",
+ check_min_connection_delay,
+ update_min_connection_delay,
+ connection_control::DEFAULT_MIN_DELAY,
+ connection_control::MIN_DELAY,
+ connection_control::MAX_DELAY,
+ 1
+);
+
+
+/**
+ check() function for connection_control_max_connection_delay
+
+ Check whether new value is within valid bounds or not.
+
+ @param thd Not used.
+ @param var Not used.
+ @param save Not used.
+ @param value New value for the option.
+
+ @returns whether new value is within valid bounds or not.
+ @retval 0 Value is ok
+ @retval 1 Value is not within valid bounds
+*/
+
+static int
+check_max_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
+ void *save MY_ATTRIBUTE((unused)),
+ struct st_mysql_value *value)
+{
+ long long new_value;
+ int64 existing_value= my_atomic_load64(&g_variables.min_connection_delay);
+ if (value->val_int(value, &new_value))
+ return 1; /* NULL value */
+
+ if (new_value >= connection_control::MIN_DELAY &&
+ new_value <= connection_control::MAX_DELAY &&
+ new_value >= existing_value)
+ {
+ *(reinterpret_cast<longlong *>(save))= new_value;
+ return 0;
+ }
+ return 1;
+}
+
+
+/**
+ update() function for connection_control_max_connection_delay
+
+ Updates g_connection_event_coordinator with new value.
+ Also notifies observers about the update.
+
+ @param thd Not used.
+ @param var Not used.
+ @param var_ptr Variable information
+ @param save New value for connection_control_max_connection_delay
+*/
+
+static void
+update_max_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
+ void *var_ptr, const void *save)
+{
+ longlong new_value= *(reinterpret_cast<const longlong *>(save));
+ my_atomic_store64(&g_variables.max_connection_delay, (int64)new_value);
+ Connection_control_error_handler error_handler(connection_control_plugin_info);
+ g_connection_event_coordinator->notify_sys_var(&error_handler,
+ OPT_MAX_CONNECTION_DELAY,
+ &new_value);
+ return;
+}
+
+
+/** Declaration of connection_control_max_connection_delay */
+static MYSQL_SYSVAR_LONGLONG(
+ max_connection_delay,
+ g_variables.max_connection_delay,
+ PLUGIN_VAR_RQCMDARG,
+ "Maximum delay to be introduced. Default is 2147483647.",
+ check_max_connection_delay,
+ update_max_connection_delay,
+ connection_control::DEFAULT_MAX_DELAY,
+ connection_control::MIN_DELAY,
+ connection_control::MAX_DELAY,
+ 1
+);
+
+
+/** Array of system variables. Used in plugin declaration. */
+struct st_mysql_sys_var *
+connection_control_system_variables[OPT_LAST + 1]=
+{
+ MYSQL_SYSVAR(failed_connections_threshold),
+ MYSQL_SYSVAR(min_connection_delay),
+ MYSQL_SYSVAR(max_connection_delay),
+ NULL
+};
+
+
+/**
+ Function to display value for status variable : Connection_control_delay_generated
+
+ @param thd MYSQL_THD handle. Unused.
+ @param var Status variable structure
+ @param buff Value buffer.
+
+ @returns Always returns success.
+*/
+
+static int show_delay_generated(MYSQL_THD,
+ struct st_mysql_show_var *var,
+ char *buff)
+{
+ var->type= SHOW_LONGLONG;
+ var->value= buff;
+ longlong *value= reinterpret_cast<longlong *>(buff);
+ int64 current_val= my_atomic_load64(&g_statistics.stats_array[STAT_CONNECTION_DELAY_TRIGGERED]);
+ *value= static_cast<longlong>(current_val);
+ return 0;
+}
+
+
+/** Array of status variables. Used in plugin declaration. */
+struct st_mysql_show_var
+connection_control_status_variables[STAT_LAST + 1]={
+ {
+ "Connection_control_delay_generated",
+ (char *)&show_delay_generated,
+ SHOW_FUNC
+ },
+ {0, 0, enum_mysql_show_type(0)}
+};
+
+
+mysql_declare_plugin(audit_log)
+{
+ MYSQL_AUDIT_PLUGIN, /* plugin type */
+ &connection_control_descriptor, /* type specific descriptor */
+ "CONNECTION_CONTROL", /* plugin name */
+ "Oracle Inc", /* author */
+ "Connection event processing", /* description */
+ PLUGIN_LICENSE_GPL , /* license */
+ connection_control_init, /* plugin initializer */
+ connection_control_deinit, /* plugin deinitializer */
+ 0x0100, /* version */
+ connection_control_status_variables, /* status variables */
+ connection_control_system_variables, /* system variables */
+ NULL, /* reserverd */
+ 0 /* flags */
+},
+{
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
+ &connection_control_failed_attempts_view,
+ "CONNECTION_CONTROL_FAILED_LOGIN_ATTEMPTS",
+ "Oracle Inc",
+ "I_S table providing a view into failed attempts statistics",
+ PLUGIN_LICENSE_GPL,
+ connection_control_failed_attempts_view_init,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ NULL,
+ 0
+}
+mysql_declare_plugin_end;
--- /dev/null
+/* 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 */
+
+#ifndef CONNECTION_CONTROL_H
+#define CONNECTION_CONTROL_H
+
+#include <mysql/psi/mysql_thread.h> /* mysql_rwlock_t */
+
+#include "connection_control_data.h"
+
+namespace connection_control
+{
+
+ /** Helper class : Wrapper on READ lock */
+
+ class RD_lock
+ {
+ public:
+ explicit RD_lock(mysql_rwlock_t *lock) : m_lock(lock)
+ {
+ if (m_lock)
+ mysql_rwlock_rdlock(m_lock);
+ }
+ ~RD_lock()
+ {
+ if (m_lock)
+ mysql_rwlock_unlock(m_lock);
+ }
+ void lock()
+ {
+ mysql_rwlock_rdlock(m_lock);
+ }
+ void unlock()
+ {
+ mysql_rwlock_unlock(m_lock);
+ }
+ private:
+ mysql_rwlock_t *m_lock;
+
+ RD_lock(const RD_lock&); /* Not copyable. */
+ void operator=(const RD_lock&); /* Not assignable. */
+ };
+
+
+ /** Helper class : Wrapper on write lock */
+
+ class WR_lock
+ {
+ public:
+ explicit WR_lock(mysql_rwlock_t *lock) : m_lock(lock)
+ {
+ if (m_lock)
+ mysql_rwlock_wrlock(m_lock);
+ }
+ ~WR_lock()
+ {
+ if (m_lock)
+ mysql_rwlock_unlock(m_lock);
+ }
+ void lock()
+ {
+ mysql_rwlock_wrlock(m_lock);
+ }
+ void unlock()
+ {
+ mysql_rwlock_unlock(m_lock);
+ }
+ private:
+ mysql_rwlock_t *m_lock;
+
+ WR_lock(const WR_lock&); /* Not copyable. */
+ void operator=(const WR_lock&); /* Not assignable. */
+ };
+}
+#endif /* !CONNECTION_CONTROL_H */
--- /dev/null
+/* 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 */
+
+#include <my_global.h>
+#include <my_pthread.h>
+#include <my_atomic.h>
+
+#include "connection_control_coordinator.h"
+#include "connection_control.h"
+
+namespace connection_control
+{
+ /**
+ Reset Connection_event_coordinator information
+ */
+
+ void
+ Connection_event_coordinator::reset()
+ {
+ m_subscribers.clear();
+ for (uint i= (uint)STAT_CONNECTION_DELAY_TRIGGERED;
+ i < (uint)STAT_LAST; ++i)
+ m_status_vars_subscription[i]= 0;
+ }
+
+
+ /**
+ Register an event subscriber.
+
+ A subscriber can provide following preferences:
+ 1. Set of events for which subscriber is interested
+ 2. Set of variables for which subscriber would like to receive update
+ 3. Set of stats for which subscriber would like to send update
+
+ @param subscriber [in] Handle to Connection_event_observers
+ @param events [in] Event mask supplied by subscriber
+ @param sys_vars [in] opt_connection_control vector
+ @param status_vars [in] stats_connection_control vector
+
+ @returns subscription status
+ @retval false Subscription successful
+ @retval true Failure in subscription for given combination of prefernece.
+ Most probably, other subscriber has already subscribed for
+ status var update.
+ */
+
+ bool
+ Connection_event_coordinator::register_event_subscriber(
+ Connection_event_observer **subscriber,
+ std::vector<opt_connection_control> *sys_vars,
+ std::vector<stats_connection_control> *status_vars)
+ {
+ DBUG_ENTER("Connection_event_coordinator::register_event_subscriber");
+ bool error= false;
+ std::vector<opt_connection_control>::iterator sys_vars_it;
+ std::vector<stats_connection_control>::iterator status_vars_it;
+
+ DBUG_ASSERT(subscriber != 0);
+
+ if (status_vars)
+ {
+ for (status_vars_it= status_vars->begin();
+ status_vars_it != status_vars->end();
+ ++status_vars_it)
+ {
+ if (*status_vars_it >= STAT_LAST ||
+ m_status_vars_subscription[*status_vars_it] != 0)
+ {
+ /*
+ Either an invalid status variable is specified or
+ someone has already subscribed for status variable
+ */
+ error= true;
+ break;
+ }
+ }
+ }
+
+ if (!error && sys_vars)
+ {
+ for (sys_vars_it= sys_vars->begin();
+ sys_vars_it != sys_vars->end();
+ ++sys_vars_it)
+ {
+ if (*sys_vars_it >= OPT_LAST)
+ error= true;
+ break;
+ }
+ }
+
+ if (!error)
+ {
+ /*
+ Create Connection_event_subscriber object and
+ initialize it with required details.
+ */
+ Connection_event_subscriber subscriber_info;
+ subscriber_info.m_subscriber= *subscriber;
+
+ /* Reset the list first */
+ for (uint i= (uint)OPT_FAILED_CONNECTIONS_THRESHOLD;
+ i < (uint)OPT_LAST;
+ ++i)
+ subscriber_info.m_sys_vars[i]= false;
+
+ /* Now set the bits which are requested by subscriber */
+ for (sys_vars_it= sys_vars->begin();
+ sys_vars_it != sys_vars->end();
+ ++sys_vars_it)
+ subscriber_info.m_sys_vars[*sys_vars_it]= true;
+
+ /* Insert new entry in m_subscribers */
+ try
+ {
+ m_subscribers.push_back(subscriber_info);
+ }
+ catch (...)
+ {
+ /* Something went wrong. Mostly likely OOM. */
+ error= true;
+ }
+
+ /*
+ Update m_status_vars_subscription only if subscriber information
+ has been inserted in m_subscribers successfully.
+ */
+ if (!error)
+ {
+ for (status_vars_it= status_vars->begin();
+ status_vars_it != status_vars->end();
+ ++status_vars_it)
+ m_status_vars_subscription[*status_vars_it]= *subscriber;
+ }
+ }
+ DBUG_RETURN(error);
+ }
+
+
+ /**
+ Handle connection event.
+ When a notification from server is received, perform following:
+ 1. Iterate through list of subscribers
+ - If a subscriber has shown interest in received event,
+ call notify() for the subscriber
+ 2. Interate through list of status variables
+ - If subscriber has show interest in any status variable,
+ call notify_status_var() for the subscriber
+ - If subscriber suggests an action on status variable,
+ perform the action
+
+ Note : If we receive error from a subscriber, we log it and move on.
+
+ @param thd [in] THD handle
+ @param error_handler [in] Error handler class
+ @param connection_event [in] Event information
+ */
+
+ void
+ Connection_event_coordinator::notify_event(
+ MYSQL_THD thd,
+ Error_handler *error_handler,
+ const mysql_event_connection *connection_event)
+ {
+ DBUG_ENTER("Connection_event_coordinator::notify_event");
+ std::vector<Connection_event_subscriber>::iterator it= m_subscribers.begin();
+
+ while (it != m_subscribers.end())
+ {
+ Connection_event_subscriber event_subscriber= *it;
+ (void)event_subscriber.m_subscriber->notify_event(thd, this,
+ connection_event,
+ error_handler);
+
+ ++it;
+ }
+
+ DBUG_VOID_RETURN;
+ }
+
+
+ /**
+ Process change in sys_var value
+
+ Iterate through all subscribers
+ - If a subscriber has shown interest in getting notification for given
+ system variable, call notify_sys_var.
+
+ Note : If we receive error from a subscriber, we log it and move on.
+
+ @param error_hanlder [in] Error handler class
+ @param opt_connection_control Variable information
+ @param new_value [in] New value for variable
+ */
+
+ void
+ Connection_event_coordinator::notify_sys_var(Error_handler *error_handler,
+ opt_connection_control variable,
+ void *new_value)
+ {
+ DBUG_ENTER("Connection_event_coordinator::notify_sys_var");
+ std::vector<Connection_event_subscriber>::iterator it= m_subscribers.begin();
+
+ while (it != m_subscribers.end())
+ {
+ Connection_event_subscriber event_subscriber= *it;
+ if (event_subscriber.m_sys_vars[variable])
+ {
+ (void) event_subscriber.m_subscriber->notify_sys_var(this,
+ variable,
+ new_value,
+ error_handler);
+ }
+ ++it;
+ }
+
+ DBUG_VOID_RETURN;
+ }
+
+
+ /**
+ Update a status variable
+
+ @param observer [in] Requestor
+ @param status_var [in] Status variable to be updated
+ @param action [in] Operation to be performed on status variable
+
+ @returns status of the operation
+ @retval false Success
+ @retval true Error in processing
+ */
+
+ bool
+ Connection_event_coordinator::notify_status_var(Connection_event_observer **observer,
+ stats_connection_control status_var,
+ status_var_action action)
+ {
+ DBUG_ENTER("Connection_event_coordinator::notify_status_var");
+ bool error= false;
+
+ if (m_status_vars_subscription[status_var] == *observer)
+ {
+ if (status_var < STAT_LAST)
+ {
+ switch (action)
+ {
+ case ACTION_INC:
+ {
+ my_atomic_add64(&g_statistics.stats_array[status_var], 1);
+ break;
+ }
+ case ACTION_RESET:
+ {
+ my_atomic_store64(&g_statistics.stats_array[status_var], 0);
+ break;
+ }
+ default:
+ {
+ error= true;
+ DBUG_ASSERT(FALSE);
+ break;
+ }
+ }
+ }
+ }
+
+ DBUG_RETURN(error);
+ }
+}
--- /dev/null
+/* 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 */
+
+#ifndef CONNECTION_CONTROL_COORDINATOR_H
+#define CONNECTION_CONTROL_COORDINATOR_H
+
+#include "connection_control_interfaces.h" /* Connection_event_coordinator_services */
+#include "connection_control_memory.h" /* Connection_control_alloc */
+
+namespace connection_control
+{
+ /**
+ Connection event coordinator.
+ This class will keep list of subscribers for different subevents
+ and notify them based on their preference.
+ */
+
+ class Connection_event_coordinator : public Connection_event_coordinator_services,
+ public Connection_control_alloc
+ {
+ public:
+ Connection_event_coordinator()
+ {
+ reset();
+ }
+ ~Connection_event_coordinator()
+ {
+ reset();
+ }
+
+ /* Functions to receive notification from server */
+ void notify_event(MYSQL_THD thd,
+ Error_handler * error_handler,
+ const mysql_event_connection *connection_event);
+ void notify_sys_var(Error_handler * error_handler,
+ opt_connection_control variable,
+ void *new_value);
+
+ /* Services provided to observers */
+ bool register_event_subscriber(Connection_event_observer **subscriber,
+ std::vector<opt_connection_control> *sys_vars,
+ std::vector<stats_connection_control> *status_vars);
+
+ bool notify_status_var(Connection_event_observer **observer,
+ stats_connection_control status_var,
+ status_var_action action);
+
+ private:
+ void reset();
+ class Connection_event_subscriber
+ {
+ public:
+ Connection_event_observer * m_subscriber;
+ bool m_sys_vars[OPT_LAST];
+ };
+
+ std::vector<Connection_event_subscriber> m_subscribers;
+ Connection_event_observer *m_status_vars_subscription[STAT_LAST];
+ };
+}
+#endif // !CONNECTION_CONTROL_COORDINATOR_H
--- /dev/null
+/* 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 */
+
+#ifndef CONNECTION_CONTROL_DATA_H
+#define CONNECTION_CONTROL_DATA_H
+
+#include <my_global.h>
+
+/**
+ Enum for system variables : Must be in sync with
+ members of Connection_control_variables.
+*/
+typedef enum opt_connection_control
+{
+ OPT_FAILED_CONNECTIONS_THRESHOLD= 0,
+ OPT_MIN_CONNECTION_DELAY,
+ OPT_MAX_CONNECTION_DELAY,
+ OPT_LAST /* Must be last */
+}opt_connection_control;
+
+/**
+ Enum for status variables : Must be in sync with
+ memebers of Connection_control_statistics.
+*/
+typedef enum stats_connection_control
+{
+ STAT_CONNECTION_DELAY_TRIGGERED= 0,
+ STAT_LAST /* Must be last */
+}stats_connection_control;
+
+namespace connection_control
+{
+ /** Structure to maintain system variables */
+ class Connection_control_variables
+ {
+ public:
+ /* Various global variables */
+ int64 failed_connections_threshold;
+ int64 min_connection_delay;
+ int64 max_connection_delay;
+ };
+
+ /** Structure to maintain statistics */
+ class Connection_control_statistics
+ {
+ public:
+ Connection_control_statistics()
+ {}
+ /* Various statistics to be collected */
+ volatile int64 stats_array[STAT_LAST];
+ };
+}
+
+extern connection_control::Connection_control_statistics g_statistics;
+extern connection_control::Connection_control_variables g_variables;
+#endif // !CONNECTION_CONTROL_DATA_H
--- /dev/null
+/* 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 */
+
+#ifndef CONNECTION_CONTROL_INTERFACES_H
+#define CONNECTION_CONTROL_INTERFACES_H
+
+#include <mysql/plugin_audit.h> /* mysql_event_connection */
+
+#include "connection_control_data.h" /* Variables and Status */
+
+#include <vector> /* std::vector */
+#include <string> /* std::string */
+
+namespace connection_control
+{
+ /* Typedefs for convenience */
+ typedef std::string Sql_string;
+
+ /* Forward declarations */
+ class Connection_event_coordinator_services;
+
+ class Error_handler
+ {
+ public:
+ virtual void handle_error(const char * error_message)= 0;
+ virtual ~Error_handler() {}
+ };
+
+ /**
+ Interface for recording connection events
+ */
+
+ class Connection_event_records
+ {
+ public:
+ virtual bool create_or_update_entry(const Sql_string &s)= 0;
+ virtual bool remove_entry(const Sql_string &s)= 0;
+ virtual bool match_entry(const Sql_string &s, void *value)= 0;
+ virtual void reset_all()= 0;
+ virtual ~Connection_event_records()
+ { /* Emptiness! */ }
+ };
+
+
+ /**
+ Interface for defining action on connection events
+ */
+ class Connection_event_observer
+ {
+ public:
+ virtual bool notify_event(MYSQL_THD thd,
+ Connection_event_coordinator_services *coordinator,
+ const mysql_event_connection *connection_event,
+ Error_handler *error_handler)= 0;
+ virtual bool notify_sys_var(Connection_event_coordinator_services *coordinator,
+ opt_connection_control variable,
+ void *new_value,
+ Error_handler *error_handler)= 0;
+ virtual ~Connection_event_observer()
+ { /* Nothing to see here! */ }
+ };
+
+
+ /* Status variable action enum */
+ typedef enum status_var_action
+ {
+ ACTION_NONE=0,
+ ACTION_INC,
+ ACTION_RESET,
+ ACTION_LAST /* Must be at the end */
+ }status_var_action;
+
+
+ /**
+ Interface to provide service to observers
+ */
+
+ class Connection_event_coordinator_services
+ {
+ public:
+ virtual bool notify_status_var(Connection_event_observer **observer,
+ stats_connection_control status_var,
+ status_var_action action)= 0;
+ virtual bool register_event_subscriber(Connection_event_observer **subscriber,
+ std::vector<opt_connection_control> *sys_vars,
+ std::vector<stats_connection_control> *status_vars)= 0;
+ virtual ~Connection_event_coordinator_services()
+ { /* go away */ }
+ };
+}
+#endif // !CONNECTION_CONTROL_INTERFACES_H
--- /dev/null
+/* 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 */
+
+#ifndef CONNECTION_CONTROL_MEMORY_H
+#define CONNECTION_CONTROL_MEMORY_H
+
+#include <my_global.h>
+#include <my_sys.h>
+#include <limits>
+#include <memory>
+
+namespace connection_control
+{
+ template <class T>
+ T Connection_control_malloc(size_t size)
+ {
+ void *allocated_memory= my_malloc(size, MYF(MY_WME));
+ return allocated_memory ? reinterpret_cast<T>(allocated_memory) : NULL;
+ }
+
+ class Connection_control_alloc
+ {
+ public:
+ static void *operator new(size_t size) throw ()
+ {
+ return Connection_control_malloc<void*>(size);
+ }
+ static void *operator new[](size_t size) throw ()
+ {
+ return Connection_control_malloc<void*>(size);
+ }
+ static void operator delete(void* ptr, std::size_t sz)
+ {
+ my_free(ptr);
+ }
+ static void operator delete[](void* ptr, std::size_t sz)
+ {
+ my_free(ptr);
+ }
+ };
+}
+
+#endif //CONNECTION_CONTROL_MEMORY_H
--- /dev/null
+/* 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 */
+
+#define MYSQL_SERVER "We need security context"
+#include <m_ctype.h> /* my_charset_bin */
+#include <sql_class.h> /* THD, Security context */
+#include <item_cmpfunc.h>
+#include <mysql/psi/mysql_thread.h>
+
+#include "connection_delay.h"
+#include "connection_control.h"
+#include "security_context_wrapper.h"
+
+
+
+/* Forward declaration */
+bool schema_table_store_record(THD *thd, TABLE *table);
+
+struct st_mysql_information_schema
+ connection_control_failed_attempts_view={MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION};
+
+/** Fields of information_schema.connection_control_failed_attempts */
+static ST_FIELD_INFO failed_attempts_view_fields[]=
+{
+ {"USERHOST", USERNAME_LENGTH + MAX_HOSTNAME + 5, MYSQL_TYPE_STRING, 0, MY_I_S_UNSIGNED, 0, 0},
+ {"FAILED_ATTEMPTS", 16, MYSQL_TYPE_LONG, 0, MY_I_S_UNSIGNED, 0, 0},
+ {0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0}
+};
+
+
+namespace connection_control
+{
+
+ /** constants/variables declared in connection_delay_interfaces.h */
+
+ int64 DEFAULT_THRESHOLD= 3;
+ int64 MIN_THRESHOLD= 0;
+ int64 DISABLE_THRESHOLD= 0;
+ int64 MAX_THRESHOLD= INT_MAX32;
+
+ int64 DEFAULT_MAX_DELAY= INT_MAX32;
+ int64 DEFAULT_MIN_DELAY= 1000;
+ int64 MIN_DELAY= 1000;
+ int64 MAX_DELAY= INT_MAX32;
+
+ /** variables used by connection_delay.cc */
+ static mysql_rwlock_t connection_event_delay_lock;
+ static PSI_rwlock_key key_connection_event_delay_lock;
+ static PSI_rwlock_info all_rwlocks[]=
+ {
+ {&key_connection_event_delay_lock, "connection_event_delay_lock", 0}
+ };
+
+ static opt_connection_control opt_enums[]=
+ {
+ OPT_FAILED_CONNECTIONS_THRESHOLD,
+ OPT_MIN_CONNECTION_DELAY,
+ OPT_MAX_CONNECTION_DELAY
+ };
+ size_t opt_enums_size= 3;
+
+ static stats_connection_control status_vars_enums[]=
+ {
+ STAT_CONNECTION_DELAY_TRIGGERED
+ };
+ size_t status_vars_enums_size= 1;
+
+ static Connection_delay_action *g_max_failed_connection_handler= 0;
+
+ Sql_string I_S_CONNECTION_CONTROL_FAILED_ATTEMPTS_USERHOST
+ ("information_schema.connection_control_failed_login_attempts.userhost");
+
+ /**
+ Helper function for Connection_delay_event::reset_all
+
+ @param ptr [in] Pointer to an entry in hash
+
+ @returns 1 to indicate that entry is a match
+ */
+ int match_all_entries(const uchar *ptr)
+ {
+ return 1;
+ }
+
+
+ /**
+ Callback function for LF hash to get key information
+
+ Returns a pointer to a buffer which represent a key in the hash.
+ The function does NOT calculate a hash.
+ The function is called during lf_hash_insert(). The buffer is
+ fed to an internal calc_hash() which use the defined charset to
+ calculate a hash from the key buffer (in most cases a murmur)
+
+ @param el [in] Pointer to an element in the hash
+ @param length [out] The length of the key belonging to the element
+
+ @returns Pointer to key buffer
+ */
+
+ uchar *connection_delay_event_hash_key(const uchar *el, size_t *length, my_bool huh)
+ {
+ const Connection_event_record * const *entry;
+ const Connection_event_record *entry_info;
+ entry= reinterpret_cast<const Connection_event_record* const *>(el);
+ DBUG_ASSERT(entry != NULL);
+ entry_info= *entry;
+ *length= entry_info->get_length();
+ return (const_cast<uchar *>(entry_info->get_userhost()));
+ }
+
+
+ /**
+ Constructor for Connection_delay_event
+
+ Initialize LF hash.
+ */
+
+ Connection_delay_event::Connection_delay_event()
+ {
+ lf_hash_init(&m_entries, sizeof(Connection_event_record**), LF_HASH_UNIQUE,
+ 0, /* key offset */
+ 0, /* key length not used */
+ connection_delay_event_hash_key,
+ &my_charset_bin);
+ }
+
+
+ /**
+ Creates or updates an entry in hash
+
+ @param s [in] User information in '<user'@'<host>' format
+
+ @returns status of insertion/update
+ @retval false Insertion/Update successful
+ @retval true Failed to insert/update an entry
+ */
+
+ bool
+ Connection_delay_event::create_or_update_entry(const Sql_string &s)
+ {
+ Connection_event_record **searched_entry= NULL;
+ Connection_event_record *searched_entry_info= NULL;
+ Connection_event_record *new_entry= NULL;
+ int insert_status;
+ DBUG_ENTER("Connection_delay_event::create_or_update_entry");
+
+ LF_PINS *pins= lf_hash_get_pins(&m_entries);
+ if (unlikely(pins == NULL))
+ DBUG_RETURN(true);
+
+ searched_entry= reinterpret_cast<Connection_event_record **>
+ (lf_hash_search(&m_entries, pins, s.c_str(), s.length()));
+
+ if (searched_entry && (searched_entry != MY_ERRPTR))
+ {
+ /* We found an entry, so increment the count */
+ searched_entry_info= *searched_entry;
+ DBUG_ASSERT(searched_entry_info != NULL);
+ searched_entry_info->inc_count();
+ lf_hash_search_unpin(pins);
+ lf_hash_put_pins(pins);
+ DBUG_RETURN(false);
+ }
+ else
+ {
+ /* No entry found, so try to add new entry */
+ lf_hash_search_unpin(pins);
+ new_entry= new Connection_event_record(s);
+
+ insert_status= lf_hash_insert(&m_entries, pins, &new_entry);
+
+ if (likely(insert_status == 0))
+ {
+ lf_hash_put_pins(pins);
+ DBUG_RETURN(false);
+ }
+ else
+ {
+ /*
+ OOM. We are likely in bigger trouble than just
+ failing to insert an entry in hash.
+ */
+ lf_hash_put_pins(pins);
+ delete new_entry;
+ new_entry= NULL;
+ DBUG_RETURN(true);
+ }
+ }
+ }
+
+
+ /**
+ Resets count stored against given user entry
+
+ @param s [in] User information in '<user'@'<host>' format
+
+ @returns status of reset operation
+ @retval false Reset successful
+ @retval true Failed to find given entry
+ */
+
+ bool
+ Connection_delay_event::remove_entry(const Sql_string &s)
+ {
+ Connection_event_record **searched_entry= NULL;
+ Connection_event_record *searched_entry_info= NULL;
+ DBUG_ENTER("Connection_delay_event::reset_entry");
+
+ LF_PINS *pins= lf_hash_get_pins(&m_entries);
+
+ searched_entry= reinterpret_cast<Connection_event_record **>
+ (lf_hash_search(&m_entries, pins, s.c_str(), s.length()));
+
+ if (searched_entry && searched_entry != MY_ERRPTR)
+ {
+ searched_entry_info= *searched_entry;
+ DBUG_ASSERT(searched_entry_info != NULL);
+ int rc= lf_hash_delete(&m_entries, pins, s.c_str(), s.length());
+ lf_hash_search_unpin(pins);
+ lf_hash_put_pins(pins);
+ if (rc == 0)
+ {
+ /* free memory upon successful deletion */
+ delete searched_entry_info;
+ }
+ DBUG_RETURN(rc != 0);
+ }
+ else
+ {
+ /* No entry found. */
+ lf_hash_search_unpin(pins);
+ lf_hash_put_pins(pins);
+ DBUG_RETURN(true);
+ }
+ }
+
+
+ /**
+ Retrieve stored value for given user entry
+
+ @param s [in] User information in '<user'@'<host>' format
+ @param value [out] Buffer to hold value stored against given user
+
+ @returns whether given entry is present in hash or not
+ @retval false Entry found. Corresponding value is copied in value buffer.
+ @retval true No matching entry found. value buffer should not be used.
+ */
+
+ bool
+ Connection_delay_event::match_entry(const Sql_string &s, void *value)
+ {
+ Connection_event_record **searched_entry= NULL;
+ Connection_event_record *searched_entry_info= NULL;
+ int64 count= DISABLE_THRESHOLD;
+ bool error= true;
+ DBUG_ENTER("Connection_delay_event::match_entry");
+
+ LF_PINS *pins= lf_hash_get_pins(&m_entries);
+
+ searched_entry= reinterpret_cast<Connection_event_record **>
+ (lf_hash_search(&m_entries, pins, s.c_str(), s.length()));
+
+ if (searched_entry && searched_entry != MY_ERRPTR)
+ {
+ searched_entry_info= *searched_entry;
+ count= searched_entry_info->get_count();
+ error= false;
+ }
+
+ lf_hash_search_unpin(pins);
+ lf_hash_put_pins(pins);
+ *(reinterpret_cast<int64 *>(value))= count;
+
+ DBUG_RETURN(error);
+ }
+
+
+ /**
+ Delete all entries from hash and free memory
+
+ @returns Reset was successful or not
+ @retval true All entries removed.
+ @retval false Failed to remove some entries
+ */
+
+ void
+ Connection_delay_event::reset_all()
+ {
+ Connection_event_record **searched_entry= NULL;
+ DBUG_ENTER("Connection_delay_event::reset_all");
+ LF_PINS *pins= lf_hash_get_pins(&m_entries);
+
+ do
+ {
+ /* match anything */
+ searched_entry= reinterpret_cast<Connection_event_record**>
+ (lf_hash_random_match(&m_entries, pins, match_all_entries, 0));
+
+ if (searched_entry != NULL && searched_entry != MY_ERRPTR
+ && (*searched_entry)
+ && !lf_hash_delete(&m_entries, pins,
+ (*searched_entry)->get_userhost(),
+ (*searched_entry)->get_length()))
+ {
+ delete (*searched_entry);
+ *searched_entry= NULL;
+ }
+ else
+ {
+ /* Failed to delete didn't remove any pins */
+ lf_hash_search_unpin(pins);
+ }
+ } while (searched_entry != 0);
+
+ lf_hash_put_pins(pins);
+ DBUG_VOID_RETURN;
+ }
+
+
+ /** This works because connction_delay_IS_table is protected by wrlock */
+ static TABLE * connection_delay_IS_table;
+ void set_connection_delay_IS_table(TABLE *t)
+ {
+ connection_delay_IS_table= t;
+ }
+
+
+ /**
+ Function to populate information_schema view.
+
+ @param ptr [in] Entry from LF hash
+
+ @returns status of row insertion
+ @retval 0 Success
+ @retval 1 Error
+ */
+
+ int connection_delay_IS_table_writer(const uchar *ptr)
+ {
+ /* Always return "no match" so that we go through all entries */
+ THD *thd= current_thd;
+ const Connection_event_record * const * entry;
+ const Connection_event_record *entry_info;
+ entry= reinterpret_cast<const Connection_event_record * const *>(ptr);
+ entry_info= *entry;
+ connection_delay_IS_table->field[0]->store((char *)entry_info->get_userhost(),
+ entry_info->get_length(),
+ system_charset_info);
+ connection_delay_IS_table->field[1]->store(entry_info->get_count(), true);
+ if (schema_table_store_record(thd, connection_delay_IS_table))
+ return 1;
+ /* Always return "no match" so that we go over all entries in the hash */
+ return 0;
+ }
+
+
+ /**
+ Function to dump LF hash data to IS table.
+
+ @param thd [in] THD handle
+ @param tables [in] Handle to
+ information_schema.connection_control_failed_attempts
+ */
+
+ void
+ Connection_delay_event::fill_IS_table(THD *thd,
+ TABLE_LIST *tables)
+ {
+ DBUG_ENTER("Connection_delay_event::fill_IS_table");
+ TABLE *table= tables->table;
+ set_connection_delay_IS_table(table);
+ LF_PINS *pins= lf_hash_get_pins(&m_entries);
+ void *key= 0;
+
+ do
+ {
+ key= lf_hash_random_match(&m_entries,
+ pins,
+ /* Functor: match anything and store the fields */
+ connection_delay_IS_table_writer,
+ 0);
+ /* Always unpin after lf_hash_random_match() */
+ lf_hash_search_unpin(pins);
+ } while (key != 0);
+
+ lf_hash_put_pins(pins);
+ DBUG_VOID_RETURN;
+ }
+
+
+ /**
+ Connection_delay_action Constructor.
+
+ @param [in] threshold Defines a threshold after which wait is triggered
+ @param [in] min_delay Lower cap on wait
+ @param [in] max_delay Upper cap on wait
+ @param [in] sys_vars System variables
+ @param [in] sys_vars_size Size of sys_vars array
+ @param [in] status_vars Status variables
+ @param [in] status_vars_size Size of status_vars array
+ @param [in] lock RW lock handle
+ */
+
+ Connection_delay_action::Connection_delay_action(int64 threshold,
+ int64 min_delay,
+ int64 max_delay,
+ opt_connection_control *sys_vars,
+ size_t sys_vars_size,
+ stats_connection_control *status_vars,
+ size_t status_vars_size,
+ mysql_rwlock_t *lock)
+ : m_threshold(threshold),
+ m_min_delay(min_delay),
+ m_max_delay(max_delay),
+ m_lock(lock)
+ {
+ if (sys_vars_size)
+ {
+ for (uint i=0; i < sys_vars_size; ++i)
+ m_sys_vars.push_back(sys_vars[i]);
+ }
+
+ if (status_vars_size)
+ {
+ for (uint i=0; i < status_vars_size; ++i)
+ m_stats_vars.push_back(status_vars[i]);
+ }
+ }
+
+
+ /**
+ Create hash key of the format '<user>'@'<host>'.
+ Policy:
+ 1. Use proxy_user information if available. Else if,
+ 2. Use priv_user/priv_host if either of them is not empty. Else,
+ 3. Use user/host
+
+ @param thd [in] THD pointer for getting security context
+ @param s [out] Hash key is stored here
+ */
+
+ void
+ Connection_delay_action::make_hash_key(MYSQL_THD thd, Sql_string &s)
+ {
+ /* Our key for hash will be of format : '<user>'@'<host>' */
+
+ /* If proxy_user is set then use it directly for lookup */
+ Security_context_wrapper sctx_wrapper(thd);
+ const char * proxy_user= sctx_wrapper.get_proxy_user();
+ if (proxy_user && *proxy_user)
+ {
+ s.append(proxy_user);
+ } /* else if priv_user and/or priv_host is set, then use them */
+ else
+ {
+ const char * priv_user= sctx_wrapper.get_priv_user();
+ const char * priv_host= sctx_wrapper.get_priv_host();
+ if ((priv_user && *priv_user) || (priv_host && *priv_host))
+ {
+ s.append("'");
+
+ if (*priv_user)
+ s.append(priv_user);
+
+ s.append("'@'");
+
+ if (*priv_host)
+ s.append(priv_host);
+
+ s.append("'");
+ }
+ else
+ {
+ const char *user= sctx_wrapper.get_user();
+ const char *host= sctx_wrapper.get_host();
+ const char *ip= sctx_wrapper.get_ip();
+
+ s.append("'");
+
+ if (user && *user)
+ s.append(user);
+
+ s.append("'@'");
+
+ if (host && *host)
+ s.append(host);
+ else if (ip && *ip)
+ s.append(ip);
+
+ s.append("'");
+ }
+ }
+ }
+
+
+ /**
+ Wait till the wait_time expires or thread is killed
+
+ @param thd [in] Handle to MYSQL_THD object
+ @param wait_time [in] Maximum time to wait
+ */
+
+ void
+ Connection_delay_action::conditional_wait(MYSQL_THD thd,
+ ulonglong wait_time)
+ {
+ DBUG_ENTER("Connection_delay_action::conditional_wait");
+ const char * category= "connection_delay";
+
+ /** mysql_cond_timedwait requires wait time in timespec format */
+ struct timespec abstime;
+ /** Since we get wait_time in milliseconds, convert it to nanoseconds */
+ set_timespec_nsec(abstime, wait_time * 1000000ULL);
+
+ /** PSI_stage_info for thd_enter_cond/thd_exit_cond */
+ PSI_stage_info old_stage;
+ PSI_stage_info stage_waiting_in_connection_control_plugin=
+ {0, "Waiting in connection_control plugin", 0};
+
+ /** Initialize mutex required for mysql_cond_timedwait */
+ mysql_mutex_t connection_delay_mutex;
+ PSI_mutex_key key_connection_delay_mutex;
+ PSI_mutex_info connection_delay_mutex_info[]=
+ {
+ {&key_connection_delay_mutex, "connection_delay_mutex", PSI_FLAG_GLOBAL}
+ };
+ int count_mutex= array_elements(connection_delay_mutex_info);
+ PSI_server->register_mutex(category, connection_delay_mutex_info, count_mutex);
+ mysql_mutex_init(key_connection_delay_mutex, &connection_delay_mutex,
+ MY_MUTEX_INIT_FAST);
+
+ /* Initialize condition to wait for */
+ mysql_cond_t connection_delay_wait_condition;
+ PSI_cond_key key_connection_delay_wait;
+ PSI_cond_info connection_delay_wait_info[]=
+ {
+ {&key_connection_delay_wait, "connection_delay_wait_condition", 0}
+ };
+ int count_cond= array_elements(connection_delay_wait_info);
+ PSI_server->register_cond(category, connection_delay_wait_info, count_cond);
+ mysql_cond_init(key_connection_delay_wait, &connection_delay_wait_condition, NULL);
+
+ /** Register wait condition with THD */
+ mysql_mutex_lock(&connection_delay_mutex);
+ thd_enter_cond(thd, &connection_delay_wait_condition, &connection_delay_mutex,
+ &stage_waiting_in_connection_control_plugin, &old_stage,
+ __func__, __FILE__, __LINE__);
+
+ /*
+ At this point, thread is essentially going to sleep till
+ timeout. If admin issues KILL statement for this THD,
+ there is no point keeping this thread in sleep mode only
+ to wake up to be terminated. Hence, in case of KILL,
+ we will return control to server without worring about
+ wait_time.
+ */
+ mysql_cond_timedwait(&connection_delay_wait_condition, &connection_delay_mutex, &abstime);
+
+ /* Finish waiting and deregister wait condition */
+ thd_exit_cond(thd, &stage_waiting_in_connection_control_plugin,
+ __func__, __FILE__, __LINE__);
+
+ /* Cleanup */
+ mysql_mutex_destroy(&connection_delay_mutex);
+ mysql_cond_destroy(&connection_delay_wait_condition);
+ DBUG_VOID_RETURN;
+ }
+
+
+ /**
+ @brief Handle a connection event and if requried,
+ wait for random amount of time before returning.
+
+ We only care about CONNECT and CHANGE_USER sub events.
+
+ @param thd [in] THD pointer
+ @param coordinator [in] Connection_event_coordinator
+ @param connection_event [in] Connection event to be handled
+ @param error_handler [in] Error handler object
+
+ @returns status of connection event handling
+ @retval false Successfully handled an event.
+ @retval true Something went wrong.
+ error_buffer may contain details.
+ */
+
+ bool
+ Connection_delay_action::notify_event(MYSQL_THD thd,
+ Connection_event_coordinator_services *coordinator,
+ const mysql_event_connection *connection_event,
+ Error_handler *error_handler)
+ {
+ DBUG_ENTER("Connection_delay_action::notify");
+ bool error= false;
+ unsigned int subclass= connection_event->event_subclass;
+ Connection_event_observer *self= this;
+
+ if (subclass != MYSQL_AUDIT_CONNECTION_CONNECT &&
+ subclass != MYSQL_AUDIT_CONNECTION_CHANGE_USER)
+ DBUG_RETURN(error);
+
+ RD_lock rd_lock(m_lock);
+
+ int64 threshold= this->get_threshold();
+
+ /* If feature was disabled, return */
+ if (threshold <= DISABLE_THRESHOLD)
+ DBUG_RETURN(error);
+
+ int64 current_count= 0;
+ bool user_present= false;
+ Sql_string userhost;
+
+ make_hash_key(thd, userhost);
+
+ DBUG_PRINT("info", ("Connection control : Connection event lookup for: %s",
+ userhost.c_str()));
+
+ /* Cache current failure count */
+ user_present=
+ m_userhost_hash.match_entry(userhost, (void *)¤t_count) ? false : true;
+
+ if (current_count >= threshold || current_count < 0)
+ {
+ /*
+ If threshold is crosed, regardless of connection success
+ or failure, wait for (current_count + 1) - threshold seconds
+ Note that current_count is not yet updated in hash. So we
+ have to consider current connection as well - Hence the usage
+ of current_count + 1.
+ */
+ ulonglong wait_time= get_wait_time((current_count + 1) - threshold);
+
+ if ((error= coordinator->notify_status_var(
+ &self, STAT_CONNECTION_DELAY_TRIGGERED, ACTION_INC)))
+ {
+ error_handler->handle_error("Failed to update connection delay triggered stats");
+ }
+ /*
+ Invoking sleep while holding read lock on Connection_delay_action
+ would block access to cache data through IS table.
+ */
+ rd_lock.unlock();
+ conditional_wait(thd, wait_time);
+ rd_lock.lock();
+ }
+
+ if (connection_event->status)
+ {
+ /*
+ Connection failure.
+ Add new entry to hash or increment failed connection count
+ for an existing entry
+ */
+ if (m_userhost_hash.create_or_update_entry(userhost))
+ {
+ char error_buffer[512];
+ memset(error_buffer, 0, sizeof(error_buffer));
+ my_snprintf(error_buffer, sizeof(error_buffer)-1,
+ "Failed to update connection delay hash for account : %s",
+ userhost.c_str());
+ error_handler->handle_error(error_buffer);
+ error= true;
+ }
+ }
+ else
+ {
+ /*
+ Successful connection.
+ delete entry for given account from the hash
+ */
+ if (user_present && m_userhost_hash.remove_entry(userhost))
+ {
+ char error_buffer[512];
+ memset(error_buffer, 0, sizeof(error_buffer));
+ my_snprintf(error_buffer, sizeof(error_buffer) - 1,
+ "Failed to delete connection delay hash entry for acount : %s."
+ " It might have been deleted already.",
+ userhost.c_str());
+ error_handler->handle_error(error_buffer);
+ error= true;
+ }
+ }
+
+ DBUG_RETURN(error);
+ }
+
+
+ /**
+ Notification of a change in system variable value
+
+ @param coordinator [in] Handle to coordinator
+ @param variable [in] Enum of variable
+ @param new_value [in] New value for variable
+ @param error_buffer [out] Buffer to log error message if any
+ @param error_buffer_size [in] Size of error buffer
+
+ @returns processing status
+ @retval false Change in variable value processed successfully
+ @retval true Error processing new value.
+ error_buffer may contain more details.
+ */
+
+ bool
+ Connection_delay_action::notify_sys_var(Connection_event_coordinator_services *coordinator,
+ opt_connection_control variable,
+ void *new_value,
+ Error_handler * error_handler)
+ {
+ DBUG_ENTER("Connection_delay_action::notify_sys_var");
+ bool error= true;
+ Connection_event_observer *self= this;
+
+ WR_lock wr_lock(m_lock);
+
+ switch (variable)
+ {
+ case OPT_FAILED_CONNECTIONS_THRESHOLD:
+ {
+ int64 new_threshold= *(static_cast<int64 *>(new_value));
+ DBUG_ASSERT(new_threshold >= DISABLE_THRESHOLD);
+ set_threshold(new_threshold);
+
+ if ((error= coordinator->notify_status_var(&self,
+ STAT_CONNECTION_DELAY_TRIGGERED,
+ ACTION_RESET)))
+ {
+ error_handler->handle_error("Failed to reset connection delay triggered stats");
+ }
+ break;
+ }
+ case OPT_MIN_CONNECTION_DELAY:
+ case OPT_MAX_CONNECTION_DELAY:
+ {
+ int64 new_delay= *(static_cast<int64 *>(new_value));
+ if ((error= set_delay(new_delay,
+ (variable == OPT_MIN_CONNECTION_DELAY))))
+ {
+ char error_buffer[512];
+ memset(error_buffer, 0, sizeof(error_buffer));
+ my_snprintf(error_buffer, sizeof(error_buffer) - 1,
+ "Could not set %s delay for connection delay.",
+ (variable == OPT_MIN_CONNECTION_DELAY) ? "min" : "max");
+ error_handler->handle_error(error_buffer);
+ }
+ break;
+ }
+ default:
+ /* Should never reach here. */
+ DBUG_ASSERT(FALSE);
+ error_handler->handle_error("Unexpected option type for connection delay.");
+ };
+ DBUG_RETURN(error);
+ }
+
+
+ /**
+ Subscribe with coordinator for connection events
+
+ @param coordinator [in] Handle to Connection_event_coordinator_services
+ for registration
+ */
+ void
+ Connection_delay_action::init(Connection_event_coordinator_services *coordinator)
+ {
+ DBUG_ENTER("Connection_delay_action::init");
+ DBUG_ASSERT(coordinator);
+ bool retval;
+ Connection_event_observer *subscriber= this;
+ WR_lock wr_lock(m_lock);
+ retval= coordinator->register_event_subscriber(&subscriber,
+ &m_sys_vars,
+ &m_stats_vars);
+ DBUG_ASSERT(!retval);
+ if (retval)
+ retval= false; /* Make compiler happy */
+ DBUG_VOID_RETURN;
+ }
+
+
+ /**
+ Clear data from Connection_delay_action
+ */
+
+ void
+ Connection_delay_action::deinit()
+ {
+ mysql_rwlock_wrlock(m_lock);
+ m_userhost_hash.reset_all();
+ m_sys_vars.clear();
+ m_stats_vars.clear();
+ m_threshold= DISABLE_THRESHOLD;
+ mysql_rwlock_unlock(m_lock);
+ m_lock= 0;
+ }
+
+
+
+ /**
+ Get user information from "where userhost = <value>"
+
+ @param cond [in] Equality condition structure
+ @param eq_arg [out] Sql_string handle to store user information
+ @param field_name [in] userhost field
+
+ @returns whether a value was found or not
+ @retval false Found a value. Check eq_arg
+ @retval true Error.
+ */
+
+ static
+ bool get_equal_condition_argument(Item *cond, Sql_string *eq_arg,
+ const Sql_string &field_name)
+ {
+ if (cond != 0 && cond->type() == Item::FUNC_ITEM)
+ {
+ Item_func *func= static_cast<Item_func *>(cond);
+ if (func != NULL && func->functype() == Item_func::EQ_FUNC)
+ {
+ Item_func_eq* eq_func= static_cast<Item_func_eq*>(func);
+ if (eq_func->arguments()[0]->type() == Item::FIELD_ITEM &&
+ my_strcasecmp(system_charset_info,
+ eq_func->arguments()[0]->full_name(),
+ field_name.c_str()) == 0)
+ {
+ char buff[1024];
+ String *res;
+ String filter(buff, sizeof(buff), system_charset_info);
+ if (eq_func->arguments()[1] != NULL &&
+ (res= eq_func->arguments()[1]->val_str(&filter)))
+ {
+ eq_arg->append(res->c_ptr_safe(), res->length());
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+
+ /**
+ Function to fill information_schema.connection_control_failed_attempts.
+
+ Handles query with equality condition.
+ For full scan, calls Connection_delay_event::fill_IS_table()
+
+ Permission : SUPER_ACL is required.
+
+ @param thd [in] THD handle.
+ @param tables [in] Handle to
+ information_schema.connection_control_failed_attempts.
+ @param cond [in] Condition if any.
+ */
+
+ void
+ Connection_delay_action::fill_IS_table(THD *thd,
+ TABLE_LIST *tables,
+ Item *cond)
+ {
+ DBUG_ENTER("Connection_delay_action::fill_IS_table");
+ Security_context_wrapper sctx_wrapper(thd);
+ if (!sctx_wrapper.is_super_user())
+ DBUG_VOID_RETURN;
+ WR_lock wr_lock(m_lock);
+ Sql_string eq_arg;
+ if (cond != 0 &&
+ !get_equal_condition_argument(cond,
+ &eq_arg,
+ I_S_CONNECTION_CONTROL_FAILED_ATTEMPTS_USERHOST))
+ {
+ int64 current_count= 0;
+ if (m_userhost_hash.match_entry(eq_arg, (void *)¤t_count))
+ {
+ /* There are no matches given the condition */
+ DBUG_VOID_RETURN;
+ }
+ else
+ {
+ /* There is exactly one matching userhost entry */
+ TABLE *table= tables->table;
+ table->field[0]->store(eq_arg.c_str(), eq_arg.length(),
+ system_charset_info);
+ table->field[1]->store(current_count, true);
+ schema_table_store_record(thd, table);
+ }
+ }
+ else
+ m_userhost_hash.fill_IS_table(thd, tables);
+
+ DBUG_VOID_RETURN;
+ }
+
+
+ /**
+ Initializes required objects for handling connection events.
+
+ @param coordinator [in] Connection_event_coordinator_services handle.
+ */
+
+ bool init_connection_delay_event(Connection_event_coordinator_services *coordinator,
+ Error_handler *error_handler)
+ {
+ /*
+ 1. Initialize lock(s)
+ */
+ const char *category= "conn_control";
+ int count= array_elements(all_rwlocks);
+ mysql_rwlock_register(category, all_rwlocks, count);
+ mysql_rwlock_init(key_connection_event_delay_lock,
+ &connection_event_delay_lock);
+ g_max_failed_connection_handler= new Connection_delay_action(g_variables.failed_connections_threshold,
+ g_variables.min_connection_delay,
+ g_variables.max_connection_delay,
+ opt_enums, opt_enums_size,
+ status_vars_enums, status_vars_enums_size,
+ &connection_event_delay_lock);
+ if (!g_max_failed_connection_handler)
+ {
+ error_handler->handle_error("Failed to initialization Connection_delay_action");
+ return true;
+ }
+ g_max_failed_connection_handler->init(coordinator);
+
+ return false;
+ }
+
+
+ /**
+ Deinitializes objects and frees associated memory.
+ */
+
+ void deinit_connection_delay_event()
+ {
+ if (g_max_failed_connection_handler)
+ delete g_max_failed_connection_handler;
+ g_max_failed_connection_handler= 0;
+ mysql_rwlock_destroy(&connection_event_delay_lock);
+ return;
+ }
+}
+
+
+/**
+ Function to fill information_schema.connection_control_failed_attempts.
+
+ @param thd [in] THD handle.
+ @param tables [in] Handle to
+ information_schema.connection_control_failed_attempts.
+ @param cond [in] Condition if any.
+
+ @returns Always returns FALSE.
+*/
+
+int fill_failed_attempts_view(THD *thd,
+ TABLE_LIST *tables,
+ Item *cond)
+{
+ if (connection_control::g_max_failed_connection_handler)
+ connection_control::g_max_failed_connection_handler->fill_IS_table(thd, tables, cond);
+ return FALSE;
+}
+
+
+/**
+ View init function
+
+ @param ptr [in] Handle to
+ information_schema.connection_control_failed_attempts.
+
+ @returns Always returns 0.
+*/
+
+int connection_control_failed_attempts_view_init(void *ptr)
+{
+ ST_SCHEMA_TABLE *schema_table= (ST_SCHEMA_TABLE *)ptr;
+
+ schema_table->fields_info= failed_attempts_view_fields;
+ schema_table->fill_table= fill_failed_attempts_view;
+ schema_table->idx_field1= 0;
+ schema_table->idx_field2= 1;
+ return 0;
+}
+
+
--- /dev/null
+/* 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 */
+
+#ifndef CONNECTION_DELAY_H
+#define CONNECTION_DELAY_H
+
+#include <lf.h> /* LF Hash */
+#include <my_global.h>
+#include <my_atomic.h> /* my_atomic_* */
+#include <mysql_com.h> /* USERNAME_LENGTH */
+#include "table.h" /* TABLE_LIST */
+
+#include "connection_control_interfaces.h" /* Observer interface */
+#include "connection_delay_api.h" /* Constants */
+#include "connection_control_data.h" /* variables and status */
+#include "connection_control_memory.h" /* Connection_control_alloc */
+
+namespace connection_control
+{
+ /**
+ Class to store failed attempts information for a given user.
+ */
+
+ class Connection_event_record : public Connection_control_alloc
+ {
+ public:
+
+ /**
+ Constructor for Connection_event_record. Always initializes failed login count to 1.
+ */
+ Connection_event_record(const Sql_string &s)
+ : m_count(1)
+ {
+ memset((void *)m_userhost, 0, sizeof(m_userhost));
+ memcpy((void *)m_userhost, s.c_str(), s.length());
+ m_length= s.length();
+ m_count= 1;
+ }
+
+ /**
+ Retrives failed login count for given user entry
+
+ @returns Failed login count
+ */
+ int64 get_count() const
+ {
+ int64 result= my_atomic_load64((volatile int64*)&m_count);
+ return result;
+ }
+
+ /** Increment failed login count for given user entry by 1 */
+ void inc_count()
+ {
+ my_atomic_add64((volatile int64*)&m_count, 1);
+ }
+
+ /** Reset failed login count for given user entry */
+ void reset_count()
+ {
+ my_atomic_store64(&m_count, 0);
+ }
+
+ /** Get user information */
+ uchar * get_userhost() const
+ {
+ return const_cast<uchar *> (m_userhost);
+ }
+
+ /** Get length information */
+ size_t get_length() const
+ {
+ return m_length;
+ }
+
+ /** Destructor */
+ ~Connection_event_record()
+ {
+ m_count= DISABLE_THRESHOLD;
+ }
+
+ private:
+ /* '<user>'@'<host>' */
+ uchar m_userhost[1 + USERNAME_LENGTH + 3 + HOSTNAME_LENGTH + 1 + 1];
+ /* Length of m_userhost */
+ size_t m_length;
+ /* connection event count */
+ volatile int64 m_count;
+ };
+
+
+ /**
+ Hash for a connection event.
+ Stores information in Connection_event_record object for each user.
+ */
+
+ class Connection_delay_event : public Connection_event_records
+ {
+ public:
+
+ /** Constructor. Also initializes the hash */
+ Connection_delay_event();
+
+ /** Destructor. Removes all entries from hash before destroying hash */
+ ~Connection_delay_event()
+ {
+ reset_all();
+ lf_hash_destroy(&m_entries);
+ }
+
+ void fill_IS_table(THD *thd, TABLE_LIST *tables);
+
+ /* Overridden function */
+ bool create_or_update_entry(const Sql_string &s);
+ bool remove_entry(const Sql_string &s);
+ bool match_entry(const Sql_string &s, void * value);
+ void reset_all();
+
+ private:
+ /** Hash for storing Connection_event_record per user */
+ LF_HASH m_entries;
+ };
+
+
+ /**
+ Connection event action to enforce max failed login constraint
+ */
+
+ class Connection_delay_action : public Connection_event_observer,
+ public Connection_control_alloc
+ {
+ public:
+
+ Connection_delay_action(int64 threshold,
+ int64 min_delay,
+ int64 max_delay,
+ opt_connection_control *sys_vars,
+ size_t sys_vars_size,
+ stats_connection_control *status_vars,
+ size_t status_vars_size,
+ mysql_rwlock_t *lock);
+
+ /** Destructor */
+ ~Connection_delay_action()
+ {
+ deinit();
+ m_lock= 0;
+ }
+
+ void init(Connection_event_coordinator_services *coordinator);
+
+ /**
+ Set threshold value.
+
+ @param threshold [in] New threshold value
+
+ @returns whether threshold value was changed successfully or not
+ @retval true Success
+ @retval false Failure. Invalid threshold value specified.
+ */
+
+ void set_threshold(int64 threshold)
+ {
+ my_atomic_store64(&m_threshold, threshold);
+ /* Clear the hash */
+ m_userhost_hash.reset_all();
+ }
+
+ /** Get threshold value */
+ int64 get_threshold()
+ {
+ int64 result= my_atomic_load64(&m_threshold);
+ return result;
+ }
+
+ /**
+ Set min/max delay
+
+ @param new_value [in] New m_min_delay/m_max_delay value
+ @param min [in] true for m_min_delay. false otherwise.
+
+ @returns whether m_min_delay/m_max_delay value was changed successfully or not
+ @retval false Success
+ @retval true Failure. Invalid value specified.
+ */
+
+ bool set_delay(int64 new_value, bool min)
+ {
+ int64 current_max= get_max_delay();
+ int64 current_min= get_min_delay();
+
+ if (new_value < MIN_DELAY)
+ return true;
+
+ if ((min && new_value > current_max) ||
+ (!min && new_value < current_min))
+ return true;
+
+ else
+ min ? my_atomic_store64(&m_min_delay, new_value) :
+ my_atomic_store64(&m_max_delay, new_value);
+ return false;
+ }
+
+ /** Get max value */
+ int64 get_max_delay()
+ {
+ int64 result= my_atomic_load64(&m_max_delay);
+ return result;
+ }
+
+ /** Get min value */
+ int64 get_min_delay()
+ {
+ int64 result= my_atomic_load64(&m_min_delay);
+ return result;
+ }
+
+ void fill_IS_table(THD *thd,
+ TABLE_LIST *tables,
+ Item *cond);
+
+ /** Overridden functions */
+ bool notify_event(MYSQL_THD thd,
+ Connection_event_coordinator_services *coordinator,
+ const mysql_event_connection *connection_event,
+ Error_handler *error_handler);
+ bool notify_sys_var(Connection_event_coordinator_services *coordinator,
+ opt_connection_control variable,
+ void *new_value,
+ Error_handler *error_handler);
+
+ private:
+ void deinit();
+ void make_hash_key(MYSQL_THD thd, Sql_string &s);
+ /**
+ Generates wait time
+
+ @param count [in] Proposed delay
+
+ @returns wait time
+ */
+
+ inline ulonglong get_wait_time(int64 count)
+ {
+ int64 max_delay= get_max_delay();
+ int64 min_delay= get_min_delay();
+ int64 count_mili= count*1000;
+
+ /*
+ if count < 0 (can happen in edge cases
+ we return max_delay.
+ Otherwise, following equation will be used:
+ wait_time = MIN(MIN(count, min_delay),
+ max_delay)
+ */
+ return (static_cast<ulonglong>((count_mili >= MIN_DELAY && count_mili < max_delay) ?
+ (count_mili < min_delay ? min_delay : count_mili) :
+ max_delay));
+ }
+ void conditional_wait(THD *thd,
+ ulonglong wait_time);
+
+ private:
+ /** Threshold value which triggers wait */
+ volatile int64 m_threshold;
+ /** Lower cap on delay to be generated */
+ volatile int64 m_min_delay;
+ /** Upper cap on delay to be generated */
+ volatile int64 m_max_delay;
+ /** System variables */
+ std::vector<opt_connection_control> m_sys_vars;
+ /** Status variables */
+ std::vector<stats_connection_control> m_stats_vars;
+ /** Hash to store failed attempts for each user entry */
+ Connection_delay_event m_userhost_hash;
+ /** RW lock */
+ mysql_rwlock_t *m_lock;
+ };
+}
+#endif /* !CONNECTION_DELAY_H */
--- /dev/null
+/* 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 */
+
+#ifndef CONNECTION_DELAY_API_H
+#define CONNECTION_DELAY_API_H
+
+/* Structures/Functions requried for information schema table */
+
+extern struct st_mysql_information_schema connection_control_failed_attempts_view;
+int connection_control_failed_attempts_view_init(void *ptr);
+
+namespace connection_control
+{
+
+ /* constants/variables defined in connection_delay.cc */
+
+ extern int64 DEFAULT_THRESHOLD;
+ extern int64 MIN_THRESHOLD;
+ extern int64 DISABLE_THRESHOLD;
+ extern int64 MAX_THRESHOLD;
+
+ extern int64 DEFAULT_MAX_DELAY;
+ extern int64 DEFAULT_MIN_DELAY;
+ extern int64 MIN_DELAY;
+ extern int64 MAX_DELAY;
+
+ /** Functions being used by connection_control.cc */
+
+ class Connection_event_coordinator_services;
+ class Error_handler;
+
+ bool init_connection_delay_event(Connection_event_coordinator_services *coordinator,
+ Error_handler *error_handler);
+ void deinit_connection_delay_event();
+
+}
+#endif // !CONNECTION_DELAY_API_H
--- /dev/null
+/* 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 */
+
+#define MYSQL_SERVER "We need security context"
+
+#include <sql_class.h> /* THD, Security context */
+#include <sql_acl.h> /* SUPER_ACL */
+
+#include "security_context_wrapper.h"
+
+namespace connection_control
+{
+ /**
+ Security_context_wrapper constructor.
+
+ @param thd [in] Handle to THD
+
+ Get security context from thd.
+ */
+ Security_context_wrapper::Security_context_wrapper(MYSQL_THD thd)
+ {
+ m_valid= thd->security_ctx ? true : false;
+ m_thd= thd;
+ }
+
+
+ /**
+ Get value for given property from security context
+
+ @param property [in] Property to be checked
+ @param value [out] Value of the property
+
+ @returns status of property check
+ @retval true Error fetching property value
+ @retval false value contains valid value for given property
+ */
+
+ bool
+ Security_context_wrapper::get_property(const char *property, LEX_CSTRING *value)
+ {
+ value->length=0;
+ value->str= 0;
+
+ if (!m_valid || !property)
+ return true;
+ else
+ {
+ if (!strcmp(property, "priv_user"))\r
+ {\r
+ if (m_thd->security_ctx->priv_user)\r
+ {\r
+ value->str= m_thd->security_ctx->priv_user;\r
+ value->length= strlen(value->str);\r
+ }\r
+ }
+ else if (!strcmp(property, "priv_host"))
+ {
+ if (m_thd->security_ctx->priv_host)
+ {
+ value->str= m_thd->security_ctx->priv_host;
+ value->length= strlen(value->str);
+ }
+ }
+ else if (!strcmp(property, "user"))
+ {
+ if (m_thd->security_ctx->user)
+ {
+ value->str= m_thd->security_ctx->user;
+ value->length= strlen(value->str);
+ }
+ }
+ else if (!strcmp(property, "proxy_user"))\r
+ {\r
+ if (m_thd->security_ctx->proxy_user)\r
+ {\r
+ value->str= m_thd->security_ctx->proxy_user;\r
+ value->length= strlen(value->str);\r
+ }\r
+ }
+ else if (!strcmp(property, "host"))
+ {
+ if (m_thd->security_ctx->get_host()->length())
+ {
+ value->str= m_thd->security_ctx->get_host()->c_ptr();
+ value->length= strlen(value->str);
+ }
+ }
+ else if (!strcmp(property, "ip"))
+ {
+ if (m_thd->security_ctx->get_ip()->length())
+ {
+ value->str= m_thd->security_ctx->get_ip()->c_ptr();
+ value->length= strlen(value->str);
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /** Get proxy user information from security context */
+
+ const char *
+ Security_context_wrapper::get_proxy_user()
+ {
+ LEX_CSTRING proxy_user;
+ if (get_property("proxy_user", &proxy_user))
+ return 0;
+ return proxy_user.str;
+ }
+
+
+ /** Get priv user information from security context */
+
+ const char *
+ Security_context_wrapper::get_priv_user()
+ {
+ LEX_CSTRING priv_user;
+ if (get_property("priv_user", &priv_user))
+ return 0;
+ return priv_user.str;
+ }
+
+
+ /** Get priv host information from security context */
+
+ const char *
+ Security_context_wrapper::get_priv_host()
+ {
+ LEX_CSTRING priv_host;
+ if (get_property("priv_host", &priv_host))
+ return 0;
+ return priv_host.str;
+ }
+
+
+ /** Get connected user information from security context */
+
+ const char *
+ Security_context_wrapper::get_user()
+ {
+ LEX_CSTRING user;
+ if (get_property("user", &user))
+ return 0;
+ return user.str;
+ }
+
+
+ /** Get connected host information from security context */
+
+ const char *
+ Security_context_wrapper::get_host()
+ {
+ /*
+ We can't use thd->security_ctx->priv_host_name()
+ because it returns "%" if hostname is empty.
+ However, thd->security_ctx->proxy_user won't have
+ "%" if hostname was empty.
+
+ To be consistent, we will always use
+ 'user'@'host'/''@'host'/''@'' type of representation.
+ */
+ LEX_CSTRING host;
+ if (get_property("host", &host))
+ return 0;
+ return host.str;
+ }
+
+
+ /** Get connected ip information from security context */
+
+ const char *
+ Security_context_wrapper::get_ip()
+ {
+ LEX_CSTRING ip;
+ if (get_property("ip", &ip))
+ return 0;
+ return ip.str;
+ }
+
+
+ /** Check if valid security context exists for give THD or not */
+
+ bool
+ Security_context_wrapper::security_context_exists()
+ {
+ return m_valid;
+ }
+
+
+ /** Check whether user has requried privilege or not */
+
+ bool
+ Security_context_wrapper::is_super_user()
+ {
+ if (!m_valid)
+ return false;
+
+ bool has_super= ((m_thd->security_ctx->master_access & SUPER_ACL) == SUPER_ACL);
+
+ return has_super;
+ }
+}
--- /dev/null
+/* 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 */
+
+#ifndef HAVE_SECURITY_CONTEXT_WRAPPER_H
+#define HAVE_SECURITY_CONTEXT_WRAPPER_H
+
+#include <mysql/plugin.h>
+
+namespace connection_control
+{
+ class Security_context_wrapper
+ {
+ public:
+ Security_context_wrapper(MYSQL_THD thd);
+ ~Security_context_wrapper()
+ {}
+ const char * get_proxy_user();
+ const char * get_priv_user();
+ const char * get_priv_host();
+ const char * get_user();
+ const char * get_host();
+ const char * get_ip();
+ bool security_context_exists();
+ bool is_super_user();
+
+ private:
+ bool get_property(const char *property, LEX_CSTRING *value);
+ MYSQL_THD m_thd;
+ bool m_valid;
+ };
+}
+#endif // !HAVE_SECURITY_CONTEXT_WRAPPER_H
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "sql_plugin.h" // st_plugin_int
/*
- Disable __attribute__() on non-gcc compilers.
+ Disable MY_ATTRIBUTE() on non-gcc compilers.
*/
-#if !defined(__attribute__) && !defined(__GNUC__)
-#define __attribute__(A)
+#if !defined(MY_ATTRIBUTE) && !defined(__GNUC__)
+#define MY_ATTRIBUTE(A)
#endif
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <ctype.h>
#include <mysql/plugin.h>
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#define __attribute__(A)
-#endif
+#include "my_attribute.h"
static long number_of_calls= 0; /* for SHOW STATUS, see below */
1 failure (cannot happen)
*/
-static int simple_parser_plugin_init(void *arg __attribute__((unused)))
+static int simple_parser_plugin_init(void *arg MY_ATTRIBUTE((unused)))
{
return(0);
}
*/
-static int simple_parser_plugin_deinit(void *arg __attribute__((unused)))
+static int simple_parser_plugin_deinit(void *arg MY_ATTRIBUTE((unused)))
{
return(0);
}
*/
static int simple_parser_init(MYSQL_FTPARSER_PARAM *param
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return(0);
}
*/
static int simple_parser_deinit(MYSQL_FTPARSER_PARAM *param
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return(0);
}
--- /dev/null
+# 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
offset += nw;
for (int ii = 0; ii < info->num_features; ++ii) {
if (info->features[ii].description != NULL) {
+ // We don't want to write partially from source
+ if (sizeof(message)-offset <=
+ 2+strlen(info->features[ii].description))
+ {
+ return;
+ }
nw = snprintf(message + offset, sizeof(message) - offset,
"%s%s", comma ? ", " : "",
info->features[ii].description);
--- /dev/null
+*.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
+
/***********************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
&col_value->value_int,
col_value->value_len,
col_value->is_unsigned);
+
+ assert(int_len <= conn_data->mul_col_buf_len);
+
memcpy(c_value, int_buf, int_len);
c_value += int_len;
} else {
-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 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
/*
- __attribute__(A) needs to be defined for Windows else complier
+ MY_ATTRIBUTE(A) needs to be defined for Windows else complier
do not recognise it. Argument in plugin_init and plugin_deinit
Used in other plugins as well.
*/
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
-#define __attribute__(A)
+#if !defined(MY_ATTRIBUTE) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+#define MY_ATTRIBUTE(A)
#endif
#define MAX_DICTIONARY_FILE_LENGTH 1024 * 1024
It empty the std::set and returns 0
*/
-static int validate_password_deinit(void *arg __attribute__((unused)))
+static int validate_password_deinit(void *arg MY_ATTRIBUTE((unused)))
{
free_dictionary_file();
mysql_rwlock_destroy(&LOCK_dict_file);
the cache and re-load the new dictionary file.
*/
static void
-dictionary_update(MYSQL_THD thd __attribute__((unused)),
- struct st_mysql_sys_var *var __attribute__((unused)),
+dictionary_update(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
void *var_ptr, const void *save)
{
*(const char**)var_ptr= *(const char**)save;
4. validate_password_special_char_count
*/
static void
-length_update(MYSQL_THD thd __attribute__((unused)),
- struct st_mysql_sys_var *var __attribute__((unused)),
+length_update(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
void *var_ptr, const void *save)
{
int new_validate_password_length;
TranxNode* entry= NULL;
mysql_cond_t* thd_cond= NULL;
+ bool is_semi_sync_trans= true;
if (active_tranxs_ != NULL && trx_wait_binlog_name)
{
entry=
break;
}
}
+ /*
+ When code reaches here an Entry object may not be present in the
+ following scenario.
+
+ Semi sync was not enabled when transaction entered into ordered_commit
+ process. During flush stage, semi sync was not enabled and there was no
+ 'Entry' object created for the transaction being committed and at a
+ later stage it was enabled. In this case trx_wait_binlog_name and
+ trx_wait_binlog_pos are set but the 'Entry' object is not present. Hence
+ dump thread will not wait for reply from slave and it will not update
+ reply_file_name. In such case the committing transaction should not wait
+ for an ack from slave and it should be considered as an async
+ transaction.
+ */
+ if (!entry)
+ {
+ is_semi_sync_trans= false;
+ goto l_end;
+ }
/* Let us update the info about the minimum binlog position of waiting
* threads.
l_end:
/* Update the status counter. */
- if (is_on())
+ if (is_on() && is_semi_sync_trans)
rpl_semi_sync_master_yes_transactions++;
else
rpl_semi_sync_master_no_transactions++;
--- /dev/null
+# 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
+
+MYSQL_ADD_PLUGIN(test_udf_services test_udf_services.cc MODULE_ONLY)
--- /dev/null
+/* 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 */
+
+#include <my_global.h>
+#include <mysql_version.h>
+#include <mysql/plugin.h>
+#include <mysql_com.h>
+
+/**
+ @file test_udf_services.cc
+
+ This is a test suite plugin to verify that plugins can co-exist with UDFs.
+ The file defines one DAEMON plugin @ref test_udf_services_plugin and one
+ UDF function: @ref test_udf_services_udf.
+ The test then checks if the plugin can be unloaded and loaded while the
+ UDF is defined.
+
+ No user-facing functionality in this plugin. Just test material !
+*/
+
+static struct st_mysql_daemon test_udf_services_plugin=
+{ MYSQL_DAEMON_INTERFACE_VERSION };
+
+mysql_declare_plugin(test_udf_services)
+{
+ MYSQL_DAEMON_PLUGIN,
+ &test_udf_services_plugin,
+ "test_udf_services",
+ "Georgi Kodinov",
+ "MySQL mtr test framework",
+ PLUGIN_LICENSE_GPL,
+ NULL, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100, /* Plugin version: 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ NULL, /* config options */
+ 0, /* flags */
+}
+mysql_declare_plugin_end;
+
+#ifdef WIN32
+#define PLUGIN_EXPORT extern "C" __declspec(dllexport)
+#else
+#define PLUGIN_EXPORT extern "C"
+#endif
+
+
+/**
+ Initialization function for @ref test_udf_services_udf
+
+ Must be present otherwise the server refuses to load
+
+ @param initrd Return value from xxxx_init
+ @param args Array of arguments
+ @param[out] message Error message in case of error.
+ @retval FALSE success
+ @retval TRUE Failure. Error in the message argument
+*/
+PLUGIN_EXPORT my_bool
+test_udf_services_udf_init(UDF_INIT *initid MY_ATTRIBUTE((unused)),
+ UDF_ARGS *args MY_ATTRIBUTE((unused)),
+ char *message MY_ATTRIBUTE((unused)))
+{
+ return FALSE;
+}
+
+
+/**
+ A UDF function returning 0.
+
+ @param initrd Return value from xxxx_init
+ @param args Array of arguments
+ @param[out] is_null If the result is null, store 1 here
+ @param[out] error On error store 1 here
+*/
+PLUGIN_EXPORT longlong
+test_udf_services_udf(UDF_INIT *initid MY_ATTRIBUTE((unused)),
+ UDF_ARGS *args MY_ATTRIBUTE((unused)),
+ char *is_null MY_ATTRIBUTE((unused)),
+ char *error MY_ATTRIBUTE((unused)))
+{
+ char buffer[10];
+ *is_null= 0;
+ *error= 0;
+ /* use a plugin service function */
+ my_snprintf(buffer, sizeof(buffer), "test");
+ return 0;
+}
This file was modified by Oracle on 2015-05-18 for 32-bit compatibility.
- Modifications copyright (c) 2015, Oracle and/or its affiliates. All rights
+ Modifications copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights
reserved. */
#include <my_global.h>
*/
static void
mcinvert(p, cs)
- register struct parse *p __attribute__((unused));
- register cset *cs __attribute__((unused));
+ register struct parse *p MY_ATTRIBUTE((unused));
+ register cset *cs MY_ATTRIBUTE((unused));
{
assert(cs->multis == NULL); /* xxx */
}
*/
static void
mccase(p, cs)
-register struct parse *p __attribute__((unused));
-register cset *cs __attribute__((unused));
+register struct parse *p MY_ATTRIBUTE((unused));
+register cset *cs MY_ATTRIBUTE((unused));
{
assert(cs->multis == NULL); /* xxx */
}
if (argc > 4)
for (n = atoi(argv[3]); n > 0; n--) {
+ if(sizeof(buf)-1 < strlen(argv[1]))
+ {
+ exit(EXIT_FAILURE);
+ }
(void) strcpy(buf, argv[1]);
}
else if (argc > 3)
for (n = atoi(argv[3]); n > 0; n--) {
+ if(sizeof(buf)-1 < strlen(argv[1]))
+ {
+ exit(EXIT_FAILURE);
+ }
(void) strcpy(buf, argv[1]);
(void) split(buf, fields, MNF, argv[2]);
}
-# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
STRING(REPLACE "-pipe" "" CXXFLAGS "${CXXFLAGS}")
IF(UNIX)
- # FIND_PROC and CHECK_PID are used by mysqld_safe
+ # SHELL_PATH, FIND_PROC, CHECK_PID are used by mysqld_safe
+IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
+ SET (SHELL_PATH "/bin/bash")
+ELSE()
+ SET (SHELL_PATH "/bin/sh")
+ENDIF()
+
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET (FIND_PROC
"ps wwwp $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
#!/usr/bin/perl
-# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
my ($command) = @_;
my (@paths, $path);
- return $command if (-f $command && -x $command);
+ # If the argument is not 'my_print_defaults' then it would be of the format
+ # <absolute_path>/<program>
+ return $command if ($command ne 'my_print_defaults' && -f $command &&
+ -x $command);
+
@paths = split(':', $ENV{'PATH'});
foreach $path (@paths)
{
-#!/bin/sh
+#!@SHELL_PATH@
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
#
echo "$msg"
case $logging in
init) ;; # Just echo the message, don't save it anywhere
- file) echo "$msg" >> "$err_log" ;;
+ file)
+ if [ -w / -o "$USER" = "root" ]; then
+ true
+ else
+ echo "$msg" >> "$err_log"
+ fi
+ ;;
syslog) logger -t "$syslog_tag_mysqld_safe" -p "$priority" "$*" ;;
*)
echo "Internal program error (non-fatal):" \
eval_log_error () {
local cmd="$1"
case $logging in
- file) cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" ;;
+ file)
+ if [ -w / -o "$USER" = "root" ]; then
+ cmd="$cmd > /dev/null 2>&1"
+ else
+ cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1"
+ fi
+ ;;
syslog)
# mysqld often prefixes its messages with a timestamp, which is
# redundant when logging to syslog (which adds its own timestamp)
# mysqld_safe-specific options - must be set in my.cnf ([mysqld_safe])!
--core-file-size=*) core_file_size="$val" ;;
- --ledir=*) ledir="$val" ;;
+ --ledir=*)
+ if [ -z "$pick_args" ]; then
+ log_error "--ledir option can only be used as command line option, found in config file"
+ exit 1
+ fi
+ ledir="$val"
+ ;;
--malloc-lib=*) set_malloc_lib "$val" ;;
- --mysqld=*) MYSQLD="$val" ;;
+ --mysqld=*)
+ if [ -z "$pick_args" ]; then
+ log_error "--mysqld option can only be used as command line option, found in config file"
+ exit 1
+ fi
+ MYSQLD="$val" ;;
--mysqld-version=*)
+ if [ -z "$pick_args" ]; then
+ log_error "--mysqld-version option can only be used as command line option, found in config file"
+ exit 1
+ fi
if test -n "$val"
then
MYSQLD="mysqld-$val"
echo "$text"
}
-
-mysql_config=
-get_mysql_config() {
- if [ -z "$mysql_config" ]; then
- mysql_config=`echo "$0" | sed 's,/[^/][^/]*$,/mysql_config,'`
- if [ ! -x "$mysql_config" ]; then
- log_error "Can not run mysql_config $@ from '$mysql_config'"
- exit 1
- fi
- fi
-
- "$mysql_config" "$@"
-}
-
-
# set_malloc_lib LIB
# - If LIB is empty, do nothing and return
-# - If LIB is 'tcmalloc', look for tcmalloc shared library in /usr/lib
-# then pkglibdir. tcmalloc is part of the Google perftools project.
+# - If LIB is 'tcmalloc', look for tcmalloc shared library in $malloc_dirs.
+# tcmalloc is part of the Google perftools project.
# - If LIB is an absolute path, assume it is a malloc shared library
#
# Put LIB in mysqld_ld_preload, which will be added to LD_PRELOAD when
# running mysqld. See ld.so for details.
set_malloc_lib() {
+ # This list is kept intentionally simple.
+ malloc_dirs="/usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu"
malloc_lib="$1"
if [ "$malloc_lib" = tcmalloc ]; then
- pkglibdir=`get_mysql_config --variable=pkglibdir`
malloc_lib=
- # This list is kept intentionally simple. Simply set --malloc-lib
- # to a full path if another location is desired.
- for libdir in /usr/lib "$pkglibdir" "$pkglibdir/mysql"; do
+ for libdir in `echo $malloc_dirs`; do
for flavor in _minimal '' _and_profiler _debug; do
tmp="$libdir/libtcmalloc$flavor.so"
#log_notice "DEBUG: Checking for malloc lib '$tmp'"
done
if [ -z "$malloc_lib" ]; then
- log_error "no shared library for --malloc-lib=tcmalloc found in /usr/lib or $pkglibdir"
+ log_error "no shared library for --malloc-lib=tcmalloc found in $malloc_dirs"
exit 1
fi
fi
case "$malloc_lib" in
/*)
if [ ! -r "$malloc_lib" ]; then
- log_error "--malloc-lib '$malloc_lib' can not be read and will not be used"
+ log_error "--malloc-lib can not be read and will not be used"
exit 1
fi
+
+ # Restrict to a the list in $malloc_dirs above
+ case "`dirname "$malloc_lib"`" in
+ /usr/lib) ;;
+ /usr/lib64) ;;
+ /usr/lib/i386-linux-gnu) ;;
+ /usr/lib/x86_64-linux-gnu) ;;
+ *)
+ log_error "--malloc-lib must be located in one of the directories: $malloc_dirs"
+ exit 1
+ ;;
+ esac
;;
*)
log_error "--malloc-lib must be an absolute path or 'tcmalloc'; " \
relpkgdata='@pkgdatadir@'
fi
-MY_PWD=`pwd`
+case "$0" in
+ /*)
+ MY_PWD='@prefix@'
+ ;;
+ *)
+ MY_PWD=`dirname $0`
+ MY_PWD=`dirname $MY_PWD`
+ ;;
+esac
# Check for the directories we would expect from a binary release install
if test -n "$MY_BASEDIR_VERSION" -a -d "$MY_BASEDIR_VERSION"
then
fi
# Log to err_log file
- log_notice "Logging to '$err_log'."
logging=file
-
- if [ ! -f "$err_log" ]; then # if error log already exists,
- touch "$err_log" # we just append. otherwise,
- chmod "$fmode" "$err_log" # fix the permissions here!
- fi
-
else
if [ -n "$syslog_tag" ]
then
logging=syslog
fi
+logdir=`dirname "$err_log"`
+# Change the err log to the right user, if possible and it is in use
+if [ $logging = "file" -o $logging = "both" ]; then
+ if [ ! -f "$err_log" -a ! -h "$err_log" ]; then
+ if test -w / -o "$USER" = "root"; then
+ case $logdir in
+ /var/log)
+ (
+ umask 0137
+ set -o noclobber
+ > "$err_log" && chown $user "$err_log"
+ ) ;;
+ *) ;;
+ esac
+ else
+ (
+ umask 0137
+ set -o noclobber
+ > "$err_log"
+ )
+ fi
+ fi
+
+ if [ -f "$err_log" ]; then # Log to err_log file
+ log_notice "Logging to '$err_log'."
+ elif [ "x$user" = "xroot" ]; then # running as root, mysqld can create log file; continue
+ echo "Logging to '$err_log'." >&2
+ else
+ case $logdir in
+ # We can't create $err_log, however mysqld can; continue
+ /tmp|/var/tmp|/var/log/mysql|$DATADIR)
+ echo "Logging to '$err_log'." >&2
+ ;;
+ # We can't create $err_log and don't know if mysqld can; error out
+ *)
+ log_error "error: log-error set to '$err_log', however file don't exists. Create writable for user '$user'."
+ exit 1
+ ;;
+ esac
+ fi
+fi
+
USER_OPTION=""
if test -w / -o "$USER" = "root"
then
then
USER_OPTION="--user=$user"
fi
- # Change the err log to the right user, if it is in use
- if [ $want_syslog -eq 0 ]; then
- touch "$err_log"
- chown $user "$err_log"
- fi
if test -n "$open_files"
then
ulimit -n $open_files
fi
safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
-# Make sure that directory for $safe_mysql_unix_port exists
+# Check that directory for $safe_mysql_unix_port exists
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
if [ ! -d $mysql_unix_port_dir ]
then
- mkdir $mysql_unix_port_dir
- chown $user $mysql_unix_port_dir
- chmod 755 $mysql_unix_port_dir
+ log_error "Directory '$mysql_unix_port_dir' for UNIX socket file don't exists."
+ exit 1
fi
# If the user doesn't specify a binary, we assume name "mysqld"
exit 1
fi
fi
- rm -f "$pid_file"
+ if [ ! -h "$pid_file" ]; then
+ rm -f "$pid_file"
+ fi
if test -f "$pid_file"
then
log_error "Fatal error: Can't remove the pid file:
while true
do
- rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety
+ # Some extra safety
+ if [ ! -h "$safe_mysql_unix_port" ]; then
+ rm -f "$safe_mysql_unix_port"
+ fi
+ if [ ! -h "$pid_file" ]; then
+ rm -f "$pid_file"
+ fi
start_time=`date +%M%S`
eval_log_error "$cmd $wsrep_start_position_opt --wsrep_cluster_address=$url $nohup_redir"
fi
- if [ $want_syslog -eq 0 -a ! -f "$err_log" ]; then
- touch "$err_log" # hypothetical: log was renamed but not
- chown $user "$err_log" # flushed yet. we'd recreate it with
- chmod "$fmode" "$err_log" # wrong owner next time we log, so set
- fi # it up correctly while we can!
+ # hypothetical: log was renamed but not
+ # flushed yet. we'd recreate it with
+ # wrong owner next time we log, so set
+ # it up correctly while we can!
+
+ if [ $want_syslog -eq 0 -a ! -f "$err_log" -a ! -h "$err_log" ]; then
+ if test -w / -o "$USER" = "root"; then
+ logdir=`dirname "$err_log"`
+ case $logdir in
+ /var/log)
+ (
+ umask 0137
+ set -o noclobber
+ > "$err_log" && chown $user "$err_log"
+ ) ;;
+ *) ;;
+ esac
+ else
+ (
+ umask 0137
+ set -o noclobber
+ > "$err_log"
+ )
+ fi
+ fi
end_time=`date +%M%S`
} while(0)
#endif
+static char *set_ssl_option_unpack_path(struct st_mysql_options *options,
+ const char *arg)
+{
+ char *opt_var= NULL;
+ if (arg)
+ {
+ char *buff= (char *)my_malloc(FN_REFLEN + 1, MYF(MY_WME));
+ unpack_filename(buff, (char *)arg);
+ opt_var= my_strdup(buff, MYF(MY_WME));
+ options->use_ssl= 1;
+ my_free(buff);
+ }
+ return opt_var;
+}
+
+
void mysql_read_default_options(struct st_mysql_options *options,
const char *filename,const char *group)
{
#define strdup_if_not_null(A) (A) == 0 ? 0 : my_strdup((A),MYF(MY_WME))
my_bool STDCALL
-mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
- const char *key __attribute__((unused)),
- const char *cert __attribute__((unused)),
- const char *ca __attribute__((unused)),
- const char *capath __attribute__((unused)),
- const char *cipher __attribute__((unused)))
+mysql_ssl_set(MYSQL *mysql MY_ATTRIBUTE((unused)) ,
+ const char *key MY_ATTRIBUTE((unused)),
+ const char *cert MY_ATTRIBUTE((unused)),
+ const char *ca MY_ATTRIBUTE((unused)),
+ const char *capath MY_ATTRIBUTE((unused)),
+ const char *cipher MY_ATTRIBUTE((unused)))
{
my_bool result= 0;
DBUG_ENTER("mysql_ssl_set");
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
static void
-mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
+mysql_ssl_free(MYSQL *mysql MY_ATTRIBUTE((unused)))
{
struct st_VioSSLFd *ssl_fd= (struct st_VioSSLFd*) mysql->connector_fd;
DBUG_ENTER("mysql_ssl_free");
*/
const char * STDCALL
-mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
+mysql_get_ssl_cipher(MYSQL *mysql MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("mysql_get_ssl_cipher");
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
should also be reflected there.
*/
-void mysql_detach_stmt_list(LIST **stmt_list __attribute__((unused)),
- const char *func_name __attribute__((unused)))
+void mysql_detach_stmt_list(LIST **stmt_list MY_ATTRIBUTE((unused)),
+ const char *func_name MY_ATTRIBUTE((unused)))
{
#ifdef MYSQL_CLIENT
/* Reset connection handle in all prepared statements. */
case MYSQL_DEFAULT_AUTH:
EXTENSION_SET_STRING(&mysql->options, default_auth, arg);
break;
- case MYSQL_OPT_SSL_KEY: SET_SSL_OPTION(ssl_key, arg); break;
- case MYSQL_OPT_SSL_CERT: SET_SSL_OPTION(ssl_cert, arg); break;
- case MYSQL_OPT_SSL_CA: SET_SSL_OPTION(ssl_ca, arg); break;
- case MYSQL_OPT_SSL_CAPATH: SET_SSL_OPTION(ssl_capath, arg); break;
+ case MYSQL_OPT_SSL_KEY:
+ if (mysql->options.ssl_key)
+ my_free(mysql->options.ssl_key);
+ mysql->options.ssl_key= set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
+ case MYSQL_OPT_SSL_CERT:
+ if (mysql->options.ssl_cert)
+ my_free(mysql->options.ssl_cert);
+ mysql->options.ssl_cert= set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
+ case MYSQL_OPT_SSL_CA:
+ if (mysql->options.ssl_ca)
+ my_free(mysql->options.ssl_ca);
+ mysql->options.ssl_ca= set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
+ case MYSQL_OPT_SSL_CAPATH:
+ if (mysql->options.ssl_capath)
+ my_free(mysql->options.ssl_capath);
+ mysql->options.ssl_capath= set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
case MYSQL_OPT_SSL_CIPHER: SET_SSL_OPTION(ssl_cipher, arg); break;
- case MYSQL_OPT_SSL_CRL: EXTENSION_SET_SSL_STRING(&mysql->options,
- ssl_crl, arg);
- break;
- case MYSQL_OPT_SSL_CRLPATH: EXTENSION_SET_SSL_STRING(&mysql->options,
- ssl_crlpath, arg);
- break;
+ case MYSQL_OPT_SSL_CRL:
+ if (mysql->options.extension)
+ my_free(mysql->options.extension->ssl_crl);
+ else
+ ALLOCATE_EXTENSIONS(&mysql->options);
+ mysql->options.extension->ssl_crl=
+ set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
+ case MYSQL_OPT_SSL_CRLPATH:
+ if (mysql->options.extension)
+ my_free(mysql->options.extension->ssl_crlpath);
+ else
+ ALLOCATE_EXTENSIONS(&mysql->options);
+ mysql->options.extension->ssl_crlpath=
+ set_ssl_option_unpack_path(&mysql->options, arg);
+ break;
case MYSQL_SERVER_PUBLIC_KEY:
EXTENSION_SET_STRING(&mysql->options, server_public_key_path, arg);
break;
*/
uchar *
get_attr_key(LEX_STRING *part, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= part[0].length;
return (uchar *) part[0].str;
return res ? CR_ERROR : CR_OK;
}
+
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
+
+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
+
+void STDCALL symver16_mysql_close(MYSQL *mysql)
+{
+ return mysql_close(mysql);
+}
+SYM_16(mysql_close);
+
+
+uint STDCALL symver16_mysql_errno(MYSQL *mysql)
+{
+ return mysql_errno(mysql);
+}
+SYM_16(mysql_errno);
+
+
+const char * STDCALL symver16_mysql_error(MYSQL *mysql)
+{
+ return mysql_error(mysql);
+}
+SYM_16(mysql_error);
+
+
+ulong * STDCALL symver16_mysql_fetch_lengths(MYSQL_RES *res)
+{
+ return mysql_fetch_lengths(res);
+}
+SYM_16(mysql_fetch_lengths);
+
+
+MYSQL_ROW STDCALL symver16_mysql_fetch_row(MYSQL_RES *res)
+{
+ return mysql_fetch_row(res);
+}
+SYM_16(mysql_fetch_row);
+
+
+void STDCALL symver16_mysql_free_result(MYSQL_RES *result)
+{
+ return mysql_free_result(result);
+}
+SYM_16(mysql_free_result);
+
+
+ulong STDCALL symver16_mysql_get_server_version(MYSQL *mysql)
+{
+ return mysql_get_server_version(mysql);
+}
+SYM_16(mysql_get_server_version);
+
+
+const char * STDCALL symver16_mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
+{
+ return mysql_get_ssl_cipher(mysql);
+}
+SYM_16(mysql_get_ssl_cipher);
+
+
+MYSQL * STDCALL symver16_mysql_init(MYSQL *mysql)
+{
+ return mysql_init(mysql);
+}
+SYM_16(mysql_init);
+
+
+unsigned int STDCALL symver16_mysql_num_fields(MYSQL_RES *res)
+{
+ return mysql_num_fields(res);
+}
+SYM_16(mysql_num_fields);
+
+
+my_ulonglong STDCALL symver16_mysql_num_rows(MYSQL_RES *res)
+{
+ return mysql_num_rows(res);
+}
+SYM_16(mysql_num_rows);
+
+
+int STDCALL symver16_mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
+{
+ return mysql_options(mysql, option, arg);
+}
+SYM_16(mysql_options);
+
+
+int STDCALL symver16_mysql_real_query(MYSQL *mysql, const char *query, ulong length)
+{
+ return mysql_real_query(mysql, query, length);
+}
+SYM_16(mysql_real_query);
+
+
+int STDCALL symver16_mysql_select_db(MYSQL *mysql, const char *db)
+{
+ return mysql_select_db(mysql, db);
+}
+SYM_16(mysql_select_db);
+
+
+int STDCALL symver16_mysql_send_query(MYSQL* mysql, const char* query, ulong length)
+{
+ return mysql_send_query(mysql, query, length);
+}
+SYM_16(mysql_send_query);
+
+
+int STDCALL symver16_mysql_set_character_set(MYSQL *mysql, const char *cs_name)
+{
+ return mysql_set_character_set(mysql, cs_name);
+}
+SYM_16(mysql_set_character_set);
+
+
+my_bool STDCALL symver16_mysql_ssl_set(MYSQL *mysql __attribute__((unused)), const char *key __attribute__((unused)), const char *cert __attribute__((unused)), const char *ca __attribute__((unused)), const char *capath __attribute__((unused)), const char *cipher __attribute__((unused)))
+{
+ return mysql_ssl_set(mysql, key, cert, ca, capath, cipher);
+}
+SYM_16(mysql_ssl_set);
+
+
+MYSQL_RES * STDCALL symver16_mysql_store_result(MYSQL *mysql)
+{
+ return mysql_store_result(mysql);
+}
+SYM_16(mysql_store_result);
+
+#endif
+#endif /* EXPORT_SYMVER16 */
-/* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@param tm[OUT] The value to set.
@param time_type Timestasmp type
*/
-inline void set_zero_time(MYSQL_TIME *tm,
- enum enum_mysql_timestamp_type time_type)
+void set_zero_time(MYSQL_TIME *tm,
+ enum enum_mysql_timestamp_type time_type)
{
memset(tm, 0, sizeof(*tm));
tm->time_type= time_type;
Set hour, minute and second of a MYSQL_TIME variable to maximum time value.
Unlike set_max_time(), does not touch the other structure members.
*/
-inline void set_max_hhmmss(MYSQL_TIME *tm)
+void set_max_hhmmss(MYSQL_TIME *tm)
{
tm->hour= TIME_MAX_HOUR;
tm->minute= TIME_MAX_MINUTE;
@retval TRUE if the value is fatally bad.
@retval FALSE if the value is Ok.
*/
-inline my_bool check_time_mmssff_range(const MYSQL_TIME *ltime)
+my_bool check_time_mmssff_range(const MYSQL_TIME *ltime)
{
return ltime->minute >= 60 || ltime->second >= 60 ||
ltime->second_part > 999999;
@retval FALSE if value is Ok.
@retval TRUE if value is out of range.
*/
-inline my_bool check_time_range_quick(const MYSQL_TIME *ltime)
+my_bool check_time_range_quick(const MYSQL_TIME *ltime)
{
longlong hour= (longlong) ltime->hour + 24LL * ltime->day;
/* The input value should not be fatally bad */
-/* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
gtid_before_write_cache(thd, cache_data))
goto err;
+#ifdef WITH_WSREP
+ if (WSREP_ON && thd->slave_thread) thd->wsrep_replicate_GTID= true;
+#endif /* WITH_WSREP */
ret= mysql_bin_log.commit(thd, true);
err:
{
DBUG_ENTER("binlog_rollback");
int error= 0;
+#ifdef WITH_WSREP
+ if (thd->lex->sql_command == SQLCOM_ROLLBACK_TO_SAVEPOINT &&
+ thd->wsrep_conflict_state != ABORTING)
+#else
if (thd->lex->sql_command == SQLCOM_ROLLBACK_TO_SAVEPOINT)
+#endif
error= mysql_bin_log.rollback(thd, all);
DBUG_RETURN(error);
}
the caches since this function is called as part of the engine
rollback.
*/
+#ifdef WITH_WSREP
+ if (thd->lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT ||
+ thd->wsrep_conflict_state == ABORTING)
+#else
if (thd->lex->sql_command != SQLCOM_ROLLBACK_TO_SAVEPOINT)
+#endif /* WITH_WSREP */
if ((error= ha_rollback_low(thd, all)))
goto end;
This function checks if a transactional table was updated by the
current statement.
- @param thd The client thread that executed the current statement.
+ @param ha_list Registered storage engine handler list.
@return
@c true if a transactional table was updated, @c false otherwise.
*/
bool
-stmt_has_updated_trans_table(const THD *thd)
+stmt_has_updated_trans_table(Ha_trx_info* ha_list)
{
Ha_trx_info *ha_info;
- for (ha_info= thd->transaction.stmt.ha_list; ha_info;
- ha_info= ha_info->next())
+ for (ha_info= ha_list; ha_info; ha_info= ha_info->next())
{
if (ha_info->is_trx_read_write() && ha_info->ht() != binlog_hton)
return (TRUE);
if (mysql_file_close(index_file.file, MYF(0)) < 0)
{
error= -1;
- sql_print_error("MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file "
- "failed to close the index file.");
- goto err;
+ sql_print_error("While rebuilding index file %s: "
+ "Failed to close the index file.", index_file_name);
+ /*
+ Delete Crash safe index file here and recover the binlog.index
+ state(index_file io_cache) from old binlog.index content.
+ */
+ mysql_file_delete(key_file_binlog_index, crash_safe_index_file_name,
+ MYF(0));
+
+ goto recoverable_err;
+ }
+ if (DBUG_EVALUATE_IF("force_index_file_delete_failure", 1, 0) ||
+ mysql_file_delete(key_file_binlog_index, index_file_name, MYF(MY_WME)))
+ {
+ error= -1;
+ sql_print_error("While rebuilding index file %s: "
+ "Failed to delete the existing index file. It could be "
+ "that file is being used by some other process.",
+ index_file_name);
+ /*
+ Delete Crash safe file index file here and recover the binlog.index
+ state(index_file io_cache) from old binlog.index content.
+ */
+ mysql_file_delete(key_file_binlog_index, crash_safe_index_file_name,
+ MYF(0));
+
+ goto recoverable_err;
}
- mysql_file_delete(key_file_binlog_index, index_file_name, MYF(MY_WME));
}
DBUG_EXECUTE_IF("crash_create_before_rename_index_file", DBUG_SUICIDE(););
if (my_rename(crash_safe_index_file_name, index_file_name, MYF(MY_WME)))
{
error= -1;
- sql_print_error("MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file "
- "failed to move crash_safe_index_file to index file.");
- goto err;
+ sql_print_error("While rebuilding index file %s: "
+ "Failed to rename the new index file to the existing "
+ "index file.", index_file_name);
+ goto fatal_err;
}
DBUG_EXECUTE_IF("crash_create_after_rename_index_file", DBUG_SUICIDE(););
+recoverable_err:
if ((fd= mysql_file_open(key_file_binlog_index,
index_file_name,
O_RDWR | O_CREAT | O_BINARY,
mysql_file_seek(fd, 0L, MY_SEEK_END, MYF(0)),
0, MYF(MY_WME | MY_WAIT_IF_FULL)))
{
- error= -1;
- sql_print_error("MYSQL_BIN_LOG::move_crash_safe_index_file_to_index_file "
- "failed to open the index file.");
- goto err;
+ sql_print_error("After rebuilding the index file %s: "
+ "Failed to open the index file.", index_file_name);
+ goto fatal_err;
}
-err:
if (need_lock_index)
mysql_mutex_unlock(&LOCK_index);
DBUG_RETURN(error);
+
+fatal_err:
+ /*
+ This situation is very very rare to happen (unless there is some serious
+ memory related issues like OOM) and should be treated as fatal error.
+ Hence it is better to bring down the server without respecting
+ 'binlog_error_action' value here.
+ */
+ exec_binlog_error_action_abort("MySQL server failed to update the "
+ "binlog.index file's content properly. "
+ "It might not be in sync with available "
+ "binlogs and the binlog.index file state is in "
+ "unrecoverable state. Aborting the server.");
+ /*
+ Server is aborted in the above function.
+ This is dead code to make compiler happy.
+ */
+ DBUG_RETURN(error);
}
int error_index= 0, close_error_index= 0;
/* Read each entry from purge_index_file and delete the file. */
- if (is_inited_purge_index_file() &&
+ if (!error && is_inited_purge_index_file() &&
(error_index= purge_index_entry(thd, decrease_log_space, false/*need_lock_index=false*/)))
sql_print_error("MYSQL_BIN_LOG::purge_logs failed to process registered files"
" that would be purged.");
*check_purge= false;
- if (force_rotate || (my_b_tell(&log_file) >= (my_off_t) max_size))
+ if (DBUG_EVALUATE_IF("force_rotate", 1, 0) || force_rotate ||
+ (my_b_tell(&log_file) >= (my_off_t) max_size))
{
error= new_file_without_locking(NULL);
*check_purge= true;
*/
if (stuff_logged)
{
+#ifdef WITH_WSREP
+ if (WSREP_ON && thd->wsrep_replicate_GTID &&
+ wsrep_replicate_GTID(thd))
+ {
+ /* GTID replication failed */
+ DBUG_RETURN(RESULT_ABORTED);
+ }
+#endif /* WITH_WSREP */
if (ordered_commit(thd, all))
DBUG_RETURN(RESULT_INCONSISTENT);
}
If we need to rotate, we do it without commit error.
Otherwise the thd->commit_error will be possibly reset.
*/
- if (do_rotate && thd->commit_error == THD::CE_NONE)
+ if (DBUG_EVALUATE_IF("force_rotate", 1, 0) ||
+ (do_rotate && thd->commit_error == THD::CE_NONE))
{
/*
Do not force the rotate as several consecutive groups may
/* Pre-conditions */
#ifdef WITH_WSREP
DBUG_ASSERT(is_current_stmt_binlog_format_row() &&
- (WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open()));
+ (WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open()));
#else
DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open());
#endif /* WITH_WSREP */
return 0;
}
+#ifndef DBUG_OFF
+const char * get_locked_tables_mode_name(enum_locked_tables_mode locked_tables_mode)
+{
+ switch (locked_tables_mode)
+ {
+ case LTM_NONE:
+ return "LTM_NONE";
+ case LTM_LOCK_TABLES:
+ return "LTM_LOCK_TABLES";
+ case LTM_PRELOCKED:
+ return "LTM_PRELOCKED";
+ case LTM_PRELOCKED_UNDER_LOCK_TABLES:
+ return "LTM_PRELOCKED_UNDER_LOCK_TABLES";
+ default:
+ return "Unknown table lock mode";
+ }
+}
+#endif
+
+
/**
Decide on logging format to use for the statement and issue errors
or warnings as needed. The decision depends on the following
binlog by filtering rules.
*/
#ifdef WITH_WSREP
- if ((WSREP_EMULATE_BINLOG(this) ||
+ if ((WSREP_EMULATE_BINLOG_NNULL(this) ||
(mysql_bin_log.is_open() && (variables.option_bits & OPTION_BIN_LOG))) &&
!(WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_STMT &&
- !binlog_filter->db_ok(db)))
+ !binlog_filter->db_ok(db)))
#else
if (mysql_bin_log.is_open() && (variables.option_bits & OPTION_BIN_LOG) &&
!(variables.binlog_format == BINLOG_FORMAT_STMT &&
uint non_replicated_tables_count= 0;
#ifndef DBUG_OFF
{
- static const char *prelocked_mode_name[] = {
- "NON_PRELOCKED",
- "PRELOCKED",
- "PRELOCKED_UNDER_LOCK_TABLES",
- };
DBUG_PRINT("debug", ("prelocked_mode: %s",
- prelocked_mode_name[locked_tables_mode]));
+ get_locked_tables_mode_name(locked_tables_mode)));
}
#endif
limited to row-logging when binlog_format = STATEMENT
*/
#ifdef WITH_WSREP
- if (!WSREP(this) || wsrep_exec_mode == LOCAL_STATE)
+ if (!WSREP_NNULL(this) || wsrep_exec_mode == LOCAL_STATE)
{
#endif /* WITH_WSREP */
my_error((error= ER_BINLOG_STMT_MODE_AND_ROW_ENGINE), MYF(0), "");
THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
size_t needed,
bool is_transactional,
- RowsEventT *hint __attribute__((unused)),
+ RowsEventT *hint MY_ATTRIBUTE((unused)),
const uchar* extra_row_info)
{
DBUG_ENTER("binlog_prepare_pending_rows_event");
{
#ifdef WITH_WSREP
DBUG_ASSERT(is_current_stmt_binlog_format_row() &&
- ((WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open())));
+ ((WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open())));
#else
DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open());
#endif /* WITH_WSREP */
{
#ifdef WITH_WSREP
DBUG_ASSERT(is_current_stmt_binlog_format_row() &&
- ((WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open())));
+ ((WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open())));
#else
DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open());
#endif /* WITH_WSREP */
{
#ifdef WITH_WSREP
DBUG_ASSERT(is_current_stmt_binlog_format_row() &&
- ((WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open())));
+ ((WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open())));
#else
DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open());
#endif /* WITH_WSREP */
flushing anything (e.g., if we have explicitly locked tables).
*/
#ifdef WITH_WSREP
- if (!(WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open()))
+ if (!(WSREP_EMULATE_BINLOG_NNULL(this) || mysql_bin_log.is_open()))
#else
if (!mysql_bin_log.is_open())
#endif /* WITH_WSREP */
DBUG_PRINT("enter", ("qtype: %s query: '%s'",
show_query_type(qtype), query_arg));
#ifdef WITH_WSREP
- DBUG_ASSERT(query_arg && (WSREP_EMULATE_BINLOG(this)
- || mysql_bin_log.is_open()));
+ DBUG_ASSERT(query_arg && (WSREP_EMULATE_BINLOG_NNULL(this)
+ || mysql_bin_log.is_open()));
#else
DBUG_ASSERT(query_arg && mysql_bin_log.is_open());
#endif /* WITH_WSREP */
#ifndef BINLOG_H_INCLUDED
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/** Lock for protecting the queue. */
mysql_mutex_t m_lock;
- } __attribute__((aligned(CPU_LEVEL1_DCACHE_LINESIZE)));
+ } MY_ATTRIBUTE((aligned(CPU_LEVEL1_DCACHE_LINESIZE)));
public:
Stage_manager()
extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log;
bool trans_has_updated_trans_table(const THD* thd);
-bool stmt_has_updated_trans_table(const THD *thd);
+bool stmt_has_updated_trans_table(Ha_trx_info* ha_list);
bool ending_trans(THD* thd, const bool all);
bool ending_single_stmt_trans(THD* thd, const bool all);
bool trans_cannot_safely_rollback(const THD* thd);
/*
- Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int diff;
if ((diff= (int) (field_length - value->length())) > 0)
{
- bmove_upp((uchar*) value->ptr()+field_length,
- (uchar*) value->ptr()+value->length(),
- value->length());
- memset(const_cast<char*>(value->ptr()), '0', diff);
- value->length(field_length);
- (void) value->c_ptr_quick(); // Avoid warnings in purify
+ const bool error= value->realloc(field_length);
+ if (!error)
+ {
+ bmove_upp((uchar*) value->ptr()+field_length,
+ (uchar*) value->ptr()+value->length(),
+ value->length());
+ memset(const_cast<char*>(value->ptr()), '0', diff);
+ value->length(field_length);
+ }
}
}
*/
type_conversion_status
Field_num::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
longlong nr= TIME_to_ulonglong_round(ltime);
return store(ltime->neg ? -nr : nr, 0);
master's field size, @c false otherwise.
*/
bool Field::compatible_field_size(uint field_metadata,
- Relay_log_info *rli_arg __attribute__((unused)),
- uint16 mflags __attribute__((unused)),
+ Relay_log_info *rli_arg MY_ATTRIBUTE((unused)),
+ uint16 mflags MY_ATTRIBUTE((unused)),
int *order_var)
{
uint const source_size= pack_length_from_metadata(field_metadata);
*/
uchar *
Field::pack(uchar *to, const uchar *from, uint max_length,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint32 length= pack_length();
set_if_smaller(length, max_length);
*/
const uchar *
Field::unpack(uchar* to, const uchar *from, uint param_data,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint length=pack_length();
int from_type= 0;
Field *Field::new_field(MEM_ROOT *root, TABLE *new_table,
- bool keep_type __attribute__((unused)))
+ bool keep_type MY_ATTRIBUTE((unused)))
{
Field *tmp= clone(root);
if (tmp == NULL)
}
-String *Field_decimal::val_str(String *val_buffer __attribute__((unused)),
+String *Field_decimal::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
type_conversion_status
Field_new_decimal::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
my_decimal decimal_value;
return store_value(date2my_decimal(ltime, &decimal_value));
String *Field_new_decimal::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
my_decimal decimal_value;
@return @c true
*/
bool Field_new_decimal::compatible_field_size(uint field_metadata,
- Relay_log_info * __attribute__((unused)),
- uint16 mflags __attribute__((unused)),
+ Relay_log_info * MY_ATTRIBUTE((unused)),
+ uint16 mflags MY_ATTRIBUTE((unused)),
int *order_var)
{
uint const source_precision= (field_metadata >> 8U) & 0x00ff;
String *Field_tiny::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
const CHARSET_INFO *cs= &my_charset_numeric;
String *Field_short::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
const CHARSET_INFO *cs= &my_charset_numeric;
String *Field_medium::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
const CHARSET_INFO *cs= &my_charset_numeric;
}
String *Field_long::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
const CHARSET_INFO *cs= &my_charset_numeric;
String *Field_longlong::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
const CHARSET_INFO *cs= &my_charset_numeric;
uint length;
type_conversion_status
Field_real::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
double nr= TIME_to_double(ltime);
return store(ltime->neg ? -nr : nr);
String *Field_float::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
String *Field_double::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
type_conversion_status
Field_temporal_with_date::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_WRITE;
type_conversion_status error;
}
-void Field_timestamp::make_sort_key(uchar *to,uint length __attribute__((unused)))
+void Field_timestamp::make_sort_key(uchar *to,uint length MY_ATTRIBUTE((unused)))
{
#ifdef WORDS_BIGENDIAN
if (!table || !table->s->db_low_byte_first)
type_conversion_status
Field_time_common::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
/* Check if seconds or minutes are out of range */
if (ltime->second >= 60 || ltime->minute >= 60)
String *Field_time_common::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
MYSQL_TIME ltime;
type_conversion_status
Field_year::store_time(MYSQL_TIME *ltime,
- uint8 dec_arg __attribute__((unused)))
+ uint8 dec_arg MY_ATTRIBUTE((unused)))
{
if (ltime->time_type != MYSQL_TIMESTAMP_DATETIME &&
ltime->time_type != MYSQL_TIMESTAMP_DATE)
String *Field_year::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(field_length < 5);
val_buffer->alloc(5);
String *Field_newdate::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
val_buffer->alloc(field_length);
Using my_datetime_number_to_str() instead of my_datetime_to_str().
*/
String *Field_datetime::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
val_buffer->alloc(field_length + 1);
}
-String *Field_string::val_str(String *val_buffer __attribute__((unused)),
+String *Field_string::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
bool
Field_string::compatible_field_size(uint field_metadata,
Relay_log_info *rli_arg,
- uint16 mflags __attribute__((unused)),
+ uint16 mflags MY_ATTRIBUTE((unused)),
int *order_var)
{
#ifdef HAVE_REPLICATION
void Field_string::make_sort_key(uchar *to, uint length)
{
- uint tmp __attribute__((unused))=
+ uint tmp MY_ATTRIBUTE((unused))=
field_charset->coll->strnxfrm(field_charset,
to, length, char_length(),
ptr, field_length,
uchar *Field_string::pack(uchar *to, const uchar *from,
uint max_length,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint length= min(field_length,max_length);
uint local_char_length= max_length/field_charset->mbmaxlen;
Field_string::unpack(uchar *to,
const uchar *from,
uint param_data,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint from_length, length;
return result;
}
-String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
+String *Field_varstring::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
uchar *Field_varstring::pack(uchar *to, const uchar *from,
uint max_length,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint length= length_bytes == 1 ? (uint) *from : uint2korr(from);
set_if_smaller(max_length, field_length);
const uchar *
Field_varstring::unpack(uchar *to, const uchar *from,
uint param_data,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
uint length;
uint l_bytes= (param_data && (param_data < field_length)) ?
return my_strntoll(charset(),blob,length,10,NULL,¬_used);
}
-String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
+String *Field_blob::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
ASSERT_COLUMN_MARKED_FOR_READ;
}
-String *Field_enum::val_str(String *val_buffer __attribute__((unused)),
+String *Field_enum::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
String *val_ptr)
{
uint tmp=(uint) Field_enum::val_int();
String *Field_set::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ulonglong tmp=(ulonglong) Field_enum::val_int();
uint bitnr=0;
String *Field_bit::val_str(String *val_buffer,
- String *val_ptr __attribute__((unused)))
+ String *val_ptr MY_ATTRIBUTE((unused)))
{
ASSERT_COLUMN_MARKED_FOR_READ;
char buff[sizeof(longlong)];
*/
bool
Field_bit::compatible_field_size(uint field_metadata,
- Relay_log_info * __attribute__((unused)),
+ Relay_log_info * MY_ATTRIBUTE((unused)),
uint16 mflags,
int *order_var)
{
uchar *
Field_bit::pack(uchar *to, const uchar *from, uint max_length,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(max_length > 0);
uint length;
*/
const uchar *
Field_bit::unpack(uchar *to, const uchar *from, uint param_data,
- bool low_byte_first __attribute__((unused)))
+ bool low_byte_first MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("Field_bit::unpack");
DBUG_PRINT("enter", ("to: %p, from: %p, param_data: 0x%x",
#ifndef FIELD_INCLUDED
#define FIELD_INCLUDED
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return new Field_long(*this);
}
virtual uchar *pack(uchar* to, const uchar *from,
- uint max_length __attribute__((unused)),
+ uint max_length MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return pack_int32(to, from, low_byte_first);
}
virtual const uchar *unpack(uchar* to, const uchar *from,
- uint param_data __attribute__((unused)),
+ uint param_data MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return unpack_int32(to, from, low_byte_first);
return new Field_longlong(*this);
}
virtual uchar *pack(uchar* to, const uchar *from,
- uint max_length __attribute__((unused)),
+ uint max_length MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return pack_int64(to, from, low_byte_first);
}
virtual const uchar *unpack(uchar* to, const uchar *from,
- uint param_data __attribute__((unused)),
+ uint param_data MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return unpack_int64(to, from, low_byte_first);
return new Field_timestamp(*this);
}
uchar *pack(uchar *to, const uchar *from,
- uint max_length __attribute__((unused)), bool low_byte_first)
+ uint max_length MY_ATTRIBUTE((unused)), bool low_byte_first)
{
return pack_int32(to, from, low_byte_first);
}
const uchar *unpack(uchar* to, const uchar *from,
- uint param_data __attribute__((unused)),
+ uint param_data MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return unpack_int32(to, from, low_byte_first);
return new Field_datetime(*this);
}
uchar *pack(uchar* to, const uchar *from,
- uint max_length __attribute__((unused)), bool low_byte_first)
+ uint max_length MY_ATTRIBUTE((unused)), bool low_byte_first)
{
return pack_int64(to, from, low_byte_first);
}
const uchar *unpack(uchar* to, const uchar *from,
- uint param_data __attribute__((unused)),
+ uint param_data MY_ATTRIBUTE((unused)),
bool low_byte_first)
{
return unpack_int64(to, from, low_byte_first);
}
-static void do_skip(Copy_field *copy __attribute__((unused)))
+static void do_skip(Copy_field *copy MY_ATTRIBUTE((unused)))
{
}
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if (sort_field->need_strxnfrm)
{
char *from=(char*) res->ptr();
- uint tmp_length __attribute__((unused));
+ uint tmp_length MY_ATTRIBUTE((unused));
if ((uchar*) from == to)
{
DBUG_ASSERT(sort_field->length >= length);
/*
- Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
insert_sql_functions();
}
+struct hash_map_cleanup
+{
+ hash_map_cleanup(char **buffer, int *sz)
+ : m_buffer(buffer), m_sz(sz)
+ {}
+ ~hash_map_cleanup()
+ {
+ free(*m_buffer);
+ *m_buffer= NULL;
+ *m_sz= 0;
+ }
+ char **m_buffer;
+ int *m_sz;
+};
+
char *hash_map= 0;
int size_hash_map= 0;
void print_find_structs()
{
- add_structs_to_map(root_by_len,max_len);
- set_links(root_by_len,max_len);
- print_hash_map("sql_functions_map");
-
- hash_map= 0;
- size_hash_map= 0;
+ {
+ hash_map_cleanup cleanup(&hash_map, &size_hash_map);
+ add_structs_to_map(root_by_len,max_len);
+ set_links(root_by_len,max_len);
+ print_hash_map("sql_functions_map");
+ }
printf("\n");
- add_structs_to_map(root_by_len2,max_len2);
- set_links(root_by_len2,max_len2);
- print_hash_map("symbols_map");
+ {
+ hash_map_cleanup cleanup(&hash_map, &size_hash_map);
+ add_structs_to_map(root_by_len2,max_len2);
+ set_links(root_by_len2,max_len2);
+ print_hash_map("symbols_map");
+ }
}
int check_dup_symbols(SYMBOL *s1, SYMBOL *s2)
/*
- Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
pthread_handler_t
-ndb_index_stat_thread_func(void *arg __attribute__((unused)))
+ndb_index_stat_thread_func(void *arg MY_ATTRIBUTE((unused)))
{
THD *thd; /* needs to be first for thread_stack */
struct timespec abstime;
-/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
HASH ndbcluster_open_tables;
static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
- my_bool not_used __attribute__((unused)));
+ my_bool not_used MY_ATTRIBUTE((unused)));
static void modify_shared_stats(NDB_SHARE *share,
Ndb_local_table_statistics *local_stat);
} THD_NDB_SHARE;
static
uchar *thd_ndb_share_get_key(THD_NDB_SHARE *thd_ndb_share, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= sizeof(thd_ndb_share->key);
return (uchar*) &thd_ndb_share->key;
extern "C" uchar* tables_get_key(const char *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= strlen(entry);
return (uchar*) entry;
*/
static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= share->key_length;
return (uchar*) share->key;
/**
Utility thread main loop.
*/
-pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
+pthread_handler_t ndb_util_thread_func(void *arg MY_ATTRIBUTE((unused)))
{
THD *thd; /* needs to be first for thread_stack */
struct timespec abstime;
/*
- Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static uchar *
ndb_schema_objects_get_key(NDB_SCHEMA_OBJECT *schema_object,
size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= schema_object->key_length;
return (uchar*) schema_object->key;
/*
- Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return HA_CAN_PARTITION;
}
-static uint alter_table_flags(uint flags __attribute__((unused)))
+static uint alter_table_flags(uint flags MY_ATTRIBUTE((unused)))
{
return (HA_PARTITION_FUNCTION_SUPPORTED |
HA_FAST_CHANGE_PARTITION);
ulonglong * const copied,
ulonglong * const deleted,
const uchar *pack_frm_data
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
size_t pack_frm_len
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
List_iterator<partition_element> part_it(m_part_info->partitions);
List_iterator <partition_element> t_it(m_part_info->temp_partitions);
*/
static uchar *get_part_name(PART_NAME_DEF *part, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= part->length;
return part->partition_name;
DEBUG_SYNC(thd, "ha_commit_trans_after_acquire_commit_lock");
}
- if (rw_trans &&
+ if (rw_trans && stmt_has_updated_trans_table(ha_info) &&
opt_readonly &&
!(thd->security_ctx->master_access & SUPER_ACL) &&
!thd->slave_thread)
{ // cannot happen
my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), err);
error= 1;
+ WSREP_WARN("handlerton rollback failed, thd %lu %lld conf %d SQL %s",
+ thd->thread_id, thd->query_id, thd->wsrep_conflict_state,
+ thd->query());
}
status_var_increment(thd->status_var.ha_rollback_count);
ha_info_next= ha_info->next();
ha_rows DsMrr_impl::dsmrr_info(uint keyno, uint n_ranges, uint rows,
uint *bufsz, uint *flags, Cost_estimate *cost)
{
- ha_rows res __attribute__((unused));
+ ha_rows res MY_ATTRIBUTE((unused));
uint def_flags= *flags;
uint def_bufsz= *bufsz;
#ifdef WITH_WSREP
/* only InnoDB tables will be replicated through binlog emulation */
- if (WSREP_EMULATE_BINLOG(thd) &&
- table->file->ht->db_type != DB_TYPE_INNODB &&
- !(table->file->ht->db_type == DB_TYPE_PARTITION_DB &&
- (((ha_partition*)(table->file))->wsrep_db_type() == DB_TYPE_INNODB)))
- // !strcmp(table->file->table_type(), "InnoDB"))
+ if (WSREP_EMULATE_BINLOG(thd) &&
+ table->file->ht->db_type != DB_TYPE_INNODB &&
+ !(table->file->ht->db_type == DB_TYPE_PARTITION_DB &&
+ (((ha_partition*)(table->file))->wsrep_db_type() == DB_TYPE_INNODB)))
{
- return 0;
- }
+ return 0;
+ }
+
+ /* enforce wsrep_max_ws_rows */
+ if (table->s->tmp_table == NO_TMP_TABLE)
+ {
+ thd->wsrep_affected_rows++;
+ if (wsrep_max_ws_rows &&
+ thd->wsrep_exec_mode != REPL_RECV &&
+ thd->wsrep_affected_rows > wsrep_max_ws_rows)
+ {
+ trans_rollback_stmt(thd) || trans_rollback(thd);
+ my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
+ return ER_ERROR_DURING_COMMIT;
+ }
+ }
#endif /* WITH_WSREP */
if (check_table_binlog_row_based(thd, table))
{
*/
virtual int rnd_init(bool scan)= 0;
virtual int rnd_end() { return 0; }
- virtual int write_row(uchar *buf __attribute__((unused)))
+ virtual int write_row(uchar *buf MY_ATTRIBUTE((unused)))
{
return HA_ERR_WRONG_COMMAND;
}
the columns required for the error message are not read, the error
message will contain garbage.
*/
- virtual int update_row(const uchar *old_data __attribute__((unused)),
- uchar *new_data __attribute__((unused)))
+ virtual int update_row(const uchar *old_data MY_ATTRIBUTE((unused)),
+ uchar *new_data MY_ATTRIBUTE((unused)))
{
return HA_ERR_WRONG_COMMAND;
}
- virtual int delete_row(const uchar *buf __attribute__((unused)))
+ virtual int delete_row(const uchar *buf MY_ATTRIBUTE((unused)))
{
return HA_ERR_WRONG_COMMAND;
}
@return non-0 in case of failure, 0 in case of success.
When lock_type is F_UNLCK, the return value is ignored.
*/
- virtual int external_lock(THD *thd __attribute__((unused)),
- int lock_type __attribute__((unused)))
+ virtual int external_lock(THD *thd MY_ATTRIBUTE((unused)),
+ int lock_type MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
const struct sockaddr *ip= (const sockaddr *) ip_storage;
int err_code;
- bool err_status __attribute__((unused));
+ bool err_status MY_ATTRIBUTE((unused));
Host_errors errors;
DBUG_ENTER("ip_to_hostname");
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "my_global.h" /* ulong */
void unireg_init(ulong options);
-void unireg_end(void) __attribute__((noreturn));
+void unireg_end(void) MY_ATTRIBUTE((noreturn));
#endif /* INIT_INCLUDED */
*/
String *Item::val_str_ascii(String *str)
{
- if (!(collation.collation->state & MY_CS_NONASCII))
- return val_str(str);
-
DBUG_ASSERT(str != &str_value);
uint errors;
if (!res)
return 0;
- if ((null_value= str->copy(res->ptr(), res->length(),
- collation.collation, &my_charset_latin1,
- &errors)))
- return 0;
-
+ if (!(res->charset()->state & MY_CS_NONASCII))
+ str= res;
+ else
+ {
+ if ((null_value= str->copy(res->ptr(), res->length(), collation.collation,
+ &my_charset_latin1, &errors)))
+ return 0;
+ }
+
return str;
}
}
-table_map Item_field::resolved_used_tables() const
+bool Item_field::used_tables_for_level(uchar *arg)
{
- if (field->table->const_table)
- return 0; // const item
- return field->table->map;
+ // Used by resolver only, so can never reach a "const" table.
+ DBUG_ASSERT(!field->orig_table->const_table);
+ TABLE_LIST *tr= field->orig_table->pos_in_table_list;
+ Used_tables *const ut= (Used_tables *)(arg);
+
+ /*
+ When the qualifying query for the field (table_ref->select_lex) is the
+ same level as the requested level, add the table's map. When the qualifying
+ query for the field is outer relative to the requested level, add an outer
+ reference.
+ */
+ if (ut->select == tr->select_lex)
+ ut->used_tables|= tr->table->map;
+ else if (ut->select->nest_level > tr->select_lex->nest_level)
+ ut->used_tables|= OUTER_REF_TABLE_BIT;
+ return false;
}
void Item_ident::fix_after_pullout(st_select_lex *parent_select,
*/
Item_subselect *subq_predicate= child_select->master_unit()->item;
- subq_predicate->used_tables_cache|= this->resolved_used_tables();
+ Used_tables ut(depended_from);
+ (void) walk(&Item::used_tables_for_level, true, (uchar *)(&ut));
+ subq_predicate->used_tables_cache|= ut.used_tables;
subq_predicate->const_item_cache&= this->const_item();
}
}
static void
default_set_param_func(Item_param *param,
- uchar **pos __attribute__((unused)),
- ulong len __attribute__((unused)))
+ uchar **pos MY_ATTRIBUTE((unused)),
+ ulong len MY_ATTRIBUTE((unused)))
{
param->set_null();
}
if (found_field == view_ref_found)
{
Item::Type type= found_item->type();
- prev_subselect_item->used_tables_cache|=
- found_item->used_tables();
+ Used_tables ut(last_select);
+ (void) found_item->walk(&Item::used_tables_for_level, true,
+ (uchar *)(&ut));
+ prev_subselect_item->used_tables_cache|= ut.used_tables;
dependent= ((type == Item::REF_ITEM || type == Item::FIELD_ITEM) ?
(Item_ident*) found_item :
0);
else
{
Item::Type ref_type= (*reference)->type();
- prev_subselect_item->used_tables_cache|=
- (*reference)->used_tables();
+ Used_tables ut(select);
+ (void) (*reference)->walk(&Item::used_tables_for_level, true,
+ (uchar *)(&ut));
+ prev_subselect_item->used_tables_cache|= ut.used_tables;
prev_subselect_item->const_item_cache&=
(*reference)->const_item();
mark_as_dependent(thd, last_checked_context->select_lex,
}
}
};
+/**
+ Class used as argument to Item::walk() together with used_tables_for_level()
+*/
+class Used_tables
+{
+public:
+ explicit Used_tables(st_select_lex *select) :
+ select(select), used_tables(0)
+ {}
+
+ st_select_lex *const select; ///< Level for which data is accumulated
+ table_map used_tables; ///< Accumulated used tables data
+};
/*************************************************************************/
/* bit map of tables used by item */
virtual table_map used_tables() const { return (table_map) 0L; }
- /**
- Return used table information for the level this item is resolved on.
- - For fields, this returns the table the item is resolved from.
- - For all other items, this behaves like used_tables().
-
- @note: Use this function with caution. External calls to this function
- should only be made for class objects derived from Item_ident.
- Item::resolved_used_tables is for internal use only, in order to
- process fields underlying a view column reference.
- */
- virtual table_map resolved_used_tables() const
- {
- // As this is the level this item was resolved on, it cannot be outer:
- DBUG_ASSERT(!(used_tables() & OUTER_REF_TABLE_BIT));
-
- return used_tables();
- }
/*
Return table map of tables that can't be NULL tables (tables that are
used in a context where if they would contain a NULL row generated
virtual bool reset_query_id_processor(uchar *query_id_arg) { return 0; }
virtual bool find_item_processor(uchar *arg) { return this == (void *) arg; }
virtual bool register_field_in_read_map(uchar *arg) { return 0; }
+/**
+ Return used table information for the specified query block (level).
+ For a field that is resolved from this query block, return the table number.
+ For a field that is resolved from a query block outer to the specified one,
+ return OUTER_REF_TABLE_BIT
+
+ @param[in,out] arg pointer to an instance of class Used_tables, which is
+ constructed with the query block as argument.
+ The used tables information is accumulated in the field
+ used_tables in this class.
+
+ @note This function is used to update used tables information after
+ merging a query block (a subquery) with its parent.
+ */
+ virtual bool used_tables_for_level(uchar *arg) { return false; }
virtual bool inform_item_in_cond_of_tab(uchar *join_tab_index) { return false; }
/**
Clean up after removing the item from the item tree.
type_conversion_status save_in_field(Field *field,bool no_conversions);
void save_org_in_field(Field *field);
table_map used_tables() const;
- virtual table_map resolved_used_tables() const;
enum Item_result result_type () const
{
return field->result_type();
bool add_field_to_set_processor(uchar * arg);
bool remove_column_from_bitmap(uchar * arg);
bool find_item_in_field_list_processor(uchar *arg);
+ bool used_tables_for_level(uchar *arg);
bool register_field_in_read_map(uchar *arg);
bool check_partition_func_processor(uchar *int_arg) {return FALSE;}
void cleanup();
(*ref)->update_used_tables();
}
- virtual table_map resolved_used_tables() const
- { return (*ref)->resolved_used_tables(); }
-
table_map not_null_tables() const
{
/*
void set_used_tables(table_map map) { used_table_map= map; }
- virtual table_map resolved_used_tables() const
- {
- return example ? example->resolved_used_tables() : used_table_map;
- }
-
virtual bool allocate(uint i) { return 0; }
virtual bool setup(Item *item)
{
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
void Item_func::fix_after_pullout(st_select_lex *parent_select,
st_select_lex *removed_select)
{
+ if (const_item())
+ {
+ /*
+ Pulling out a const item changes nothing to it. Moreover, some items may
+ have decided that they're const by some other logic than the generic
+ one below, and we must preserve that decision.
+ */
+ return;
+ }
+
Item **arg,**arg_end;
used_tables_cache= get_initial_pseudo_tables();
};
uchar *ull_get_key(const User_level_lock *ull, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= ull->key_length;
return ull->key;
-/* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* String will not move */
str->copy(geom->get_class_info()->m_name.str,
geom->get_class_info()->m_name.length,
- default_charset());
+ &my_charset_latin1);
return str;
}
Gcalc_function func;
Gcalc_scan_iterator scan_it;
public:
- Item_func_distance(Item *a, Item *b): Item_real_func(a, b) {}
+ Item_func_distance(Item *a, Item *b): Item_real_func(a, b)
+ {
+ /*
+ Distance could be NULL, if either of the operands are
+ not geometries.
+ */
+ maybe_null= true;
+ }
+
+ void fix_length_and_dec()
+ {
+ Item_real_func::fix_length_and_dec();
+ maybe_null= true;
+ }
+
double val_real();
const char *func_name() const { return "st_distance"; }
};
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
rights reserved.
This program is free software; you can redistribute it and/or modify
*/
extern "C"
-int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
+int dump_leaf_key(void* key_arg, element_count count MY_ATTRIBUTE((unused)),
void* item_arg)
{
Item_func_group_concat *item= (Item_func_group_concat *) item_arg;
#ifndef ITEM_SUM_INCLUDED
#define ITEM_SUM_INCLUDED
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. reserved.
reserved.
This program is free software; you can redistribute it and/or modify
int group_concat_key_cmp_with_order(const void* arg, const void* key1,
const void* key2);
int dump_leaf_key(void* key_arg,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
void* item_arg);
C_MODE_END
const void* key1,
const void* key2);
friend int dump_leaf_key(void* key_arg,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
void* item_arg);
public:
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
time zone. Defines time zone (local) used for whole SYSDATE function.
*/
bool Item_func_sysdate_local::get_date(MYSQL_TIME *now_time,
- uint fuzzy_date __attribute__((unused)))
+ uint fuzzy_date MY_ATTRIBUTE((unused)))
{
THD *thd= current_thd;
ulonglong tmp= my_micro_time();
bool Item_func_from_unixtime::get_date(MYSQL_TIME *ltime,
- uint fuzzy_date __attribute__((unused)))
+ uint fuzzy_date MY_ATTRIBUTE((unused)))
{
lldiv_t lld;
if (decimals)
bool Item_func_convert_tz::get_date(MYSQL_TIME *ltime,
- uint fuzzy_date __attribute__((unused)))
+ uint fuzzy_date MY_ATTRIBUTE((unused)))
{
my_time_t my_time_tmp;
String str;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
+bool is_valid_log_name(const char *name, size_t len)
+{
+ if (len > 3)
+ {
+ const char *tail= name + len - 4;
+ if (my_strcasecmp(system_charset_info, tail, ".ini") == 0 ||
+ my_strcasecmp(system_charset_info, tail, ".cnf") == 0)
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+
+/**
+ Get the real log file name, and possibly reopen file.
+
+ Use realpath() to get the path with symbolic links
+ expanded. Then, close the file, and reopen the real path using the
+ O_NOFOLLOW flag. This will reject following symbolic links.
+
+ @param file File descriptor.
+ @param log_file_key Key for P_S instrumentation.
+ @param open_flags Flags to use for opening the file.
+ @param opened_file_name Name of the open fd.
+
+ @retval file descriptor to open file with 'real_file_name', or '-1'
+ in case of errors.
+*/
+
+#ifndef _WIN32
+static File mysql_file_real_name_reopen(File file,
+#ifdef HAVE_PSI_INTERFACE
+ PSI_file_key log_file_key,
+#endif
+ int open_flags,
+ const char *opened_file_name)
+{
+ DBUG_ASSERT(file);
+ DBUG_ASSERT(opened_file_name);
+
+ /* Buffer for realpath must have capacity for PATH_MAX. */
+ char real_file_name[PATH_MAX];
+
+ /* Get realpath, validate, open realpath with O_NOFOLLOW. */
+ if (realpath(opened_file_name, real_file_name) == NULL)
+ {
+ (void) mysql_file_close(file, MYF(0));
+ return -1;
+ }
+
+ if (mysql_file_close(file, MYF(0)))
+ return -1;
+
+ if (strlen(real_file_name) > FN_REFLEN)
+ return -1;
+
+ if (!is_valid_log_name(real_file_name, strlen(real_file_name)))
+ {
+ sql_print_error("Invalid log file name after expanding symlinks: '%s'",
+ real_file_name);
+ return -1;
+ }
+
+ return mysql_file_open(log_file_key, real_file_name,
+ open_flags | O_NOFOLLOW,
+ MYF(MY_WME | ME_WAITTANG));
+}
+#endif // _WIN32
+
+
/*
Open a (new) log file.
MYF(MY_WME | ME_WAITTANG))) < 0)
goto err;
+#ifndef _WIN32
+ /* Reopen and validate path. */
+ if ((log_type_arg == LOG_UNKNOWN || log_type_arg == LOG_NORMAL) &&
+ (file= mysql_file_real_name_reopen(file,
+#ifdef HAVE_PSI_INTERFACE
+ log_file_key,
+#endif
+ open_flags,
+ log_file_name)) < 0)
+ goto err;
+#endif // _WIN32
+
if ((pos= mysql_file_tell(file, MYF(MY_WME))) == MY_FILEPOS_ERROR)
{
if (my_errno == ESPIPE)
-/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
char *make_log_name(char *buff, const char *name, const char* log_ext);
+/**
+ Check given log name against certain blacklisted names/extensions.
+
+ @param name Log name to check
+ @param len Length of log name
+
+ @returns true if name is valid, false otherwise.
+*/
+bool is_valid_log_name(const char *name, size_t len);
+
extern LOGGER logger;
#endif /* LOG_H */
Ignore error code specified on command line.
*/
-inline int ignored_error_code(int err_code)
+int ignored_error_code(int err_code)
{
#ifdef HAVE_NDB_BINLOG
/*
void Log_event::print_header(IO_CACHE* file,
PRINT_EVENT_INFO* print_event_info,
- bool is_more __attribute__((unused)))
+ bool is_more MY_ATTRIBUTE((unused)))
{
char llbuff[22];
my_off_t hexdump_from= print_event_info->hexdump_from;
{
if (!rli->curr_group_seen_gtid && !rli->curr_group_seen_begin)
{
- ulong gaq_idx __attribute__((unused));
+ ulong gaq_idx MY_ATTRIBUTE((unused));
rli->mts_groups_assigned++;
rli->curr_group_isolated= FALSE;
if (cmd_can_generate_row_events)
{
cmd_must_go_to_trx_cache= cmd_must_go_to_trx_cache || using_trans;
- if (cmd_must_go_to_trx_cache || stmt_has_updated_trans_table(thd) ||
+ if (cmd_must_go_to_trx_cache ||
+ stmt_has_updated_trans_table(thd->transaction.stmt.ha_list) ||
thd->lex->is_mixed_stmt_unsafe(thd->in_multi_stmt_transaction_mode(),
thd->variables.binlog_direct_non_trans_update,
trans_has_updated_trans_table(thd),
int Rows_log_event::do_apply_event(Relay_log_info const *rli)
{
DBUG_ENTER("Rows_log_event::do_apply_event(Relay_log_info*)");
+ TABLE *table= NULL;
int error= 0;
if (opt_bin_log)
#endif
if (thd->is_slave_error || thd->is_fatal_error)
{
- /*
- Error reporting borrowed from Query_log_event with many excessive
- simplifications.
- We should not honour --slave-skip-errors at this point as we are
- having severe errors which should not be skiped.
- */
- rli->report(ERROR_LEVEL, actual_error,
- "Error executing row event: '%s'",
- (actual_error ? thd->get_stmt_da()->message() :
- "unexpected success or fatal error"));
- thd->is_slave_error= 1;
+ if (ignored_error_code(actual_error))
+ {
+ if (log_warnings > 1)
+ rli->report(WARNING_LEVEL, actual_error,
+ "Error executing row event: '%s'",
+ (actual_error ? thd->get_stmt_da()->message() :
+ "unexpected success or fatal error"));
+ thd->get_stmt_da()->clear_warning_info(thd->query_id);
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
+ error= 0;
+ goto end;
+ }
+ else
+ {
+ rli->report(ERROR_LEVEL, actual_error,
+ "Error executing row event: '%s'",
+ (actual_error ? thd->get_stmt_da()->message() :
+ "unexpected success or fatal error"));
+ thd->is_slave_error= 1;
+ const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
+ DBUG_RETURN(actual_error);
+ }
}
- const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
- DBUG_RETURN(actual_error);
}
-
/*
When the open and locking succeeded, we check all tables to
ensure that they still have the correct type.
-
- We can use a down cast here since we know that every table added
- to the tables_to_lock is a RPL_TABLE_LIST.
*/
{
NOTE: The base tables are added here are removed when
close_thread_tables is called.
*/
- RPL_TABLE_LIST *ptr= rli->tables_to_lock;
- for (uint i= 0 ; ptr && (i < rli->tables_to_lock_count);
- ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
+ TABLE_LIST *table_list_ptr= rli->tables_to_lock;
+ for (uint i=0 ; table_list_ptr && (i < rli->tables_to_lock_count);
+ table_list_ptr= table_list_ptr->next_global, i++)
{
+ /*
+ Below if condition takes care of skipping base tables that
+ make up the MERGE table (which are added by open_tables()
+ call). They are added next to the merge table in the list.
+ For eg: If RPL_TABLE_LIST is t3->t1->t2 (where t1 and t2
+ are base tables for merge table 't3'), open_tables will modify
+ the list by adding t1 and t2 again immediately after t3 in the
+ list (*not at the end of the list*). New table_to_lock list will
+ look like t3->t1'->t2'->t1->t2 (where t1' and t2' are TABLE_LIST
+ objects added by open_tables() call). There is no flag(or logic) in
+ open_tables() that can skip adding these base tables to the list.
+ So the logic here should take care of skipping them.
+
+ tables_to_lock_count logic will take care of skipping base tables
+ that are added at the end of the list.
+ For eg: If RPL_TABLE_LIST is t1->t2->t3, open_tables will modify
+ the list into t1->t2->t3->t1'->t2'. t1' and t2' will be skipped
+ because tables_to_lock_count logic in this for loop.
+ */
+ if (table_list_ptr->parent_l)
+ continue;
+ /*
+ We can use a down cast here since we know that every table added
+ to the tables_to_lock is a RPL_TABLE_LIST (or child table which is
+ skipped above).
+ */
+ RPL_TABLE_LIST *ptr= static_cast<RPL_TABLE_LIST*>(table_list_ptr);
DBUG_ASSERT(ptr->m_tabledef_valid);
TABLE *conv_table;
if (!ptr->m_tabledef.compatible_with(thd, const_cast<Relay_log_info*>(rli),
DBUG_PRINT("debug", ("Table: %s.%s is not compatible with master",
ptr->table->s->db.str,
ptr->table->s->table_name.str));
- /*
- We should not honour --slave-skip-errors at this point as we are
- having severe errors which should not be skiped.
- */
- thd->is_slave_error= 1;
- const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
- DBUG_RETURN(ERR_BAD_TABLE_DEF);
+ if (thd->is_slave_error)
+ {
+ const_cast<Relay_log_info*>(rli)->slave_close_thread_tables(thd);
+ DBUG_RETURN(ERR_BAD_TABLE_DEF);
+ }
+ else
+ {
+ thd->get_stmt_da()->clear_warning_info(thd->query_id);
+ clear_all_errors(thd, const_cast<Relay_log_info*>(rli));
+ error= 0;
+ goto end;
+ }
}
DBUG_PRINT("debug", ("Table: %s.%s is compatible with master"
" - conv_table: %p",
*/
TABLE_LIST *ptr= rli->tables_to_lock;
for (uint i=0 ; ptr && (i < rli->tables_to_lock_count); ptr= ptr->next_global, i++)
+ {
+ /*
+ Please see comment in above 'for' loop to know the reason
+ for this if condition
+ */
+ if (ptr->parent_l)
+ continue;
const_cast<Relay_log_info*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
+ }
#ifdef HAVE_QUERY_CACHE
#ifdef WITH_WSREP
#endif
}
- TABLE*
- table=
+ table=
m_table= const_cast<Relay_log_info*>(rli)->m_table_map.get_table(m_table_id);
DBUG_PRINT("debug", ("m_table: 0x%lx, m_table_id: %llu", (ulong) m_table,
thd->is_slave_error= 1;
DBUG_RETURN(error);
}
-
+end:
if (get_flags(STMT_END_F))
{
#endif /* WITH_WSREP && HAVE_QUERY_CACHE */
if((error= rows_event_stmt_cleanup(rli, thd)))
- slave_rows_error_report(ERROR_LEVEL,
- thd->is_error() ? 0 : error,
- rli, thd, table,
- get_type_str(),
- const_cast<Relay_log_info*>(rli)->get_rpl_log_name(),
- (ulong) log_pos);
+ {
+ if (table)
+ slave_rows_error_report(ERROR_LEVEL,
+ thd->is_error() ? 0 : error,
+ rli, thd, table,
+ get_type_str(),
+ const_cast<Relay_log_info*>(rli)->get_rpl_log_name(),
+ (ulong) log_pos);
+ else
+ {
+ rli->report(ERROR_LEVEL,
+ thd->is_error() ? thd->get_stmt_da()->sql_errno() : error,
+ "Error in cleaning up after an event of type:%s; %s; the group"
+ " log file/position: %s %lu", get_type_str(),
+ thd->is_error() ? thd->get_stmt_da()->message() : "unexpected error",
+ const_cast<Relay_log_info*>(rli)->get_rpl_log_name(),
+ (ulong) log_pos);
+ }
+ }
/* We are at end of the statement (STMT_END_F flag), lets clean
the memory which was used from thd's mem_root now.
This needs to be done only if we are here in SQL thread context.
static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD * thd)
{
+ DBUG_EXECUTE_IF("simulate_rows_event_cleanup_failure",
+ {
+ my_error(ER_ERROR_DURING_COMMIT, MYF(0), 1);
+ return (1);
+ });
int error;
{
/*
thd->reset_current_stmt_binlog_format_row();
const_cast<Relay_log_info*>(rli)->cleanup_context(thd, 0);
+
+ /*
+ Clean sql_command value
+ */
+ thd->lex->sql_command= SQLCOM_END;
+
}
return error;
}
if (get_flags(STMT_END_F))
status_var_increment(thd->status_var.com_stat[SQLCOM_INSERT]);
+ /*
+ Let storage engines treat this event as an INSERT command.
+
+ Set 'sql_command' as SQLCOM_INSERT after the tables are locked.
+ When locking the tables, it should be SQLCOM_END.
+ THD::decide_binlog_format which is called from "lock tables"
+ assumes that row_events will have 'sql_command' as SQLCOM_END.
+ */
+ thd->lex->sql_command= SQLCOM_INSERT;
+
/**
todo: to introduce a property for the event (handler?) which forces
applying the event in the replace (idempotent) fashion.
*/
if (get_flags(STMT_END_F))
status_var_increment(thd->status_var.com_stat[SQLCOM_DELETE]);
+
+ /*
+ Let storage engines treat this event as a DELETE command.
+
+ Set 'sql_command' as SQLCOM_UPDATE after the tables are locked.
+ When locking the tables, it should be SQLCOM_END.
+ THD::decide_binlog_format which is called from "lock tables"
+ assumes that row_events will have 'sql_command' as SQLCOM_END.
+ */
+ thd->lex->sql_command= SQLCOM_DELETE;
+
error= row_operations_scan_and_key_setup();
DBUG_RETURN(error);
*/
if (get_flags(STMT_END_F))
status_var_increment(thd->status_var.com_stat[SQLCOM_UPDATE]);
+
+ /*
+ Let storage engines treat this event as an UPDATE command.
+
+ Set 'sql_command' as SQLCOM_UPDATE after the tables are locked.
+ When locking the tables, it should be SQLCOM_END.
+ THD::decide_binlog_format which is called from "lock tables"
+ assumes that row_events will have 'sql_command' as SQLCOM_END.
+ */
+ thd->lex->sql_command= SQLCOM_UPDATE;
+
error= row_operations_scan_and_key_setup();
DBUG_RETURN(error);
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
class String;
typedef ulonglong sql_mode_t;
typedef struct st_db_worker_hash_entry db_worker_hash_entry;
-
+#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
+int ignored_error_code(int err_code);
+#endif
#define PREFIX_SQL_LOAD "SQL_LOAD-"
/**
}
virtual bool write_data_header(IO_CACHE* file)
{ return 0; }
- virtual bool write_data_body(IO_CACHE* file __attribute__((unused)))
+ virtual bool write_data_body(IO_CACHE* file MY_ATTRIBUTE((unused)))
{ return 0; }
inline time_t get_time()
{
static bool binlog_row_logging_function(THD *thd, TABLE *table,
bool is_transactional,
const uchar *before_record
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *after_record)
{
return thd->binlog_write_row(table, is_transactional,
bool is_transactional,
const uchar *before_record,
const uchar *after_record
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return thd->binlog_delete_row(table, is_transactional,
before_record, NULL);
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/*
When the open and locking succeeded, we check all tables to
ensure that they still have the correct type.
-
- We can use a down cast here since we know that every table added
- to the tables_to_lock is a RPL_TABLE_LIST.
*/
{
- RPL_TABLE_LIST *ptr= rli->tables_to_lock;
- for (uint i= 0 ; ptr&& (i< rli->tables_to_lock_count);
- ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
+ TABLE_LIST *table_list_ptr= rli->tables_to_lock;
+ for (uint i=0 ; table_list_ptr&& (i< rli->tables_to_lock_count);
+ table_list_ptr= table_list_ptr->next_global, i++)
{
+ /*
+ Please see comment in log_event.cc-Rows_log_event::do_apply_event()
+ function for the explanation of the below if condition
+ */
+ if (table_list_ptr->parent_l)
+ continue;
+ /*
+ We can use a down cast here since we know that every table added
+ to the tables_to_lock is a RPL_TABLE_LIST(or child table which is
+ skipped above).
+ */
+ RPL_TABLE_LIST *ptr=static_cast<RPL_TABLE_LIST*>(table_list_ptr);
DBUG_ASSERT(ptr->m_tabledef_valid);
TABLE *conv_table;
if (!ptr->m_tabledef.compatible_with(thd, const_cast<Relay_log_info*>(rli),
*/
TABLE_LIST *ptr= rli->tables_to_lock;
for (uint i=0; ptr && (i < rli->tables_to_lock_count); ptr= ptr->next_global, i++)
+ {
+ /*
+ Please see comment in log_event.cc-Rows_log_event::do_apply_event()
+ function for the explanation of the below if condition
+ */
+ if (ptr->parent_l)
+ continue;
const_cast<Relay_log_info*>(rli)->m_table_map.set_table(ptr->table_id, ptr->table);
+ }
#ifdef HAVE_QUERY_CACHE
query_cache.invalidate_locked_for_write(rli->tables_to_lock);
#endif
/*
When the open and locking succeeded, we check all tables to
ensure that they still have the correct type.
-
- We can use a down cast here since we know that every table added
- to the tables_to_lock is a RPL_TABLE_LIST.
*/
{
- RPL_TABLE_LIST *ptr= rli->tables_to_lock;
- for (uint i= 0 ; ptr&& (i< rli->tables_to_lock_count);
- ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
+ TABLE_LIST *table_list_ptr= rli->tables_to_lock;
+ for (uint i=0; table_list_ptr&& (i< rli->tables_to_lock_count);
+ table_list_ptr= static_cast<RPL_TABLE_LIST*>(table_list_ptr->next_global), i++)
{
+ /*
+ Please see comment in log_event.cc-Rows_log_event::do_apply_event()
+ function for the explanation of the below if condition
+ */
+ if (table_list_ptr->parent_l)
+ continue;
+ /*
+ We can use a down cast here since we know that every table added
+ to the tables_to_lock is a RPL_TABLE_LIST (or child table which is
+ skipped above).
+ */
+ RPL_TABLE_LIST *ptr=static_cast<RPL_TABLE_LIST*>(table_list_ptr);
TABLE *conv_table;
if (ptr->m_tabledef.compatible_with(thd, const_cast<Relay_log_info*>(rli),
ptr->table, &conv_table))
-/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static bool binlog_row_logging_function(THD *thd, TABLE *table,
bool is_transactional,
const uchar *before_record
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *after_record)
{
return thd->binlog_write_row(table, is_transactional,
bool is_transactional,
const uchar *before_record,
const uchar *after_record
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return thd->binlog_delete_row(table, is_transactional,
before_record, NULL);
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
int i;
int count;
- PSI_stage_info *info __attribute__((unused));
+ PSI_stage_info *info MY_ATTRIBUTE((unused));
count= array_elements(MDL_key::m_namespace_to_wait_state_name);
for (i= 0; i<count; i++)
{
static uchar *
mdl_locks_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
MDL_lock *lock=(MDL_lock*) record;
*length= lock->key.length();
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int _my_b_net_read(register IO_CACHE *info, uchar *Buffer,
- size_t Count __attribute__((unused)))
+ size_t Count MY_ATTRIBUTE((unused)))
{
ulong read_length;
NET *net= &(current_thd)->net;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
static void clean_up_mutexes(void);
static void wait_for_signal_thread_to_end(void);
static void create_pid_file();
-static void mysqld_exit(int exit_code) __attribute__((noreturn));
+static void mysqld_exit(int exit_code) MY_ATTRIBUTE((noreturn));
#endif
static void delete_pid_file(myf flags);
static void end_ssl();
#if defined(USE_ONE_SIGNAL_HAND)
-pthread_handler_t kill_server_thread(void *arg __attribute__((unused)))
+pthread_handler_t kill_server_thread(void *arg MY_ATTRIBUTE((unused)))
{
my_thread_init(); // Initialize new thread
kill_server(0);
/** Called when a thread is aborted. */
/* ARGSUSED */
-extern "C" sig_handler end_thread_signal(int sig __attribute__((unused)))
+extern "C" sig_handler end_thread_signal(int sig MY_ATTRIBUTE((unused)))
{
THD *thd=current_thd;
my_safe_printf_stderr("end_thread_signal %p", thd);
@todo
One should have to fix that thr_alarm know about this thread too.
*/
-extern "C" sig_handler abort_thread(int sig __attribute__((unused)))
+extern "C" sig_handler abort_thread(int sig MY_ATTRIBUTE((unused)))
{
THD *thd=current_thd;
DBUG_ENTER("abort_thread");
/** This threads handles all signals and alarms. */
/* ARGSUSED */
-pthread_handler_t signal_hand(void *arg __attribute__((unused)))
+pthread_handler_t signal_hand(void *arg MY_ATTRIBUTE((unused)))
{
sigset_t set;
int sig;
if (!opt_slow_logname || !*opt_slow_logname)
opt_slow_logname= make_default_log_name(slow_logname_path, "-slow.log");
+ if (opt_logname &&
+ !is_valid_log_name(opt_logname, strlen(opt_logname)))
+ {
+ sql_print_error("Invalid value for --general_log_file: %s",
+ opt_logname);
+ return 1;
+ }
+
+ if (opt_slow_logname &&
+ !is_valid_log_name(opt_slow_logname, strlen(opt_slow_logname)))
+ {
+ sql_print_error("Invalid value for --slow_query_log_file: %s",
+ opt_slow_logname);
+ return 1;
+ }
+
#if defined(ENABLED_DEBUG_SYNC)
/* Initialize the debug sync facility. See debug_sync.cc. */
if (debug_sync_init())
/* load_defaults require argv[0] is not null */
char **argv= &name;
int argc= 1;
- if (!check_file_permissions(fname))
+ if (!check_file_permissions(fname, false))
{
/*
Found a world writable file hence removing it as it is dangerous to write
sql_print_error("The server_uuid stored in auto.cnf file is not a valid UUID.");
goto err;
}
+ /*
+ Uuid::is_valid() cannot do strict check on the length as it will be
+ called by GTID::is_valid() as well (GTID = UUID:seq_no). We should
+ explicitly add the *length check* here in this function.
+
+ If UUID length is less than '36' (UUID_LENGTH), that error case would have
+ got caught in above is_valid check. The below check is to make sure that
+ length is not greater than UUID_LENGTH i.e., there are no extra characters
+ (Garbage) at the end of the valid UUID.
+ */
+ if (strlen(uuid) > UUID_LENGTH)
+ {
+ sql_print_error("Garbage characters found at the end of the server_uuid "
+ "value in auto.cnf file. It should be of length '%d' "
+ "(UUID_LENGTH). Clear it and restart the server. ",
+ UUID_LENGTH);
+ goto err;
+ }
strcpy(server_uuid, uuid);
}
else
proc_info_hook= set_thd_stage_info;
-#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
/*
- Parsing the performance schema command line option may have reported
+ Parsing the performance schema command line option and
+ adjusting the values for options such as "open_files_limit",
+ "max_connections", and "table_cache_size" may have reported
warnings/information messages.
Now that the logger is finally available, and redirected
to the proper file when the --log--error option is used,
*/
buffered_logs.print();
buffered_logs.cleanup();
-#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
/*
Now that the logger is available, redirect character set
if (WSREP_ON)
tc_log= &tc_log_dummy;
else
-#endif /* WITH_WSREP */
+ /*
+ * wsrep hton grows total_ha_2pc count to 2, even in native mysql mode.
+ * Have to force using tc_log_dummy here, as tc_log_mmap segfaults
+ */
+ tc_log= &tc_log_dummy;
+#else
tc_log= &tc_log_mmap;
+#endif /* WITH_WSREP */
}
else
tc_log= &tc_log_dummy;
orig_argc= argc;
orig_argv= argv;
my_getopt_use_args_separator= TRUE;
+ my_defaults_read_login_file= FALSE;
if (load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv))
return 1;
my_getopt_use_args_separator= FALSE;
opt_logname= opt_update_logname= opt_binlog_index_name= opt_slow_logname= 0;
opt_tc_log_file= (char *)"tc.log"; // no hostname in tc_log file name !
opt_secure_auth= 0;
- opt_secure_file_priv= NULL;
opt_myisam_log= 0;
mqh_used= 0;
kill_in_progress= 0;
(void) strmake(mysql_home, tmpenv, sizeof(mysql_home)-1);
#endif
#ifdef WITH_WSREP
- if (WSREP_ON && wsrep_init_vars())
+ if (wsrep_init_vars())
return 1;
#endif
return 0;
my_bool
mysqld_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch(optid) {
break;
case 'b':
strmake(mysql_home,argument,sizeof(mysql_home)-1);
+ mysql_home_ptr= mysql_home;
break;
case 'C':
if (default_collation_name == compiled_default_collation_name)
char buff1[FN_REFLEN], buff2[FN_REFLEN];
size_t opt_secure_file_priv_len;
/*
- All paths are secure if opt_secure_file_path is 0
+ All paths are secure if opt_secure_file_priv is 0
*/
- if (!opt_secure_file_priv)
+ if (!opt_secure_file_priv[0])
return TRUE;
opt_secure_file_priv_len= strlen(opt_secure_file_priv);
if (strlen(path) >= FN_REFLEN)
return FALSE;
+ if (!my_strcasecmp(system_charset_info, opt_secure_file_priv, "NULL"))
+ return FALSE;
+
if (my_realpath(buff1, path, 0))
{
/*
}
+/**
+ check_secure_file_priv_path : Checks path specified through
+ --secure-file-priv and raises warning in following cases:
+ 1. If path is empty string or NULL and mysqld is not running
+ with --bootstrap mode.
+ 2. If path can access data directory
+ 3. If path points to a directory which is accessible by
+ all OS users (non-Windows build only)
+
+ It throws error in following cases:
+
+ 1. If path normalization fails
+ 2. If it can not get stats of the directory
+
+ @params NONE
+
+ Assumptions :
+ 1. Data directory path has been normalized
+ 2. opt_secure_file_priv has been normalized unless it is set
+ to "NULL".
+
+ @returns Status of validation
+ @retval true : Validation is successful with/without warnings
+ @retval false : Validation failed. Error is raised.
+*/
+
+bool check_secure_file_priv_path()
+{
+ char datadir_buffer[FN_REFLEN+1]={0};
+ char plugindir_buffer[FN_REFLEN+1]={0};
+ char whichdir[20]= {0};
+ size_t opt_plugindir_len= 0;
+ size_t opt_datadir_len= 0;
+ size_t opt_secure_file_priv_len= 0;
+ bool warn= false;
+ bool case_insensitive_fs;
+#ifndef _WIN32
+ MY_STAT dir_stat;
+#endif
+
+ if (!opt_secure_file_priv[0])
+ {
+ if (opt_bootstrap)
+ {
+ /*
+ Do not impose --secure-file-priv restriction
+ in --bootstrap mode
+ */
+ sql_print_information("Ignoring --secure-file-priv value as server is "
+ "running with --bootstrap.");
+ }
+ else
+ {
+ sql_print_warning("Insecure configuration for --secure-file-priv: "
+ "Current value does not restrict location of generated "
+ "files. Consider setting it to a valid, "
+ "non-empty path.");
+ }
+ return true;
+ }
+
+ /*
+ Setting --secure-file-priv to NULL would disable
+ reading/writing from/to file
+ */
+ if(!my_strcasecmp(system_charset_info, opt_secure_file_priv, "NULL"))
+ {
+ sql_print_information("--secure-file-priv is set to NULL. "
+ "Operations related to importing and exporting "
+ "data are disabled");
+ return true;
+ }
+
+ /*
+ Check if --secure-file-priv can access data directory
+ */
+ opt_secure_file_priv_len= strlen(opt_secure_file_priv);
+
+ /*
+ Adds dir seperator at the end.
+ This is required in subsequent comparison
+ */
+ convert_dirname(datadir_buffer, mysql_unpacked_real_data_home, NullS);
+ opt_datadir_len= strlen(datadir_buffer);
+
+ case_insensitive_fs=
+ (test_if_case_insensitive(datadir_buffer) == 1);
+
+ if (!case_insensitive_fs)
+ {
+ if (!strncmp(datadir_buffer, opt_secure_file_priv,
+ opt_datadir_len < opt_secure_file_priv_len ?
+ opt_datadir_len : opt_secure_file_priv_len))
+ {
+ warn= true;
+ strcpy(whichdir, "Data directory");
+ }
+ }
+ else
+ {
+ if (!files_charset_info->coll->strnncoll(files_charset_info,
+ (uchar *) datadir_buffer,
+ opt_datadir_len,
+ (uchar *) opt_secure_file_priv,
+ opt_secure_file_priv_len,
+ TRUE))
+ {
+ warn= true;
+ strcpy(whichdir, "Data directory");
+ }
+ }
+
+ /*
+ Don't bother comparing --secure-file-priv with --plugin-dir
+ if we already have a match against --datadir or
+ --plugin-dir is not pointing to a valid directory.
+ */
+ if (!warn && !my_realpath(plugindir_buffer, opt_plugin_dir, 0))
+ {
+ convert_dirname(plugindir_buffer, plugindir_buffer, NullS);
+ opt_plugindir_len= strlen(plugindir_buffer);
+
+ if (!case_insensitive_fs)
+ {
+ if (!strncmp(plugindir_buffer, opt_secure_file_priv,
+ opt_plugindir_len < opt_secure_file_priv_len ?
+ opt_plugindir_len : opt_secure_file_priv_len))
+ {
+ warn= true;
+ strcpy(whichdir, "Plugin directory");
+ }
+ }
+ else
+ {
+ if (!files_charset_info->coll->strnncoll(files_charset_info,
+ (uchar *) plugindir_buffer,
+ opt_plugindir_len,
+ (uchar *) opt_secure_file_priv,
+ opt_secure_file_priv_len,
+ TRUE))
+ {
+ warn= true;
+ strcpy(whichdir, "Plugin directory");
+ }
+ }
+ }
+
+
+ if (warn)
+ sql_print_warning("Insecure configuration for --secure-file-priv: "
+ "%s is accessible through "
+ "--secure-file-priv. Consider choosing a different "
+ "directory.", whichdir);
+
+#ifndef _WIN32
+ /*
+ Check for --secure-file-priv directory's permission
+ */
+ if (!(my_stat(opt_secure_file_priv, &dir_stat, MYF(0))))
+ {
+ sql_print_error("Failed to get stat for directory pointed out "
+ "by --secure-file-priv");
+ return false;
+ }
+
+ if (dir_stat.st_mode & S_IRWXO)
+ sql_print_warning("Insecure configuration for --secure-file-priv: "
+ "Location is accessible to all OS users. "
+ "Consider choosing a different directory.");
+#endif
+ return true;
+}
+
static int fix_paths(void)
{
char buff[FN_REFLEN],*pos;
+ bool secure_file_priv_nonempty= false;
convert_dirname(mysql_home,mysql_home,NullS);
/* Resolve symlinks to allow 'mysql_home' to be a relative symlink */
my_realpath(mysql_home,mysql_home,MYF(0));
/*
Convert the secure-file-priv option to system format, allowing
a quick strcmp to check if read or write is in an allowed dir
- */
- if (opt_secure_file_priv)
+ */
+ if (opt_bootstrap)
+ opt_secure_file_priv= EMPTY_STR.str;
+ secure_file_priv_nonempty= opt_secure_file_priv[0] ? true : false;
+
+ if (secure_file_priv_nonempty && strlen(opt_secure_file_priv) > FN_REFLEN)
{
- if (*opt_secure_file_priv == 0)
- opt_secure_file_priv= NULL;
- else
+ sql_print_warning("Value for --secure-file-priv is longer than maximum "
+ "limit of %d", FN_REFLEN-1);
+ return 1;
+ }
+
+ memset(buff, 0, sizeof(buff));
+ if (secure_file_priv_nonempty &&
+ my_strcasecmp(system_charset_info, opt_secure_file_priv, "NULL"))
+ {
+ int retval= my_realpath(buff, opt_secure_file_priv, MYF(MY_WME));
+ if (!retval)
{
- if (strlen(opt_secure_file_priv) >= FN_REFLEN)
- opt_secure_file_priv[FN_REFLEN-1]= '\0';
- if (my_realpath(buff, opt_secure_file_priv, 0))
+ convert_dirname(secure_file_real_path, buff, NullS);
+#ifdef WIN32
+ MY_DIR *dir= my_dir(secure_file_real_path, MYF(MY_DONT_SORT+MY_WME));
+ if (!dir)
{
- sql_print_warning("Failed to normalize the argument for --secure-file-priv.");
- return 1;
+ retval= 1;
}
- convert_dirname(secure_file_real_path, buff, NullS);
- opt_secure_file_priv= secure_file_real_path;
+ else
+ {
+ my_dirend(dir);
+ }
+#endif
}
+
+ if (retval)
+ {
+ char err_buffer[FN_REFLEN];
+ my_snprintf(err_buffer, FN_REFLEN-1,
+ "Failed to access directory for --secure-file-priv."
+ " Please make sure that directory exists and is "
+ "accessible by MySQL Server. Supplied value : %s",
+ opt_secure_file_priv);
+ err_buffer[FN_REFLEN-1]='\0';
+ sql_print_error("%s", err_buffer);
+ return 1;
+ }
+ opt_secure_file_priv= secure_file_real_path;
}
+ if (!check_secure_file_priv_path())
+ return 1;
+
return 0;
}
it evaluates to. Should be used for error messages, so that they
don't reveal values.
*/
- QT_NO_DATA_EXPANSION= (1 << 9),
+ QT_NO_DATA_EXPANSION= (1 << 9)
};
/* query_id */
extern query_id_t global_query_id;
extern my_atomic_rwlock_t global_query_id_lock;
-void unireg_end(void) __attribute__((noreturn));
+void unireg_end(void) MY_ATTRIBUTE((noreturn));
/* increment query_id and return it. */
-inline __attribute__((warn_unused_result)) query_id_t next_query_id()
+inline MY_ATTRIBUTE((warn_unused_result)) query_id_t next_query_id()
{
query_id_t id;
my_atomic_rwlock_wrlock(&global_query_id_lock);
TODO: Replace this with an inline function.
*/
#ifndef EMBEDDED_LIBRARY
-extern "C" void unireg_abort(int exit_code) __attribute__((noreturn));
+extern "C" void unireg_abort(int exit_code) MY_ATTRIBUTE((noreturn));
#else
extern "C" void unireg_clear(int exit_code);
#define unireg_abort(exit_code) do { unireg_clear(exit_code); DBUG_RETURN(exit_code); } while(0)
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
void net_clear(NET *net,
- my_bool check_buffer __attribute__((unused)))
+ my_bool check_buffer MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("net_clear");
*/
static my_bool
-net_should_retry(NET *net, uint *retry_count __attribute__((unused)))
+net_should_retry(NET *net, uint *retry_count MY_ATTRIBUTE((unused)))
{
my_bool retry;
-#if !defined(MYSQL_SERVER) && defined(THREAD_SAFE_CLIENT)
+#ifndef MYSQL_SERVER
/*
- In the thread safe client library, interrupted I/O operations
- are always retried. Otherwise, its either a timeout or a
- unrecoverable error.
+ In the client library, interrupted I/O operations are always retried.
+ Otherwise, it's either a timeout or an unrecoverable error.
*/
retry= vio_should_retry(net->vio);
#else
/*
- In the non-thread safe client library, or in the server,
- interrupted I/O operations are retried up to a limit.
+ In the server, interrupted I/O operations are retried up to a limit.
In this scenario, pthread_kill can be used to wake up
(interrupt) threads waiting for I/O.
*/
DBUG_VOID_RETURN;
}
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+C_MODE_START
+
+// Hack to provide Fedora symbols
+
+my_bool mysql_net_realloc(NET *net, size_t length)
+{
+ return net_realloc(net, length);
+}
+
+C_MODE_END
+#endif
+#endif // EXPORT_SYMVER16
}
if (quick_prefix_select && quick_prefix_select->reset())
DBUG_RETURN(1);
+
result= head->file->ha_index_last(record);
- if (result == HA_ERR_END_OF_FILE)
- DBUG_RETURN(0);
+ if (result != 0)
+ {
+ if (result == HA_ERR_END_OF_FILE)
+ DBUG_RETURN(0);
+ else
+ DBUG_RETURN(result);
+ }
+
/* Save the prefix of the last group. */
key_copy(last_prefix, record, index_info, group_prefix_len);
-/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
static const char *get_part_name_from_elem(const char *name, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= strlen(name);
return name;
DBUG_PRINT("info", ("parser: %s", str));
DBUG_VOID_RETURN;
}
+
+bool has_external_data_or_index_dir(partition_info &pi)
+{
+ List_iterator<partition_element> part_it(pi.partitions);
+ for (partition_element *part= part_it++; part; part= part_it++)
+ {
+ if (part->data_file_name != NULL || part->index_file_name != NULL)
+ {
+ return true;
+ }
+ List_iterator<partition_element> subpart_it(part->subpartitions);
+ for (const partition_element *subpart= subpart_it++;
+ subpart;
+ subpart= subpart_it++)
+ {
+ if (subpart->data_file_name != NULL || subpart->index_file_name != NULL)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
#else /* WITH_PARTITION_STORAGE_ENGINE */
/*
For builds without partitioning we need to define these functions
#ifndef PARTITION_INFO_INCLUDED
#define PARTITION_INFO_INCLUDED
-/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
part_iter->get_next= get_next_partition_id_range;
}
+/**
+ Predicate which returns true if any partition or subpartition uses
+ an external data directory or external index directory.
+
+ @param pi partitioning information
+ @retval true if any partition or subpartition has an external
+ data directory or external index directory.
+ @retval false otherwise
+ */
+bool has_external_data_or_index_dir(partition_info &pi);
+
#endif /* PARTITION_INFO_INCLUDED */
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
octet2hex(to, (const char*) hash_stage2, SHA1_HASH_SIZE);
}
+#if defined(EXPORT_SYMVER16)
+#ifndef EMBEDDED_LIBRARY
+
+// Hack to provide both libmysqlclient_16 and libmysqlclient_18 symbol versions
+
+#define SYM_16(_exportedsym) __asm__(".symver symver16_" #_exportedsym "," #_exportedsym "@libmysqlclient_16")
+
+void symver16_my_make_scrambled_password(char *to, const char *password, size_t pass_len)
+{
+ my_make_scrambled_password(to, password, pass_len);
+}
+SYM_16(my_make_scrambled_password);
+
+#endif
+#endif /* EXPORT_SYMVER16 */
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern "C" void free_table_ent(void* a);
uchar *get_table_key(const uchar* a, size_t *len,
- my_bool __attribute__((unused)))
+ my_bool MY_ATTRIBUTE((unused)))
{
TABLE_RULE_ENT *e= (TABLE_RULE_ENT *) a;
-/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
}
-int Rpl_info_dummy::do_init_info(uint instance __attribute__((unused)))
+int Rpl_info_dummy::do_init_info(uint instance MY_ATTRIBUTE((unused)))
{
return 0;
}
return REPOSITORY_DOES_NOT_EXIST;
}
-enum_return_check Rpl_info_dummy::do_check_info(uint instance __attribute__((unused)))
+enum_return_check Rpl_info_dummy::do_check_info(uint instance MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return REPOSITORY_DOES_NOT_EXIST;
}
-int Rpl_info_dummy::do_flush_info(const bool force __attribute__((unused)))
+int Rpl_info_dummy::do_flush_info(const bool force MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return 0;
return INFO_REPOSITORY_DUMMY;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const char *value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const char *value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const uchar *value __attribute__((unused)),
- const size_t size __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const uchar *value MY_ATTRIBUTE((unused)),
+ const size_t size MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const ulong value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const ulong value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const int value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const int value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const float value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const float value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
- const Dynamic_ids *value __attribute__((unused)))
+bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
+ const Dynamic_ids *value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- char *value __attribute__((unused)),
- const size_t size __attribute__((unused)),
- const char *default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ char *value MY_ATTRIBUTE((unused)),
+ const size_t size MY_ATTRIBUTE((unused)),
+ const char *default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- uchar *value __attribute__((unused)),
- const size_t size __attribute__((unused)),
- const uchar *default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ uchar *value MY_ATTRIBUTE((unused)),
+ const size_t size MY_ATTRIBUTE((unused)),
+ const uchar *default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- ulong *value __attribute__((unused)),
- const ulong default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ ulong *value MY_ATTRIBUTE((unused)),
+ const ulong default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- int *value __attribute__((unused)),
- const int default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ int *value MY_ATTRIBUTE((unused)),
+ const int default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- float *value __attribute__((unused)),
- const float default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ float *value MY_ATTRIBUTE((unused)),
+ const float default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
return FALSE;
}
-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
- Dynamic_ids *value __attribute__((unused)),
- const Dynamic_ids *default_value __attribute__((unused)))
+bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
+ Dynamic_ids *value MY_ATTRIBUTE((unused)),
+ const Dynamic_ids *default_value MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(!abort);
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
bool Rpl_info_file::do_get_info(const int pos, Dynamic_ids *value,
- const Dynamic_ids *default_value __attribute__((unused)))
+ const Dynamic_ids *default_value MY_ATTRIBUTE((unused)))
{
/*
Static buffer to use most of the times. However, if it is not big
-/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
bool Rpl_info_table::do_get_info(const int pos, uchar *value, const size_t size,
- const uchar *default_value __attribute__((unused)))
+ const uchar *default_value MY_ATTRIBUTE((unused)))
{
if (field_values->value[pos].length() == size)
return (!memcpy((char *) value, (char *)
}
bool Rpl_info_table::do_get_info(const int pos, Dynamic_ids *value,
- const Dynamic_ids *default_value __attribute__((unused)))
+ const Dynamic_ids *default_value MY_ATTRIBUTE((unused)))
{
if (value->unpack_dynamic_ids(field_values->value[pos].c_ptr_safe()))
return TRUE;
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern "C" uint32
*slave_list_key(SLAVE_INFO* si, size_t *len,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*len = 4;
return &si->server_id;
{
DBUG_ENTER("com_binlog_dump");
ulong pos;
- String slave_uuid;
ushort flags= 0;
const uchar* packet_position= (uchar *) packet;
uint packet_bytes_todo= packet_length;
DBUG_PRINT("info", ("pos=%lu flags=%d server_id=%d", pos, flags, thd->server_id));
- get_slave_uuid(thd, &slave_uuid);
- kill_zombie_dump_threads(&slave_uuid);
+ kill_zombie_dump_threads(thd);
general_log_print(thd, thd->get_command(), "Log: '%s' Pos: %ld",
packet + 10, (long) pos);
Before going GA, we need to make this protocol extensible without
breaking compatitibilty. /Alfranio.
*/
- String slave_uuid;
ushort flags= 0;
uint32 data_size= 0;
uint64 pos= 0;
DBUG_PRINT("info", ("Slave %d requested to read %s at position %llu gtid set "
"'%s'.", thd->server_id, name, pos, gtid_string));
- get_slave_uuid(thd, &slave_uuid);
- kill_zombie_dump_threads(&slave_uuid);
+ kill_zombie_dump_threads(thd);
general_log_print(thd, thd->get_command(), "Log: '%s' Pos: %llu GTIDs: '%s'",
name, pos, gtid_string);
my_free(gtid_string);
Diagnostics_area temp_da;
Diagnostics_area *saved_da= thd->get_stmt_da();
thd->set_stmt_da(&temp_da);
- bool was_killed_by_duplicate_slave_uuid= false;
+ bool was_killed_by_duplicate_slave_id= false;
DBUG_ENTER("mysql_binlog_send");
DBUG_PRINT("enter",("log_ident: '%s' pos: %ld", log_ident, (long) pos));
reconnect anymore.
*/
mysql_mutex_lock(&thd->LOCK_thd_data);
- was_killed_by_duplicate_slave_uuid= thd->duplicate_slave_uuid;
+ was_killed_by_duplicate_slave_id= thd->duplicate_slave_id;
mysql_mutex_unlock(&thd->LOCK_thd_data);
- if (was_killed_by_duplicate_slave_uuid)
+ if (was_killed_by_duplicate_slave_id)
{
- errmsg= "A slave with the same server_uuid as this slave "
+ errmsg= "A slave with the same server_uuid/server_id as this slave "
"has connected to the master";
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
/*
Kill all Binlog_dump threads which previously talked to the same slave
- ("same" means with the same server id). Indeed, if the slave stops, if the
+ ("same" means with the same UUID(for slave versions >= 5.6) or same server id
+ (for slave versions < 5.6). Indeed, if the slave stops, if the
Binlog_dump thread is waiting (mysql_cond_wait) for binlog update, then it
will keep existing until a query is written to the binlog. If the master is
idle, then this could last long, and if the slave reconnects, we could have 2
Binlog_dump threads in SHOW PROCESSLIST, until a query is written to the
binlog. To avoid this, when the slave reconnects and sends COM_BINLOG_DUMP,
- the master kills any existing thread with the slave's server id (if this id is
+ the master kills any existing thread with the slave's UUID/server id (if this id is
not zero; it will be true for real slaves, but false for mysqlbinlog when it
sends COM_BINLOG_DUMP to get a remote binlog dump).
SYNOPSIS
kill_zombie_dump_threads()
- slave_uuid the slave's UUID
+ @param thd newly connected dump thread object
*/
-
-void kill_zombie_dump_threads(String *slave_uuid)
+void kill_zombie_dump_threads(THD *thd)
{
- if (slave_uuid->length() == 0)
+ String slave_uuid;
+ get_slave_uuid(thd, &slave_uuid);
+ if (slave_uuid.length() == 0 && thd->server_id == 0)
return;
- DBUG_ASSERT(slave_uuid->length() == UUID_LENGTH);
mysql_mutex_lock(&LOCK_thread_count);
THD *tmp= NULL;
Thread_iterator it= global_thread_list_begin();
Thread_iterator end= global_thread_list_end();
+ bool is_zombie_thread= false;
for (; it != end; ++it)
{
- if ((*it) != current_thd && ((*it)->get_command() == COM_BINLOG_DUMP ||
- (*it)->get_command() == COM_BINLOG_DUMP_GTID))
+ if ((*it) != thd && ((*it)->get_command() == COM_BINLOG_DUMP ||
+ (*it)->get_command() == COM_BINLOG_DUMP_GTID))
{
String tmp_uuid;
- if (get_slave_uuid((*it), &tmp_uuid) != NULL &&
- !strncmp(slave_uuid->c_ptr(), tmp_uuid.c_ptr(), UUID_LENGTH))
+ get_slave_uuid((*it), &tmp_uuid);
+ if (slave_uuid.length())
+ {
+ is_zombie_thread= (tmp_uuid.length() &&
+ !strncmp(slave_uuid.c_ptr(),
+ tmp_uuid.c_ptr(), UUID_LENGTH));
+ }
+ else
+ {
+ /*
+ Check if it is a 5.5 slave's dump thread i.e., server_id should be
+ same && dump thread should not contain 'UUID'.
+ */
+ is_zombie_thread= (((*it)->server_id == thd->server_id) &&
+ !tmp_uuid.length());
+ }
+ if (is_zombie_thread)
{
tmp= *it;
mysql_mutex_lock(&tmp->LOCK_thd_data); // Lock from delete
again. We just to do kill the thread ourselves.
*/
if (log_warnings > 1)
- sql_print_information("While initializing dump thread for slave with "
- "UUID <%s>, found a zombie dump thread with "
- "the same UUID. Master is killing the zombie dump "
- "thread(%lu).", slave_uuid->c_ptr(), tmp->thread_id);
- tmp->duplicate_slave_uuid= true;
+ {
+ if (slave_uuid.length())
+ {
+ sql_print_information("While initializing dump thread for slave with "
+ "UUID <%s>, found a zombie dump thread with the "
+ "same UUID. Master is killing the zombie dump "
+ "thread(%lu).", slave_uuid.c_ptr(),
+ tmp->thread_id);
+ }
+ else
+ {
+ sql_print_information("While initializing dump thread for slave with "
+ "server_id <%u>, found a zombie dump thread with the "
+ "same server_id. Master is killing the zombie dump "
+ "thread(%lu).", thd->server_id,
+ tmp->thread_id);
+ }
+ }
+ tmp->duplicate_slave_id= true;
tmp->awake(THD::KILL_QUERY);
mysql_mutex_unlock(&tmp->LOCK_thd_data);
}
}
-
/**
Execute a RESET MASTER statement.
#ifndef RPL_MASTER_H_INCLUDED
-/* Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
String *get_slave_uuid(THD *thd, String *value);
bool show_master_status(THD* thd);
bool show_binlogs(THD* thd);
-void kill_zombie_dump_threads(String *slave_uuid);
+void kill_zombie_dump_threads(THD* thd);
/**
Process a COM_BINLOG_DUMP_GTID packet.
-/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
bool Master_info::set_password(const char* password_arg,
- int password_arg_size __attribute__((unused)))
+ int password_arg_size MY_ATTRIBUTE((unused)))
{
bool ret= true;
DBUG_ENTER("Master_info::set_password");
-/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
DBUG_PRINT_BITSET("debug", "cols: %s", cols);
+ /**
+ Save a reference to the original write set bitmaps.
+ We will need this to restore the bitmaps at the end.
+ */
+ MY_BITMAP *old_write_set= table->write_set;
+ /**
+ Just to be sure that tmp_set is currently not in use as
+ the read_set already.
+ */
+ DBUG_ASSERT(table->write_set != &table->tmp_set);
+ /* set the temporary write_set */
+ table->column_bitmaps_set_no_signal(table->read_set,
+ &table->tmp_set);
+ /**
+ Set table->write_set bits for all the columns as they
+ will be checked in set_default() function.
+ */
+ bitmap_set_all(table->write_set);
+
for (Field **field_ptr= table->field; *field_ptr; ++field_ptr)
{
- if ((uint) (field_ptr - table->field) >= cols->n_bits ||
- !bitmap_is_set(cols, field_ptr - table->field))
- {
+ uint field_index= (uint) (field_ptr - table->field);
+ if (field_index >= cols->n_bits || !bitmap_is_set(cols, field_index))
+ {
Field *const f= *field_ptr;
if ((f->flags & NO_DEFAULT_VALUE_FLAG) &&
(f->real_type() != MYSQL_TYPE_ENUM))
ER(ER_NO_DEFAULT_FOR_FIELD),
f->field_name);
}
+ else if (f->has_insert_default_function())
+ {
+ f->set_default();
+ }
}
}
+ /* set the write_set back to original*/
+ table->column_bitmaps_set_no_signal(table->read_set,
+ old_write_set);
+
DBUG_RETURN(0);
}
-/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
cur_log_fd(-1), relay_log(&sync_relaylog_period),
is_relay_log_recovery(is_slave_recovery),
save_temporary_tables(0),
- cur_log_old_open_count(0), group_relay_log_pos(0), event_relay_log_pos(0),
+ cur_log_old_open_count(0), error_on_rli_init_info(false),
+ group_relay_log_pos(0), event_relay_log_pos(0),
group_master_log_pos(0),
gtid_set(global_sid_map, global_sid_lock),
log_space_total(0), ignore_log_space_limit(0),
mts_group_status(MTS_NOT_IN_GROUP), reported_unsafe_warning(false),
rli_description_event(NULL),
sql_delay(0), sql_delay_end(0), m_flags(0), row_stmt_start_timestamp(0),
- long_find_row_note_printed(false), error_on_rli_init_info(false)
+ long_find_row_note_printed(false)
{
DBUG_ENTER("Relay_log_info::Relay_log_info");
break;
case UNTIL_SQL_AFTER_MTS_GAPS:
-#ifndef DBUG_OFF
case UNTIL_DONE:
-#endif
/*
TODO: this condition is actually post-execution or post-scheduling
so the proper place to check it before SQL thread goes
"UNTIL SQL_AFTER_MTS_GAPS as it has "
"processed all gap transactions left from "
"the previous slave session.");
-#ifndef DBUG_OFF
until_condition= UNTIL_DONE;
-#endif
DBUG_RETURN(true);
}
else
goto err;
}
- is_relay_log_recovery= FALSE;
+ /*
+ In case of MTS the recovery is deferred until the end of global_init_info.
+ */
+ if (!mi->rli->mts_recovery_group_cnt)
+ is_relay_log_recovery= FALSE;
DBUG_RETURN(error);
err:
*/
uint32 cur_log_old_open_count;
+ /*
+ If on init_info() call error_on_rli_init_info is true that means
+ that previous call to init_info() terminated with an error, RESET
+ SLAVE must be executed and the problem fixed manually.
+ */
+ bool error_on_rli_init_info;
+
/*
Let's call a group (of events) :
- a transaction
*/
enum {UNTIL_NONE= 0, UNTIL_MASTER_POS, UNTIL_RELAY_POS,
UNTIL_SQL_BEFORE_GTIDS, UNTIL_SQL_AFTER_GTIDS,
- UNTIL_SQL_AFTER_MTS_GAPS
-#ifndef DBUG_OFF
- , UNTIL_DONE
-#endif
+ UNTIL_SQL_AFTER_MTS_GAPS, UNTIL_DONE
}
until_condition;
char until_log_name[FN_REFLEN];
time_t row_stmt_start_timestamp;
bool long_find_row_note_printed;
- /*
- If on init_info() call error_on_rli_init_info is true that means
- that previous call to init_info() terminated with an error, RESET
- SLAVE must be executed and the problem fixed manually.
- */
- bool error_on_rli_init_info;
};
bool mysql_show_relaylog_events(THD* thd);
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern "C" uchar *get_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("get_key");
Slave_worker *w_i;
Slave_job_group *ptr_g, g;
char grl_name[FN_REFLEN];
- ulong ind __attribute__((unused));
+ ulong ind MY_ATTRIBUTE((unused));
#ifndef DBUG_OFF
if (DBUG_EVALUATE_IF("check_slave_debug_group", 1, 0) &&
DBUG_RETURN(error);
}
+/*
+ Updates the master info based on the information stored in the
+ relay info and ignores relay logs previously retrieved by the IO
+ thread, which thus starts fetching again based on to the
+ master_log_pos and master_log_name. Eventually, the old
+ relay logs will be purged by the normal purge mechanism.
+
+ When GTID's are enabled the "Retrieved GTID" set should be cleared
+ so that partial read events are discarded and they are
+ fetched once again
+
+ @param mi pointer to Master_info instance
+*/
+static void recover_relay_log(Master_info *mi)
+{
+ Relay_log_info *rli=mi->rli;
+ // Set Receiver Thread's positions as per the recovered Applier Thread.
+ mi->set_master_log_pos(max<ulonglong>(BIN_LOG_HEADER_SIZE,
+ rli->get_group_master_log_pos()));
+ mi->set_master_log_name(rli->get_group_master_log_name());
+
+ sql_print_warning("Recovery from master pos %ld and file %s. "
+ "Previous relay log pos and relay log file had "
+ "been set to %lld, %s respectively.",
+ (ulong) mi->get_master_log_pos(), mi->get_master_log_name(),
+ rli->get_group_relay_log_pos(), rli->get_group_relay_log_name());
+
+ // Start with a fresh relay log.
+ rli->set_group_relay_log_name(rli->relay_log.get_log_fname());
+ rli->set_event_relay_log_name(rli->relay_log.get_log_fname());
+ rli->set_group_relay_log_pos(BIN_LOG_HEADER_SIZE);
+ rli->set_event_relay_log_pos(BIN_LOG_HEADER_SIZE);
+ /*
+ Clear the retrieved GTID set so that events that are written partially
+ will be fetched again.
+ */
+ if (gtid_mode == GTID_MODE_ON)
+ {
+ global_sid_lock->wrlock();
+ (const_cast<Gtid_set *>(rli->get_gtid_set()))->clear();
+ global_sid_lock->unlock();
+ }
+}
+
+
/*
Updates the master info based on the information stored in the
relay info and ignores relay logs previously retrieved by the IO
rli->clear_mts_recovery_groups();
}
else
- {
- error= 1;
- sql_print_error("--relay-log-recovery cannot be executed when the slave "
- "was stopped with an error or killed in MTS mode; "
- "consider using RESET SLAVE or restart the server "
- "with --relay-log-recovery = 0 followed by "
- "START SLAVE UNTIL SQL_AFTER_MTS_GAPS");
- }
+ DBUG_RETURN(error);
}
}
if (error)
DBUG_RETURN(error);
}
- mi->set_master_log_pos(max<ulonglong>(BIN_LOG_HEADER_SIZE,
- rli->get_group_master_log_pos()));
- mi->set_master_log_name(rli->get_group_master_log_name());
+ recover_relay_log(mi);
+ }
+ DBUG_RETURN(error);
+}
+
+/*
+ Relay log recovery in the case of MTS, is handled by the following function.
+ Gaps in MTS execution are filled using implicit execution of
+ START SLAVE UNTIL SQL_AFTER_MTS_GAPS call. Once slave reaches a consistent
+ gapless state receiver thread's positions are initialized to applier thread's
+ positions and the old relay logs are discarded. This completes the recovery
+ process.
- sql_print_warning("Recovery from master pos %ld and file %s. "
- "Previous relay log pos and relay log file had "
- "been set to %lld, %s respectively.",
- (ulong) mi->get_master_log_pos(), mi->get_master_log_name(),
- rli->get_group_relay_log_pos(), rli->get_group_relay_log_name());
+ @param mi pointer to Master_info instance.
- rli->set_group_relay_log_name(rli->relay_log.get_log_fname());
- rli->set_event_relay_log_name(rli->relay_log.get_log_fname());
- rli->set_group_relay_log_pos(BIN_LOG_HEADER_SIZE);
- rli->set_event_relay_log_pos(BIN_LOG_HEADER_SIZE);
+ @retval 0 success
+ @retval 1 error
+*/
+static inline int fill_mts_gaps_and_recover(Master_info* mi)
+{
+ DBUG_ENTER("fill_mts_gaps_and_recover");
+ Relay_log_info *rli= mi->rli;
+ int recovery_error= 0;
+ rli->is_relay_log_recovery= FALSE;
+ rli->until_condition= Relay_log_info::UNTIL_SQL_AFTER_MTS_GAPS;
+ rli->opt_slave_parallel_workers= rli->recovery_parallel_workers;
+ sql_print_information("MTS recovery: starting coordinator thread to fill MTS "
+ "gaps.");
+ recovery_error= start_slave_thread(
+#ifdef HAVE_PSI_INTERFACE
+ key_thread_slave_sql,
+#endif
+ handle_slave_sql, &rli->run_lock,
+ &rli->run_lock,
+ &rli->start_cond,
+ &rli->slave_running,
+ &rli->slave_run_id,
+ mi);
+
+ if (recovery_error)
+ {
+ sql_print_warning("MTS recovery: failed to start the coordinator "
+ "thread. Check the error log for additional"
+ " details.");
+ goto err;
+ }
+ mysql_mutex_lock(&rli->run_lock);
+ mysql_cond_wait(&rli->stop_cond, &rli->run_lock);
+ mysql_mutex_unlock(&rli->run_lock);
+ if (rli->until_condition != Relay_log_info::UNTIL_DONE)
+ {
+ sql_print_warning("MTS recovery: automatic recovery failed. Either the "
+ "slave server had stopped due to an error during an "
+ "earlier session or relay logs are corrupted."
+ "Fix the cause of the slave side error and restart the "
+ "slave server or consider using RESET SLAVE.");
+ goto err;
}
/*
- Clear the retrieved GTID set so that events that are written partially
- will be fetched again.
- */
- global_sid_lock->wrlock();
- (const_cast<Gtid_set *>(rli->get_gtid_set()))->clear();
- global_sid_lock->unlock();
- DBUG_RETURN(error);
+ We need a mutex while we are changing master info parameters to
+ keep other threads from reading bogus info
+ */
+ mysql_mutex_lock(&mi->data_lock);
+ mysql_mutex_lock(&rli->data_lock);
+ recover_relay_log(mi);
+
+ const char* msg;
+ if (rli->init_relay_log_pos(rli->get_group_relay_log_name(),
+ rli->get_group_relay_log_pos(),
+ false/*need_data_lock=false*/,
+ &msg, 0))
+ {
+ char llbuf[22];
+ sql_print_error("Failed to open the relay log '%s' (relay_log_pos %s).",
+ rli->get_group_relay_log_name(),
+ llstr(rli->get_group_relay_log_pos(), llbuf));
+
+ recovery_error=1;
+ mysql_mutex_unlock(&mi->data_lock);
+ mysql_mutex_unlock(&rli->data_lock);
+ goto err;
+ }
+ if (mi->flush_info(true) || rli->flush_info(true))
+ {
+ recovery_error= 1;
+ mysql_mutex_unlock(&mi->data_lock);
+ mysql_mutex_unlock(&rli->data_lock);
+ goto err;
+ }
+ rli->inited=1;
+ rli->error_on_rli_init_info= false;
+ mysql_mutex_unlock(&mi->data_lock);
+ mysql_mutex_unlock(&rli->data_lock);
+ sql_print_information("MTS recovery: completed successfully.\n");
+ DBUG_RETURN(recovery_error);
+err:
+ /*
+ If recovery failed means we failed to initialize rli object in the case
+ of MTS. We should not allow the START SLAVE command to work as we do in
+ the case of STS. i.e if init_recovery call fails then we set inited=0.
+ */
+ rli->end_info();
+ rli->inited=0;
+ rli->error_on_rli_init_info= true;
+ DBUG_RETURN(recovery_error);
}
int global_init_info(Master_info* mi, bool ignore_if_no_info, int thread_mask)
*/
check_return= mi->check_info();
if (check_return == ERROR_CHECKING_REPOSITORY)
+ {
+ init_error= 1;
goto end;
+ }
if (!(ignore_if_no_info && check_return == REPOSITORY_DOES_NOT_EXIST))
{
check_return= mi->rli->check_info();
if (check_return == ERROR_CHECKING_REPOSITORY)
+ {
+ init_error= 1;
goto end;
+ }
if (!(ignore_if_no_info && check_return == REPOSITORY_DOES_NOT_EXIST))
{
if (((thread_mask & SLAVE_SQL) != 0 || !(mi->rli->inited))
mysql_mutex_unlock(&mi->rli->data_lock);
mysql_mutex_unlock(&mi->data_lock);
- DBUG_RETURN(check_return == ERROR_CHECKING_REPOSITORY || init_error);
+
+ /*
+ Handling MTS Relay-log recovery after successful initialization of mi and
+ rli objects.
+
+ MTS Relay-log recovery is handled by SSUG command. In order to start the
+ slave applier thread rli needs to be inited and mi->rli->data_lock should
+ be in released state. Hence we do the MTS recovery at this point of time
+ where both conditions are satisfied.
+ */
+ if (!init_error && mi->rli->is_relay_log_recovery
+ && mi->rli->mts_recovery_group_cnt)
+ init_error= fill_mts_gaps_and_recover(mi);
+ DBUG_RETURN(init_error);
}
void end_info(Master_info* mi)
while (*slave_running) // Should always be true
{
- int error __attribute__((unused));
+ int error MY_ATTRIBUTE((unused));
DBUG_PRINT("loop", ("killing slave thread"));
mysql_mutex_lock(&thd->LOCK_thd_data);
EINVAL: invalid signal number (can't happen)
ESRCH: thread already killed (can happen, should be ignored)
*/
- int err __attribute__((unused))= pthread_kill(thd->real_id, thr_client_alarm);
+ int err MY_ATTRIBUTE((unused))= pthread_kill(thd->real_id, thr_client_alarm);
DBUG_ASSERT(err != EINVAL);
#endif
thd->awake(THD::NOT_KILLED);
errorno == ER_CON_COUNT_ERROR ||
errorno == ER_SERVER_SHUTDOWN)
return TRUE;
+#ifdef WITH_WSREP
+ if (errorno == ER_UNKNOWN_COM_ERROR)
+ return TRUE;
+#endif /* WITH_WSREP */
return FALSE;
}
{
char query[256];
int ret= 0;
+ DBUG_EXECUTE_IF("fake_5_5_version_slave", return ret;);
sprintf(query, "SET @slave_uuid= '%s'", server_uuid);
if (mysql_real_query(mysql, query, strlen(query))
break;
case Relay_log_info::UNTIL_SQL_AFTER_MTS_GAPS:
until_type= "SQL_AFTER_MTS_GAPS";
-#ifndef DBUG_OFF
case Relay_log_info::UNTIL_DONE:
until_type= "DONE";
break;
-#endif
default:
DBUG_ASSERT(0);
}
rli->get_group_relay_log_pos(),
rli->get_group_master_log_name(),
rli->get_group_master_log_pos());
-#ifndef DBUG_OFF
- /*
+ /*
Few tests wait for UNTIL_SQL_AFTER_MTS_GAPS completion.
- Due to exisiting convention the status won't change
+ Due to exisiting convention the status won't change
prior to slave restarts.
So making of UNTIL_SQL_AFTER_MTS_GAPS completion isdone here,
and only in the debug build to make the test to catch the change
{
rli->until_condition= Relay_log_info::UNTIL_DONE;
}
-#endif
// reset the Worker tables to remove last slave session time info
if ((error= rli->mts_finalize_recovery()))
{
Hence deferred events wont be deleted here.
They will be deleted in Deferred_log_events::rewind() funciton.
*/
- WSREP_DEBUG("apply_event_and_update_pos result: %d", exec_res);
if (*ptr_ev)
{
DBUG_ASSERT(*ptr_ev == ev); // event remains to belong to Coordinator
/**
Reads next event from the relay log. Should be called from the
- slave IO thread.
+ slave SQL thread.
- @param rli Relay_log_info structure for the slave IO thread.
+ @param rli Relay_log_info structure for the slave SQL thread.
@return The event read, or NULL on error. If an error occurs, the
error is reported through the sql_print_information() or
We just have a read only log that nobody else will be updating.
*/
bool hot_log;
- if ((hot_log = (cur_log != &rli->cache_buf)))
+ if ((hot_log = (cur_log != &rli->cache_buf)) ||
+ DBUG_EVALUATE_IF("force_sql_thread_error", 1, 0))
{
DBUG_ASSERT(rli->cur_log_fd == -1); // foreign descriptor
mysql_mutex_lock(log_lock);
Reading xxx_file_id is safe because the log will only
be rotated when we hold relay_log.LOCK_log
*/
- if (rli->relay_log.get_open_count() != rli->cur_log_old_open_count)
+ if (rli->relay_log.get_open_count() != rli->cur_log_old_open_count &&
+ DBUG_EVALUATE_IF("force_sql_thread_error", 0, 1))
{
// The master has switched to a new log file; Reopen the old log file
cur_log=reopen_relay_log(rli, &errmsg);
error during a write by the slave I/O thread may have closed it), we
have to test it.
*/
- if (!my_b_inited(cur_log))
+ if (!my_b_inited(cur_log) ||
+ DBUG_EVALUATE_IF("force_sql_thread_error", 1, 0))
+ {
+ if (hot_log)
+ mysql_mutex_unlock(log_lock);
goto err;
+ }
#ifndef DBUG_OFF
{
DBUG_PRINT("info", ("assertion skip %lu file pos %lu event relay log pos %lu file %s\n",
(memcmp(fixed_in, master_ver, 3) > 0) &&
(pred == NULL || (*pred)(param)))
{
+ enum loglevel report_level= INFORMATION_LEVEL;
if (!report)
return TRUE;
// a short message for SHOW SLAVE STATUS (message length constraints)
" so slave stops; check error log on slave"
" for more info", MYF(0), bug_id);
// a verbose message for the error log
- rli->report(ERROR_LEVEL, ER_UNKNOWN_ERROR,
- "According to the master's version ('%s'),"
- " it is probable that master suffers from this bug:"
- " http://bugs.mysql.com/bug.php?id=%u"
- " and thus replicating the current binary log event"
- " may make the slave's data become different from the"
- " master's data."
- " To take no risk, slave refuses to replicate"
- " this event and stops."
- " We recommend that all updates be stopped on the"
- " master and slave, that the data of both be"
- " manually synchronized,"
- " that master's binary logs be deleted,"
- " that master be upgraded to a version at least"
- " equal to '%d.%d.%d'. Then replication can be"
- " restarted.",
- rli->get_rli_description_event()->server_version,
- bug_id,
- fixed_in[0], fixed_in[1], fixed_in[2]);
+ if (!ignored_error_code(ER_UNKNOWN_ERROR))
+ {
+ report_level= ERROR_LEVEL;
+ current_thd->is_slave_error= 1;
+ }
+ /* In case of ignored errors report warnings only if log_warnings > 1. */
+ else if (log_warnings > 1)
+ report_level= WARNING_LEVEL;
+
+ if (report_level != INFORMATION_LEVEL)
+ rli->report(report_level, ER_UNKNOWN_ERROR,
+ "According to the master's version ('%s'),"
+ " it is probable that master suffers from this bug:"
+ " http://bugs.mysql.com/bug.php?id=%u"
+ " and thus replicating the current binary log event"
+ " may make the slave's data become different from the"
+ " master's data."
+ " To take no risk, slave refuses to replicate"
+ " this event and stops."
+ " We recommend that all updates be stopped on the"
+ " master and slave, that the data of both be"
+ " manually synchronized,"
+ " that master's binary logs be deleted,"
+ " that master be upgraded to a version at least"
+ " equal to '%d.%d.%d'. Then replication can be"
+ " restarted.",
+ rli->get_rli_description_event()->server_version,
+ bug_id,
+ fixed_in[0], fixed_in[1], fixed_in[2]);
return TRUE;
}
}
-/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return length;
}
-#ifndef MYSQL_CLIENT
+#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
/**
*/
static void show_sql_type(enum_field_types type, uint16 metadata, String *str,
const char *tbl_name= table->s->table_name.str;
char source_buf[MAX_FIELD_WIDTH];
char target_buf[MAX_FIELD_WIDTH];
+ enum loglevel report_level= INFORMATION_LEVEL;
+
String source_type(source_buf, sizeof(source_buf), &my_charset_latin1);
String target_type(target_buf, sizeof(target_buf), &my_charset_latin1);
show_sql_type(type(col), field_metadata(col), &source_type, field->charset());
field->sql_type(target_type);
- rli->report(ERROR_LEVEL, ER_SLAVE_CONVERSION_FAILED,
- ER(ER_SLAVE_CONVERSION_FAILED),
- col, db_name, tbl_name,
- source_type.c_ptr_safe(), target_type.c_ptr_safe());
+ if (!ignored_error_code(ER_SLAVE_CONVERSION_FAILED))
+ {
+ report_level= ERROR_LEVEL;
+ thd->is_slave_error= 1;
+ }
+ /* In case of ignored errors report warnings only if log_warnings > 1. */
+ else if (log_warnings > 1)
+ report_level= WARNING_LEVEL;
+
+ if (report_level != INFORMATION_LEVEL)
+ rli->report(report_level, ER_SLAVE_CONVERSION_FAILED,
+ ER(ER_SLAVE_CONVERSION_FAILED),
+ col, db_name, tbl_name,
+ source_type.c_ptr_safe(), target_type.c_ptr_safe());
return false;
}
}
err:
if (conv_table == NULL)
- rli->report(ERROR_LEVEL, ER_SLAVE_CANT_CREATE_CONVERSION,
- ER(ER_SLAVE_CANT_CREATE_CONVERSION),
- target_table->s->db.str,
- target_table->s->table_name.str);
+ {
+ enum loglevel report_level= INFORMATION_LEVEL;
+ if (!ignored_error_code(ER_SLAVE_CANT_CREATE_CONVERSION))
+ {
+ report_level= ERROR_LEVEL;
+ thd->is_slave_error= 1;
+ }
+ /* In case of ignored errors report warnings only if log_warnings > 1. */
+ else if (log_warnings > 1)
+ report_level= WARNING_LEVEL;
+
+ if (report_level != INFORMATION_LEVEL)
+ rli->report(report_level, ER_SLAVE_CANT_CREATE_CONVERSION,
+ ER(ER_SLAVE_CANT_CREATE_CONVERSION),
+ target_table->s->db.str,
+ target_table->s->table_name.str);
+ }
DBUG_RETURN(conv_table);
}
static uchar*
hash_slave_rows_get_key(const uchar *record,
size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("get_key");
/*
- Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
bool sp_check_name(LEX_STRING *ident)
{
- if (!ident || !ident->str || !ident->str[0] ||
- ident->str[ident->length-1] == ' ')
+ DBUG_ASSERT(ident != NULL && ident->str != NULL);
+
+ if (!ident->str[0] || ident->str[ident->length-1] == ' ')
{
my_error(ER_SP_WRONG_NAME, MYF(0), ident->str);
return true;
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
-
+sql_authenticate
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
static uchar* acl_entry_get_key(acl_entry *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=(uint) entry->length;
return (uchar*) entry->key;
}
static uchar* check_get_key(ACL_USER *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=buff->host.get_host_len();
return (uchar*) buff->host.get_host();
goto end;
}
- if (!combo->uses_identified_by_clause &&
- !combo->uses_identified_with_clause &&
- !combo->uses_identified_by_password_clause)
+ if ((!combo->uses_identified_by_clause &&
+ !combo->uses_identified_with_clause &&
+ !combo->uses_identified_by_password_clause) ||
+ (combo->uses_identified_with_clause &&
+ (!my_strcasecmp(system_charset_info, combo->plugin.str,
+ native_password_plugin_name.str) ||
+ !my_strcasecmp(system_charset_info, combo->plugin.str,
+ old_password_plugin_name.str))))
{
if (check_password_policy(NULL))
{
static uchar* get_key_column(GRANT_COLUMN *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=buff->key_length;
return (uchar*) buff->column;
static uchar* get_grant_table(GRANT_NAME *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=buff->key_length;
return (uchar*) buff->hash_key;
thd->variables.sql_mode|= MODE_IGNORE_SPACE;
}
+/**
+ Assign priv_user and priv_host fields of the Security_context.
+
+ @param sctx Security context, which priv_user and priv_host fields are
+ updated.
+ @param user Authenticated user data.
+*/
+inline void
+assign_priv_user_host(Security_context *sctx, const ACL_USER *user)
+{
+ if (user->user)
+ strmake(sctx->priv_user, user->user, USERNAME_LENGTH - 1);
+ else
+ *sctx->priv_user= 0;
+
+ if (user->host.get_host())
+ strmake(sctx->priv_host, user->host.get_host(), MAX_HOSTNAME - 1);
+ else
+ *sctx->priv_host= 0;
+}
+
/**
Perform the handshake, authorize the client and update thd sctx variables.
res= CR_ERROR;
}
+ if (mpvio.can_authenticate())
+ assign_priv_user_host(sctx, acl_user);
+
if (res > CR_OK && mpvio.status != MPVIO_EXT::SUCCESS)
{
Host_errors errors;
#endif
sctx->master_access= acl_user->access;
- if (acl_user->user)
- strmake(sctx->priv_user, acl_user->user, USERNAME_LENGTH - 1);
- else
- *sctx->priv_user= 0;
-
- if (acl_user->host.get_host())
- strmake(sctx->priv_host, acl_user->host.get_host(), MAX_HOSTNAME - 1);
- else
- *sctx->priv_host= 0;
+ assign_priv_user_host(sctx, acl_user);
#ifndef NO_EMBEDDED_ACCESS_CHECKS
/*
/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
using std::min;
using std::max;
-int sortcmp2(void* cmp_arg __attribute__((unused)),
+int sortcmp2(void* cmp_arg MY_ATTRIBUTE((unused)),
const String *a,const String *b)
{
return sortcmp(a,b,a->charset());
}
-int compare_double2(void* cmp_arg __attribute__((unused)),
+int compare_double2(void* cmp_arg MY_ATTRIBUTE((unused)),
const double *s, const double *t)
{
return compare_double(s,t);
}
-int compare_longlong2(void* cmp_arg __attribute__((unused)),
+int compare_longlong2(void* cmp_arg MY_ATTRIBUTE((unused)),
const longlong *s, const longlong *t)
{
return compare_longlong(s,t);
}
-int compare_ulonglong2(void* cmp_arg __attribute__((unused)),
+int compare_ulonglong2(void* cmp_arg MY_ATTRIBUTE((unused)),
const ulonglong *s, const ulonglong *t)
{
return compare_ulonglong(s,t);
void field_real::get_opt_type(String *answer,
- ha_rows total_rows __attribute__((unused)))
+ ha_rows total_rows MY_ATTRIBUTE((unused)))
{
char buff[MAX_FIELD_WIDTH];
void field_longlong::get_opt_type(String *answer,
- ha_rows total_rows __attribute__((unused)))
+ ha_rows total_rows MY_ATTRIBUTE((unused)))
{
char buff[MAX_FIELD_WIDTH];
void field_ulonglong::get_opt_type(String *answer,
- ha_rows total_rows __attribute__((unused)))
+ ha_rows total_rows MY_ATTRIBUTE((unused)))
{
char buff[MAX_FIELD_WIDTH];
void field_decimal::get_opt_type(String *answer,
- ha_rows total_rows __attribute__((unused)))
+ ha_rows total_rows MY_ATTRIBUTE((unused)))
{
my_decimal zero;
char buff[MAX_FIELD_WIDTH];
int collect_string(String *element,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
TREE_INFO *info)
{
if (info->found)
} // collect_string
-int collect_real(double *element, element_count count __attribute__((unused)),
+int collect_real(double *element, element_count count MY_ATTRIBUTE((unused)),
TREE_INFO *info)
{
char buff[MAX_FIELD_WIDTH];
int collect_longlong(longlong *element,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
TREE_INFO *info)
{
char buff[MAX_FIELD_WIDTH];
int collect_ulonglong(ulonglong *element,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
TREE_INFO *info)
{
char buff[MAX_FIELD_WIDTH];
#ifndef SQL_ANALYSE_INCLUDED
#define SQL_ANALYSE_INCLUDED
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
bool get_ev_num_info(EV_NUM_INFO *ev_info, NUM_INFO *info, const char *num);
bool test_if_number(NUM_INFO *info, const char *str, uint str_len);
int compare_double(const double *s, const double *t);
-int compare_double2(void* cmp_arg __attribute__((unused)),
+int compare_double2(void* cmp_arg MY_ATTRIBUTE((unused)),
const double *s, const double *t);
int compare_longlong(const longlong *s, const longlong *t);
-int compare_longlong2(void* cmp_arg __attribute__((unused)),
+int compare_longlong2(void* cmp_arg MY_ATTRIBUTE((unused)),
const longlong *s, const longlong *t);
int compare_ulonglong(const ulonglong *s, const ulonglong *t);
-int compare_ulonglong2(void* cmp_arg __attribute__((unused)),
+int compare_ulonglong2(void* cmp_arg MY_ATTRIBUTE((unused)),
const ulonglong *s, const ulonglong *t);
int compare_decimal2(int* len, const char *s, const char *t);
void free_string(String*);
int collect_string(String *element, element_count count,
TREE_INFO *info);
-int sortcmp2(void* cmp_arg __attribute__((unused)),
+int sortcmp2(void* cmp_arg MY_ATTRIBUTE((unused)),
const String *a,const String *b);
class field_str :public field_info
void add();
void get_opt_type(String*, ha_rows);
- String *get_min_arg(String *not_used __attribute__((unused)))
+ String *get_min_arg(String *not_used MY_ATTRIBUTE((unused)))
{ return &min_arg; }
- String *get_max_arg(String *not_used __attribute__((unused)))
+ String *get_max_arg(String *not_used MY_ATTRIBUTE((unused)))
{ return &max_arg; }
String *avg(String *s, ha_rows rows)
{
TREE_INFO *info);
tree_walk_action collect_enum()
{ return (tree_walk_action) collect_string; }
- String *std(String *s __attribute__((unused)),
- ha_rows rows __attribute__((unused)))
+ String *std(String *s MY_ATTRIBUTE((unused)),
+ ha_rows rows MY_ATTRIBUTE((unused)))
{ return (String*) 0; }
};
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/** There's at least one active audit plugin tracking the general events */
-bool is_any_audit_plugin_active(THD *thd __attribute__((unused)))
+bool is_any_audit_plugin_active(THD *thd MY_ATTRIBUTE((unused)))
{
return (mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK);
}
-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#ifndef EMBEDDED_LIBRARY
extern void mysql_audit_notify(THD *thd, uint event_class,
uint event_subtype, ...);
-bool is_any_audit_plugin_active(THD *thd __attribute__((unused)));
+bool is_any_audit_plugin_active(THD *thd MY_ATTRIBUTE((unused)));
#else
#define mysql_audit_notify(...)
#endif
*****************************************************************************/
extern "C" uchar *table_def_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
TABLE_SHARE *entry=(TABLE_SHARE*) record;
*length= entry->table_cache_key.length;
while (found && ! thd->killed)
{
- WSREP_DEBUG("close_cached_tables, wait loop");
TABLE_SHARE *share;
found= FALSE;
/*
}
extern "C" uchar *schema_set_get_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
TABLE_LIST *table=(TABLE_LIST*) record;
*length= table->db_length;
&table_list->view->sroutines_list,
table_list->top_table());
}
+
+ /*
+ If a trigger was defined on one of the associated tables then assign the
+ 'trg_event_map' value of the view to the next table in table_list. When a
+ Stored function is invoked, all the associated tables including the tables
+ associated with the trigger are prelocked.
+ */
+ if (table_list->trg_event_map && table_list->next_global)
+ table_list->next_global->trg_event_map= table_list->trg_event_map;
return FALSE;
}
-/* Copyright (c) 2000, 2013, 2015, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
extern "C"
{
uchar *query_cache_table_get_key(const uchar *record, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
Query_cache_block* table_block = (Query_cache_block*) record;
*length = (table_block->used - table_block->headers_len() -
****************************************************************************/
extern "C" uchar *get_var_key(user_var_entry *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= entry->entry_name.length();
return (uchar*) entry->entry_name.ptr();
extern "C"
void thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond, mysql_mutex_t *mutex,
- const PSI_stage_info *stage, PSI_stage_info *old_stage)
+ const PSI_stage_info *stage, PSI_stage_info *old_stage,
+ const char *src_function, const char *src_file,
+ int src_line)
{
if (!thd)
thd= current_thd;
- return thd->ENTER_COND(cond, mutex, stage, old_stage);
+ return thd->enter_cond(cond, mutex, stage, old_stage,
+ src_function, src_file, src_line);
}
extern "C"
-void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage)
+void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage,
+ const char *src_function, const char *src_file,
+ int src_line)
{
if (!thd)
thd= current_thd;
- thd->EXIT_COND(stage);
+ thd->exit_cond(stage, src_function, src_file, src_line);
return;
}
extern "C" void wsrep_thd_set_conflict_state(
THD *thd, enum wsrep_conflict_state state)
{
- thd->wsrep_conflict_state= state;
+ if (WSREP(thd)) thd->wsrep_conflict_state= state;
}
return &thd->wsrep_ws_handle;
}
-extern "C"void wsrep_thd_LOCK(THD *thd)
+extern "C" void wsrep_thd_LOCK(THD *thd)
{
mysql_mutex_lock(&thd->LOCK_wsrep_thd);
}
-extern "C"void wsrep_thd_UNLOCK(THD *thd)
+extern "C" void wsrep_thd_UNLOCK(THD *thd)
{
mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
}
owned_gtid_set(global_sid_map),
main_da(0, false),
m_stmt_da(&main_da),
- duplicate_slave_uuid(false)
+ duplicate_slave_id(false)
{
ulong tmp;
wsrep_mysql_replicated = 0;
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
- wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+ wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED;
+ wsrep_affected_rows = 0;
+ wsrep_replicate_GTID = false;
#endif
/* Call to init() below requires fully initialized Open_tables_state. */
reset_open_tables_state();
thd->lex->current_select == 0 if lex structure is not inited
(not query command (COM_QUERY))
*/
+#ifdef WITH_WSREP
+ if (lex->current_select &&
+ lex->current_select->no_error && !is_fatal_error &&
+ (!(wsrep_conflict_state == ABORTED ||
+ wsrep_conflict_state == MUST_ABORT)))
+#else
if (lex->current_select &&
lex->current_select->no_error && !is_fatal_error)
+#endif
{
DBUG_PRINT("error",
("Error converted to warning: current_select: no_error %d "
wsrep_mysql_replicated = 0;
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
- wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+ wsrep_sync_wait_gtid = WSREP_GTID_UNDEFINED;
+ wsrep_affected_rows = 0;
+ wsrep_replicate_GTID = false;
#endif
binlog_row_event_extra_data= 0;
if (!thd_table->needs_reopen())
#ifdef WITH_WSREP
{
- signalled|= mysql_lock_abort_for_thread(this, thd_table);
- if (this && WSREP(this) && wsrep_thd_is_BF((void *)this, FALSE))
- {
- WSREP_DEBUG("remove_table_from_cache: %llu",
- (unsigned long long) this->real_id);
- wsrep_abort_thd((void *)this, (void *)in_use, FALSE);
- }
+ signalled|= mysql_lock_abort_for_thread(this, thd_table);
+ if (WSREP_NNULL(this) && wsrep_thd_is_BF((void *)this, FALSE))
+ {
+ WSREP_DEBUG("remove_table_from_cache: %llu",
+ (unsigned long long) this->real_id);
+ wsrep_abort_thd((void *)this, (void *)in_use, FALSE);
+ }
}
#else
signalled|= mysql_lock_abort_for_thread(this, thd_table);
#ifdef WITH_WSREP
wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+ if (!in_active_multi_stmt_transaction())
+ wsrep_affected_rows= 0;
#endif /* WITH_WSREP */
}
int
-select_dump::prepare(List<Item> &list __attribute__((unused)),
+select_dump::prepare(List<Item> &list MY_ATTRIBUTE((unused)),
SELECT_LEX_UNIT *u)
{
unit= u;
static uchar *
get_statement_id_as_hash_key(const uchar *record, size_t *key_length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
const Statement *statement= (const Statement *) record;
*key_length= sizeof(statement->id);
}
static uchar *get_stmt_name_hash_key(Statement *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= entry->name.length;
return (uchar*) entry->name.str;
extern "C" void xid_free_hash(void *);
uchar *xid_get_hash_key(const uchar *ptr, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=((XID_STATE*)ptr)->xid.key_length();
return ((XID_STATE*)ptr)->xid.key();
const char *calling_func,
const char *calling_file,
const unsigned int calling_line);
-
+extern "C"
+void thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond, mysql_mutex_t *mutex,
+ const PSI_stage_info *stage, PSI_stage_info *old_stage,
+ const char *src_function, const char *src_file,
+ int src_line);
+
+extern "C"
+void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage,
+ const char *src_function, const char *src_file,
+ int src_line);
+
#define THD_STAGE_INFO(thd, stage) \
(thd)->enter_stage(& stage, NULL, __func__, __FILE__, __LINE__)
ulong tx_isolation;
char *db;
size_t db_length;
+ struct timeval user_time;
+ longlong row_count_func;
};
#endif
class Reprepare_observer;
/**
Type of locked tables mode.
See comment for THD::locked_tables_mode for complete description.
+ While adding new enum values add them to the getter method for this enum
+ declared below and defined in binlog.cc as well.
*/
enum enum_locked_tables_mode
LTM_PRELOCKED_UNDER_LOCK_TABLES
};
+#ifndef DBUG_OFF
+/**
+ Getter for the enum enum_locked_tables_mode
+ @param locked_tables_mode enum for types of locked tables mode
+
+ @return The string represantation of that enum value
+*/
+const char * get_locked_tables_mode_name(enum_locked_tables_mode locked_tables_mode);
+#endif
/**
Class that holds information about tables which were opened and locked
void* wsrep_apply_format;
bool wsrep_apply_toi; /* applier processing in TOI */
wsrep_gtid_t wsrep_sync_wait_gtid;
+ ulong wsrep_affected_rows;
+ bool wsrep_replicate_GTID;
#endif /* WITH_WSREP */
/**
Internal parser state.
public:
/**
This is only used by master dump threads.
- When the master receives a new connection from a slave with a UUID that
- is already connected, it will set this flag TRUE before killing the old
- slave connection.
+ When the master receives a new connection from a slave with a
+ UUID (for slave versions >= 5.6)/server_id(for slave versions < 5.6)
+ that is already connected, it will set this flag TRUE
+ before killing the old slave connection.
*/
- bool duplicate_slave_uuid;
+ bool duplicate_slave_id;
};
/*
- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
extern "C" uchar *get_key_conn(user_conn *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= buff->len;
return (uchar*) buff->user;
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "character_set_client",
global_system_variables.character_set_client->csname);
return true;
- }
+ }
thd->variables.character_set_client=
global_system_variables.character_set_client;
thd->variables.collation_connection=
my_net_set_write_timeout(net, connect_timeout);
error= check_connection(thd);
+ MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd);
thd->protocol->end_statement();
if (error)
bool rc;
lex_start(thd);
rc= login_connection(thd);
- MYSQL_AUDIT_NOTIFY_CONNECTION_CONNECT(thd);
if (rc)
return rc;
-/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int send_result_set_metadata(THD *thd, List<Item> &send_result_set_metadata);
virtual bool is_open() const { return table != 0; }
- virtual int open(JOIN *join __attribute__((unused)));
+ virtual int open(JOIN *join MY_ATTRIBUTE((unused)));
virtual void fetch(ulong num_rows);
virtual void close();
virtual ~Materialized_cursor();
}
-int Materialized_cursor::open(JOIN *join __attribute__((unused)))
+int Materialized_cursor::open(JOIN *join MY_ATTRIBUTE((unused)))
{
THD *thd= fake_unit.thd;
int rc;
/*
- Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
my_bool not_used);
uchar* dboptions_get_key(my_dbopt_t *opt, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= opt->name_length;
return (uchar*) opt->name;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static void
update_tmptable_sum_func(Item_sum **func_ptr,
- TABLE *tmp_table __attribute__((unused)))
+ TABLE *tmp_table MY_ATTRIBUTE((unused)))
{
Item_sum *func;
while ((func= *(func_ptr++)))
/* ARGSUSED */
static int
-join_no_more_records(READ_RECORD *info __attribute__((unused)))
+join_no_more_records(READ_RECORD *info MY_ATTRIBUTE((unused)))
{
return -1;
}
/* ARGSUSED */
enum_nested_loop_state
-end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
+end_send_group(JOIN *join, JOIN_TAB *join_tab MY_ATTRIBUTE((unused)),
bool end_of_records)
{
int idx= -1;
Item *pos;
List_iterator_fast<Item> li(all_fields);
Copy_field *copy= NULL;
- Copy_field *copy_start __attribute__((unused));
+ Copy_field *copy_start MY_ATTRIBUTE((unused));
res_selected_fields.empty();
res_all_fields.empty();
List_iterator_fast<Item> itr(res_all_fields);
#ifndef SQL_EXECUTOR_INCLUDED
#define SQL_EXECUTOR_INCLUDED
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
/** Write function that would be used for saving records in tmp table. */
Next_select_func write_func;
enum_nested_loop_state put_record(bool end_of_records);
- __attribute__((warn_unused_result))
+ MY_ATTRIBUTE((warn_unused_result))
bool prepare_tmp_table();
};
-/* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
static char *mysql_ha_hash_get_key(TABLE_LIST *tables, size_t *key_len_p,
- my_bool first __attribute__((unused)))
+ my_bool first MY_ATTRIBUTE((unused)))
{
*key_len_p= strlen(tables->alias) + 1 ; /* include '\0' in comparisons */
return tables->alias;
insert_id_for_cur_row= table->file->insert_id_for_cur_row;
else
table->file->insert_id_for_cur_row= insert_id_for_cur_row;
- bool is_duplicate_key_error;
- if (table->file->is_fatal_error(error, HA_CHECK_DUP | HA_CHECK_FK_ERROR))
+
+ /*
+ If it is a FK constraint violation and 'ignore' flag is set,
+ report a warning instead of error.
+ */
+ if (ignore_errors && !table->file->is_fatal_error(error,
+ HA_CHECK_FK_ERROR))
+ goto ok_or_after_trg_err;
+
+ if (table->file->is_fatal_error(error, HA_CHECK_DUP))
goto err;
- is_duplicate_key_error= table->file->is_fatal_error(error, 0);
- if (!is_duplicate_key_error)
+
+ if (!table->file->is_fatal_error(error, 0))
{
/*
- We come here when we had an ignorable error which is not a duplicate
- key error. In this we ignore error if ignore flag is set, otherwise
- report error as usual. We will not do any duplicate key processing.
+ We come here when we have an ignorable error which is not a duplicate
+ key error or FK error(Ex: Partition related errors). In this case we
+ ignore the error if ignore flag is set, otherwise report error as usual.
+ We will not do any duplicate key processing.
*/
if (ignore_errors)
goto ok_or_after_trg_err; /* Ignoring a not fatal error, return 0 */
if (query_tables_last == &first_table->next_global)
query_tables_last= first_table->prev_global;
+ if (query_tables_own_last == &first_table->next_global)
+ query_tables_own_last= first_table->prev_global;
+
if ((next= *first_table->prev_global= first_table->next_global))
next->prev_global= first_table->prev_global;
/* include in new place */
*/
char *tdb= thd->db ? thd->db : db; // Result is never null
ulong skip_lines= ex->skip_lines;
- bool transactional_table __attribute__((unused));
+ bool transactional_table MY_ATTRIBUTE((unused));
DBUG_ENTER("mysql_load");
/*
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
return result;
}
-pthread_handler_t handle_manager(void *arg __attribute__((unused)))
+pthread_handler_t handle_manager(void *arg MY_ATTRIBUTE((unused)))
{
int error = 0;
struct timespec abstime;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
table_map *cached_eq_ref_tables, table_map
*eq_ref_tables);
+static bool can_switch_from_ref_to_range(THD *thd, JOIN_TAB *tab);
/**
global select optimisation.
{
return (void*) sql_alloc((uint) size);
}
- static void operator delete(void *ptr __attribute__((unused)),
- size_t size __attribute__((unused)))
+ static void operator delete(void *ptr MY_ATTRIBUTE((unused)),
+ size_t size MY_ATTRIBUTE((unused)))
{ TRASH(ptr, size); }
Item *and_level;
COND_EQUAL cond_equal;
cond_equal.upper_levels= inherited;
+ if (check_stack_overrun(thd, STACK_MIN_SIZE, NULL))
+ return cond;
+
if (cond->type() == Item::COND_ITEM)
{
List<Item> eq_list;
bool use_quick_range=0;
Item *tmp;
- /*
- Heuristic: Switch from 'ref' to 'range' access if 'range'
- access can utilize more keyparts than 'ref' access. Conditions
- for doing switching:
-
- 1) Current decision is to use 'ref' access
- 2) 'ref' access depends on a constant, not a value read from a
- table earlier in the join sequence.
-
- Rationale: if 'ref' depends on a value from another table,
- the join condition is not used to limit the rows read by
- 'range' access (that would require dynamic range - 'Range
- checked for each record'). In other words, if 'ref' depends
- on a value from another table, we have a query with
- conditions of the form
-
- this_table.idx_col1 = other_table.col AND <<- used by 'ref'
- this_table.idx_col1 OP <const> AND <<- used by 'range'
- this_table.idx_col2 OP <const> AND ... <<- used by 'range'
-
- and an index on (idx_col1,idx_col2,...). But the fact that
- 'range' access uses more keyparts does not mean that it is
- more selective than 'ref' access because these access types
- utilize different parts of the query condition. We
- therefore trust the cost based choice made by
- best_access_path() instead of forcing a heuristic choice
- here.
- 3) Range access is possible, and it is less costly than
- table/index scan
- 4) 'ref' access and 'range' access uses the same index
- 5) 'range' access uses more keyparts than 'ref' access
-
- @todo: This decision should rather be made in best_access_path()
- */
- if (tab->type == JT_REF && // 1)
- !tab->ref.depend_map && // 2)
- tab->quick && // 3)
- (uint) tab->ref.key == tab->quick->index && // 4)
- tab->ref.key_length < tab->quick->max_used_key_length) // 5)
+ /// See if you need to switch to range access
+ if (tab->type == JT_REF && can_switch_from_ref_to_range(thd, tab))
{
Opt_trace_object wrapper(trace);
Opt_trace_object (trace, "access_type_changed").
return true;
}
+/**
+ Heuristic: Switch from 'ref' to 'range' access if 'range' access can utilize
+ more keyparts than 'ref' access. Conditions for doing switching:
+
+ 1) 'ref' access depends on a constant, not a value read from a table earlier
+ in the join sequence.
+
+ Rationale: if 'ref' depends on a value from another table, the join condition
+ is not used to limit the rows read by 'range' access (that would require
+ dynamic range - 'Range checked for each record'). In other words, if 'ref'
+ depends on a value from another table, we have a query with conditions of
+ the form
+ this_table.idx_col1 = other_table.col AND <<- used by 'ref'
+ this_table.idx_col1 OP <const> AND <<- used by 'range'
+ this_table.idx_col2 OP <const> AND ... <<- used by 'range'
+
+ and an index on (idx_col1,idx_col2,...). But the fact that 'range' access
+ uses more keyparts does not mean that it is more selective than 'ref' access
+ because these access types utilize different parts of the query condition. We
+ therefore trust the cost based choice made by best_access_path() instead of
+ forcing a heuristic choice here.
+
+ 2) Range access is possible, and it is less costly than table/index scan.
+
+ 3a) 'ref' access and 'range' access uses the same index.
+ 3b) 'range' access uses more keyparts than 'ref' access
+
+ OR
+
+ 4) Ref has borrowed the index estimate from range and created a cost
+ estimate (See Optimize_table_order::find_best_ref). This will be a
+ problem if range built it's row estimate using a larger number of key
+ parts than ref. In such a case, shift to range access over the same
+ index. So run the range optimizer with that index as the only choice.
+ (Condition 5 is not relevant here since it has been tested in
+ find_best_ref.)
+
+ @param thd THD To re-run range optimizer.
+ @param tab JOIN_TAB To check the above conditions.
+
+ @return true Range is better than ref
+ @return false Ref is better or switch isn't possible
+
+ @todo: This decision should rather be made in best_access_path()
+*/
+static bool can_switch_from_ref_to_range(THD *thd, JOIN_TAB *tab)
+{
+ if (!tab->ref.depend_map && // 1)
+ tab->quick) // 2)
+ {
+ if ((uint) tab->ref.key == tab->quick->index && // 3a)
+ tab->ref.key_length < tab->quick->max_used_key_length) // 3b)
+ return true;
+ else if (tab->dodgy_ref_cost) // 4)
+ {
+ int error;
+ SQL_SELECT *select;
+ JOIN *join= tab->join;
+ select= make_select(tab->table, join->found_const_table_map,
+ join->found_const_table_map,
+ *tab->on_expr_ref ? *tab->on_expr_ref : join->conds,
+ 1, &error);
+
+ if (select)
+ {
+ Opt_trace_context * const trace= &thd->opt_trace;
+ Opt_trace_object trace_wrapper(trace);
+ Opt_trace_array
+ trace_setup_cond(trace,
+ "rerunning_range_optimizer_for_single_index");
+
+ key_map new_ref_key_map;
+ new_ref_key_map.set_bit(tab->position->key->key);
+ bool retcode= false;
+ if (select->test_quick_select(thd, new_ref_key_map, 0,
+ (join->select_options &
+ OPTION_FOUND_ROWS ? HA_POS_ERROR :
+ join->unit->select_limit_cnt),
+ false, // don't force quick range
+ ORDER::ORDER_NOT_RELEVANT) > 0)
+ {
+ delete tab->quick;
+ tab->quick= select->quick;
+ retcode= true;
+ }
+ select->quick= 0;
+ delete select;
+ return retcode;
+ }
+ }
+ }
+ return false;
+}
/**
Check if an expression in ORDER BY or GROUP BY is a duplicate of a
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "sql_insert.h" // mysql_insert
#include "sql_update.h" // mysql_update, mysql_multi_update
#include "sql_partition.h" // struct partition_info
+#ifdef WITH_PARTITION_STORAGE_ENGINE
+#include "partition_info.h" // has_external_data_or_index_dir
+#endif /* WITH_PARTITION_STORAGE_ENGINE */
#include "sql_db.h" // mysql_change_db, mysql_create_db,
// mysql_rm_db, mysql_upgrade_db,
// mysql_alter_db,
void init_update_queries(void)
{
/* Initialize the server command flags array. */
-#ifdef WITH_WSREP
memset(server_command_flags, 0, sizeof(server_command_flags));
- server_command_flags[COM_STATISTICS]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_PING]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_PREPARE]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_EXECUTE]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_FETCH]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_CLOSE]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_RESET]= CF_SKIP_QUESTIONS |
- CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_STMT_SEND_LONG_DATA] = CF_SKIP_WSREP_CHECK;
-
- server_command_flags[COM_QUIT]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_PROCESS_INFO]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_PROCESS_KILL]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_SHUTDOWN]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_SLEEP]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_TIME]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_INIT_DB]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_END]= CF_SKIP_WSREP_CHECK;
- /*
- COM_QUERY and COM_SET_OPTION are allowed to pass the early COM_xxx filter,
- they're checked later in mysql_execute_command().
- */
- server_command_flags[COM_QUERY]= CF_SKIP_WSREP_CHECK;
- server_command_flags[COM_SET_OPTION]= CF_SKIP_WSREP_CHECK;
-#else
server_command_flags[COM_STATISTICS]= CF_SKIP_QUESTIONS;
server_command_flags[COM_PING]= CF_SKIP_QUESTIONS;
server_command_flags[COM_STMT_PREPARE]= CF_SKIP_QUESTIONS;
server_command_flags[COM_STMT_CLOSE]= CF_SKIP_QUESTIONS;
server_command_flags[COM_STMT_RESET]= CF_SKIP_QUESTIONS;
+#ifdef WITH_WSREP
+ server_command_flags[COM_STATISTICS]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_PING]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_PREPARE]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_EXECUTE]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_FETCH]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_CLOSE]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_RESET]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_STMT_SEND_LONG_DATA]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_QUIT]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_PROCESS_INFO]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_PROCESS_KILL]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_SHUTDOWN]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_SLEEP]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_TIME]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_INIT_DB]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_END]|= CF_SKIP_WSREP_CHECK;
+
+ /*
+ COM_QUERY and COM_SET_OPTION are allowed to pass the early COM_xxx filter,
+ they're checked later in mysql_execute_command().
+ */
+ server_command_flags[COM_QUERY]|= CF_SKIP_WSREP_CHECK;
+ server_command_flags[COM_SET_OPTION]|= CF_SKIP_WSREP_CHECK;
#endif /* WITH_WSREP */
/* Initialize the sql command flags array. */
thd->enable_slow_log= TRUE;
thd->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
thd->set_time();
- if (!thd->is_valid_time())
+ if (thd->is_valid_time() == false)
{
/*
- If the time has got past 2038 we need to shut this server down
- We do this by making sure every command is a shutdown and we
- have enough privileges to shut the server down
-
- TODO: remove this when we have full 64 bit my_time_t support
+ If the time has gone past 2038 we need to shutdown the server. But
+ there is possibility of getting invalid time value on some platforms.
+ For example, gettimeofday() might return incorrect value on solaris
+ platform. Hence validating the current time with 5 iterations before
+ initiating the normal server shutdown process because of time getting
+ past 2038.
*/
- thd->security_ctx->master_access|= SHUTDOWN_ACL;
- command= COM_SHUTDOWN;
+ const int max_tries= 5;
+ sql_print_warning("Current time has got past year 2038. Validating current "
+ "time with %d iterations before initiating the normal "
+ "server shutdown process.", max_tries);
+
+ int tries= 0;
+ while (++tries <= max_tries)
+ {
+ thd->set_time();
+ if (thd->is_valid_time() == true)
+ {
+ sql_print_warning("Iteration %d: Obtained valid current time from "
+ "system", tries);
+ break;
+ }
+ sql_print_warning("Iteration %d: Current time obtained from system is "
+ "greater than 2038", tries);
+ }
+ if (tries > max_tries)
+ {
+ /*
+ If the time has got past 2038 we need to shut this server down.
+ We do this by making sure every command is a shutdown and we
+ have enough privileges to shut the server down
+
+ TODO: remove this when we have full 64 bit my_time_t support
+ */
+ sql_print_error("This MySQL server doesn't support dates later than 2038");
+ thd->security_ctx->master_access|= SHUTDOWN_ACL;
+ command= COM_SHUTDOWN;
+ }
}
thd->set_query_id(next_query_id());
inc_thread_running();
{
STATUS_VAR current_global_status_var;
ulong uptime;
- uint length __attribute__((unused));
+ uint length MY_ATTRIBUTE((unused));
ulonglong queries_per_second1000;
char buff[250];
uint buff_len= sizeof(buff);
thd->reset_query();
thd->set_command(COM_SLEEP);
+ thd->proc_info= 0;
/* Performance Schema Interface instrumentation, end */
MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
/* DTRACE instrumentation, end */
if (MYSQL_QUERY_DONE_ENABLED() || MYSQL_COMMAND_DONE_ENABLED())
{
- int res __attribute__((unused));
+ int res MY_ATTRIBUTE((unused));
res= (int) thd->is_error();
if (command == COM_QUERY)
{
copy.
*/
Alter_info alter_info(lex->alter_info, thd->mem_root);
-
if (thd->is_fatal_error)
{
/* If out of memory when creating a copy of alter_info. */
goto end_with_restore_list;
}
+ if (((lex->create_info.used_fields & HA_CREATE_USED_DATADIR) != 0 ||
+ (lex->create_info.used_fields & HA_CREATE_USED_INDEXDIR) != 0) &&
+ check_access(thd, FILE_ACL, NULL, NULL, NULL, FALSE, FALSE))
+ {
+ res= 1;
+ my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "FILE");
+ goto end_with_restore_list;
+ }
+
if ((res= create_table_precheck(thd, select_tables, create_table)))
goto end_with_restore_list;
#ifdef WITH_PARTITION_STORAGE_ENGINE
{
partition_info *part_info= thd->lex->part_info;
+ if (part_info != NULL && has_external_data_or_index_dir(*part_info) &&
+ check_access(thd, FILE_ACL, NULL, NULL, NULL, FALSE, FALSE))
+ {
+ res= -1;
+ goto end_with_restore_list;
+ }
if (part_info && !(part_info= thd->lex->part_info->get_clone(true)))
{
res= -1;
if (check_access(thd, UPDATE_ACL, "mysql", NULL, NULL, 1, 1) &&
check_global_access(thd, CREATE_USER_ACL))
break;
+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL)
/* Conditionally writes to binlog */
if (!(res= mysql_user_password_expire(thd, lex->users_list)))
my_ok(thd);
- Passing to check_stack_overrun() prevents the compiler from removing it.
*/
bool check_stack_overrun(THD *thd, long margin,
- uchar *buf __attribute__((unused)))
+ uchar *buf MY_ATTRIBUTE((unused)))
{
long stack_used;
DBUG_ASSERT(thd == current_thd);
void mysql_parse(THD *thd, char *rawbuf, uint length,
Parser_state *parser_state)
{
- int error __attribute__((unused));
+ int error MY_ATTRIBUTE((unused));
DBUG_ENTER("mysql_parse");
DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on(););
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
#define WSREP_TO_ISOLATION_END
+#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
#endif /* WITH_WSREP */
key_part_map const_part= 0;
/* The or-null keypart in ref-or-null access: */
key_part_map ref_or_null_part= 0;
+ /// Set dodgy_ref_cost only if that index is chosen for ref access.
+ bool is_dodgy= false;
/* Calculate how many key segments of the current key we can use */
Key_use *const start_key= keyuse;
if (!found_ref && table->quick_keys.is_set(key) && // (1)
table->quick_key_parts[key] > max_key_part && // (2)
records < (double)table->quick_rows[key]) // (3)
+ {
records= (double)table->quick_rows[key];
+ is_dodgy= true;
+ }
tmp= records;
}
}
}
done_with_index:
- trace_access_idx.add("chosen", best_key == start_key);
+ bool chosen= (best_key == start_key);
+ trace_access_idx.add("chosen", chosen);
+ if (chosen)
+ s->dodgy_ref_cost= is_dodgy;
} /* for each key */
records= best_records;
}
join state will not be reverted back to its initial state because we
don't "pop" tables already present in the partial plan.
*/
- bool is_interleave_error __attribute__((unused))=
+ bool is_interleave_error MY_ATTRIBUTE((unused))=
check_interleaving_with_nj (best_table);
/* This has been already checked by best_extension_by_limited_search */
DBUG_ASSERT(!is_interleave_error);
/*
- Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if ((sym= dlsym(plugin_dl.handle, list_of_services[i].name)))
{
uint ver= (uint)(intptr)*(void**)sym;
- if (ver > list_of_services[i].version ||
- (ver >> 8) < (list_of_services[i].version >> 8))
+ if ((*(void**)sym) != list_of_services[i].service && /* already replaced */
+ (ver > list_of_services[i].version ||
+ (ver >> 8) < (list_of_services[i].version >> 8)))
{
char buf[MYSQL_ERRMSG_SIZE];
my_snprintf(buf, sizeof(buf),
uchar *get_plugin_hash_key(const uchar *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
struct st_plugin_int *plugin= (st_plugin_int *)buff;
*length= (uint)plugin->name.length;
uchar *get_bookmark_hash_key(const uchar *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
struct st_bookmark *var= (st_bookmark *)buff;
*length= var->name_len + 1;
extern "C" my_bool get_one_plugin_option(int optid, const struct my_option *,
char *);
-my_bool get_one_plugin_option(int optid __attribute__((unused)),
+my_bool get_one_plugin_option(int optid MY_ATTRIBUTE((unused)),
const struct my_option *opt,
char *argument)
{
static my_bool check_if_option_is_deprecated(int optid,
const struct my_option *opt,
- char *argument __attribute__((unused)))
+ char *argument MY_ATTRIBUTE((unused)))
{
if (optid == -1)
{
LEX_STRING plugin_name;
char *varname;
int error;
- sys_var *v __attribute__((unused));
+ sys_var *v MY_ATTRIBUTE((unused));
struct st_bookmark *var;
uint len, count= EXTRA_OPTIONS;
DBUG_ENTER("test_plugin_options");
-/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
#else
static bool send_prep_stmt(Prepared_statement *stmt,
- uint columns __attribute__((unused)))
+ uint columns MY_ATTRIBUTE((unused)))
{
THD *thd= stmt->thd;
static bool insert_params_from_vars(Prepared_statement *stmt,
List<LEX_STRING>& varnames,
- String *query __attribute__((unused)))
+ String *query MY_ATTRIBUTE((unused)))
{
Item_param **begin= stmt->param_array;
Item_param **end= begin + stmt->param_count;
/* Go! */
if (open_cursor)
+ {
+ lex->safe_to_cache_query= 0;
error= mysql_open_cursor(thd, &result, &cursor);
+ }
else
{
/*
/* Store MYSQL_TIME (in binary format) */
bool Protocol_local::store(MYSQL_TIME *time,
- uint precision __attribute__((unused)))
+ uint precision MY_ATTRIBUTE((unused)))
{
return store_column(time, sizeof(MYSQL_TIME));
}
/** Store MYSQL_TIME (in binary format) */
bool Protocol_local::store_time(MYSQL_TIME *time,
- uint precision __attribute__((unused)))
+ uint precision MY_ATTRIBUTE((unused)))
{
return store_column(time, sizeof(MYSQL_TIME));
}
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
bool JOIN_TAB::and_with_condition(Item *add_cond, uint line)
{
- Item *old_cond __attribute__((unused))= m_condition;
+ Item *old_cond MY_ATTRIBUTE((unused))= m_condition;
if (and_conditions(&m_condition, add_cond))
return true;
DBUG_PRINT("info", ("JOIN_TAB::m_condition extended. Change %p -> %p "
#ifndef SQL_SELECT_INCLUDED
#define SQL_SELECT_INCLUDED
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/** TRUE <=> remove duplicates on this table. */
bool distinct;
+ /**
+ Setting this flag means ref is using lesser number of key parts than range
+ and it borrows range's row estimate.
+ */
+ bool dodgy_ref_cost;
+
/** Clean up associated table after query execution, including resources */
void cleanup();
inline bool is_using_loose_index_scan()
ref_array(NULL),
send_records(0),
having(NULL),
- distinct(false)
+ distinct(false),
+ dodgy_ref_cost(false)
{
/**
@todo Add constructor to READ_RECORD.
-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static uchar *servers_cache_get_key(FOREIGN_SERVER *server, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
DBUG_ENTER("servers_cache_get_key");
DBUG_PRINT("info", ("server_name_length %d server_name %s",
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static uchar *
db_dirs_hash_get_key(const uchar *data, size_t *len_ret,
- my_bool __attribute__((unused)))
+ my_bool MY_ATTRIBUTE((unused)))
{
LEX_STRING *e= (LEX_STRING *) data;
{
return (void*) sql_alloc((uint) size);
}
- static void operator delete(void *ptr __attribute__((unused)),
- size_t size __attribute__((unused)))
+ static void operator delete(void *ptr MY_ATTRIBUTE((unused)),
+ size_t size MY_ATTRIBUTE((unused)))
{ TRASH(ptr, size); }
ulong thread_id;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
* reserved.
This program is free software; you can redistribute it and/or modify
bool String::append(const String &s)
{
- DBUG_ASSERT(!this->uses_buffer_owned_by(&s));
- DBUG_ASSERT(!s.uses_buffer_owned_by(this));
if (s.length())
{
+ DBUG_ASSERT(!this->uses_buffer_owned_by(&s));
+ DBUG_ASSERT(!s.uses_buffer_owned_by(this));
+
if (realloc(str_length+s.length()))
return TRUE;
memcpy(Ptr+str_length,s.ptr(),s.length());
HA_CREATE_INFO *create_info);
static int
-mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
+mysql_prepare_create_table(THD *thd, const char *error_schema_name,
+ const char *error_table_name,
+ HA_CREATE_INFO *create_info,
Alter_info *alter_info,
bool tmp_table,
uint *db_options,
strxmov(shadow_frm_name, shadow_path, reg_ext, NullS);
if (flags & WFRM_WRITE_SHADOW)
{
- if (mysql_prepare_create_table(lpt->thd, lpt->create_info,
+ if (mysql_prepare_create_table(lpt->thd, lpt->db,
+ lpt->table_name,
+ lpt->create_info,
lpt->alter_info,
/*tmp_table*/ 1,
&lpt->db_options,
/**
Check if there is a duplicate key. Report a warning for every duplicate key.
- @param thd Thread context.
- @param key Key to be checked.
- @param key_info Key meta-data info.
- @param alter_info List of columns and indexes to create.
+ @param thd Thread context.
+ @param error_schema_name Schema name of the table used for error reporting.
+ @param error_table_name Table name used for error reporting.
+ @param key Key to be checked.
+ @param key_info Key meta-data info.
+ @param alter_info List of columns and indexes to create.
*/
-static void check_duplicate_key(THD *thd,
+static void check_duplicate_key(THD *thd, const char *error_schema_name,
+ const char *error_table_name,
Key *key, KEY *key_info,
Alter_info *alter_info)
{
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_DUP_INDEX, ER(ER_DUP_INDEX),
key_info->name,
- thd->lex->query_tables->db,
- thd->lex->query_tables->table_name);
+ error_schema_name,
+ error_table_name);
break;
}
}
SYNOPSIS
mysql_prepare_create_table()
thd Thread object.
+ error_schema_name Schema name of the table to create/alter,only
+ used for error reporting.
+ error_table_name Name of table to create/alter, only used for
+ error reporting.
create_info Create information (like MAX_ROWS).
alter_info List of columns and indexes to create
tmp_table If a temporary table is to be created.
*/
static int
-mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
+mysql_prepare_create_table(THD *thd, const char *error_schema_name,
+ const char *error_table_name,
+ HA_CREATE_INFO *create_info,
Alter_info *alter_info,
bool tmp_table,
uint *db_options,
else
key_info->flags|= HA_PACK_KEY;
}
- /* Check if the key segment is partial, set the key flag accordingly */
- if (key_part_length != sql_field->key_length)
- key_info->flags|= HA_KEY_HAS_PART_KEY_SEG;
+ /*
+ Check if the key segment is partial, set the key flag
+ accordingly. The key segment for a POINT column is NOT considered
+ partial if key_length==MAX_LEN_GEOM_POINT_FIELD.
+ */
+ if (key_part_length != sql_field->key_length &&
+ !(sql_field->sql_type == MYSQL_TYPE_GEOMETRY &&
+ sql_field->geom_type == Field::GEOM_POINT &&
+ key_part_length == MAX_LEN_GEOM_POINT_FIELD))
+ {
+ key_info->flags|= HA_KEY_HAS_PART_KEY_SEG;
+ }
key_length+= key_part_length;
key_part_info++;
}
// Check if a duplicate index is defined.
- check_duplicate_key(thd, key, key_info, alter_info);
+ check_duplicate_key(thd, error_schema_name, error_table_name,
+ key, key_info, alter_info);
key_info++;
}
@param thd Thread object
@param db Database
@param table_name Table name
+ @param error_table_name The real table name in case table_name is a temporary
+ table (ALTER). Only used for error messages.
@param path Path to table (i.e. to its .FRM file without
the extension).
@param create_info Create information (like MAX_ROWS)
static
bool create_table_impl(THD *thd,
const char *db, const char *table_name,
+ const char *error_table_name,
const char *path,
HA_CREATE_INFO *create_info,
Alter_info *alter_info,
}
#endif
- if (mysql_prepare_create_table(thd, create_info, alter_info,
+ if (mysql_prepare_create_table(thd, db, error_table_name,
+ create_info, alter_info,
internal_tmp_table,
&db_options, file,
key_info, key_count,
}
}
- return create_table_impl(thd, db, table_name, path, create_info, alter_info,
- false, select_field_count, false, is_trans,
- ¬_used_1, ¬_used_2);
+ return create_table_impl(thd, db, table_name, table_name, path, create_info,
+ alter_info, false, select_field_count, false,
+ is_trans, ¬_used_1, ¬_used_2);
}
*/
create_info->used_fields|= HA_CREATE_USED_ENGINE;
- int result __attribute__((unused))=
+ int result MY_ATTRIBUTE((unused))=
store_create_info(thd, table, &query,
create_info, TRUE /* show_database */);
KEY *key_info_buffer= NULL;
/* Create the prepared information. */
- if (mysql_prepare_create_table(thd, create_info,
- &tmp_alter_info,
+ if (mysql_prepare_create_table(thd, "", "",
+ create_info, &tmp_alter_info,
(table->s->tmp_table != NO_TMP_TABLE),
&db_options,
table->file, &key_info_buffer,
tmp_disable_binlog(thd);
error= create_table_impl(thd, alter_ctx.new_db, alter_ctx.tmp_name,
+ alter_ctx.table_name,
alter_ctx.get_tmp_path(),
create_info, alter_info,
true, 0, true, NULL,
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@param OUT str String to conver to
@param dec Number of fractional digits.
*/
-void make_time(const DATE_TIME_FORMAT *format __attribute__((unused)),
+void make_time(const DATE_TIME_FORMAT *format MY_ATTRIBUTE((unused)),
const MYSQL_TIME *l_time, String *str, uint dec)
{
uint length= (uint) my_time_to_str(l_time, (char*) str->ptr(), dec);
@param l_time DATE value
@param OUT str String to conver to
*/
-void make_date(const DATE_TIME_FORMAT *format __attribute__((unused)),
+void make_date(const DATE_TIME_FORMAT *format MY_ATTRIBUTE((unused)),
const MYSQL_TIME *l_time, String *str)
{
uint length= (uint) my_date_to_str(l_time, (char*) str->ptr());
@param OUT str String to conver to
@param dec Number of fractional digits.
*/
-void make_datetime(const DATE_TIME_FORMAT *format __attribute__((unused)),
+void make_datetime(const DATE_TIME_FORMAT *format MY_ATTRIBUTE((unused)),
const MYSQL_TIME *l_time, String *str, uint dec)
{
uint length= (uint) my_datetime_to_str(l_time, (char*) str->ptr(), dec);
-/* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
case Item::REF_ITEM:
case Item::NULL_ITEM:
case Item::VARBIN_ITEM:
+ case Item::PARAM_ITEM:
if (make_copy_field)
{
DBUG_ASSERT(((Item_result_field*)item)->result_field);
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern "C" uchar* get_hash_key(const uchar *buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
udf_func *udf=(udf_func*) buff;
*length=(uint) udf->name.length;
/* Update the table->file->stats.records number */
table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
- table->mark_columns_needed_for_update();
+ table->mark_columns_needed_for_update(false/*mark_binlog_columns=false*/);
select= make_select(table, 0, 0, conds, 0, &error);
{ // Enter scope for optimizer trace wrapper
#ifdef WITH_PARTITION_STORAGE_ENGINE
used_key_is_modified|= partition_key_modified(table, table->write_set);
#endif
-
+ table->mark_columns_per_binlog_row_image();
using_filesort= order && (need_sort||used_key_is_modified);
if (thd->lex->describe)
{
{
if (safe_update_on_fly(thd, join->join_tab, table_ref, all_tables))
{
- table->mark_columns_needed_for_update();
+ table->mark_columns_needed_for_update(true/*mark_binlog_columns=true*/);
table_to_update= table; // Update table on the fly
continue;
}
}
- table->mark_columns_needed_for_update();
+ table->mark_columns_needed_for_update(true/*mark_binlog_columns=true*/);
/*
enable uncacheable flag if we update a view with check option
<pre>
yyerrlab1:
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
- __attribute__ ((__unused__))
+ MY_ATTRIBUTE ((__unused__))
#endif
</pre>
- This usage of __attribute__ is illegal, so we remove it.
+ This usage of MY_ATTRIBUTE is illegal, so we remove it.
See the following references for details:
http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00014.html
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14273
*/
#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
-#undef __attribute__
-#define __attribute__(X)
+#undef MY_ATTRIBUTE
+#define MY_ATTRIBUTE(X)
#endif
ident_or_text
OPTIONS_SYM '(' server_options_list ')'
{
+ if ($2.length == 0)
+ {
+ my_error(ER_WRONG_VALUE, MYF(0), "server name", "");
+ MYSQL_YYABORT;
+ }
Lex->server_options.server_name= $2.str;
Lex->server_options.server_name_length= $2.length;
Lex->server_options.scheme= $6.str;
{
partition_info *part_info= Lex->part_info;
partition_element *p_elem= part_info->curr_part_elem;
+ if (check_string_char_length(&$1, "", NAME_CHAR_LEN,
+ system_charset_info, true))
+ {
+ my_error(ER_TOO_LONG_IDENT, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
p_elem->partition_name= $1.str;
}
;
sub_name:
ident_or_text
- { Lex->part_info->curr_part_elem->partition_name= $1.str; }
+ {
+ if (check_string_char_length(&$1, "", NAME_CHAR_LEN,
+ system_charset_info, true))
+ {
+ my_error(ER_TOO_LONG_IDENT, MYF(0), $1.str);
+ MYSQL_YYABORT;
+ }
+ Lex->part_info->curr_part_elem->partition_name= $1.str;
+ }
;
opt_part_options:
-/* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
"Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to files "
"within specified directory",
READ_ONLY GLOBAL_VAR(opt_secure_file_priv),
- CMD_LINE(REQUIRED_ARG), IN_FS_CHARSET, DEFAULT(0));
+#ifndef EMBEDDED_LIBRARY
+ CMD_LINE(REQUIRED_ARG), IN_FS_CHARSET, DEFAULT(DEFAULT_SECURE_FILE_PRIV_DIR));
+#else
+ CMD_LINE(REQUIRED_ARG), IN_FS_CHARSET, DEFAULT(DEFAULT_SECURE_FILE_PRIV_EMBEDDED_DIR));
+#endif
static bool fix_server_id(sys_var *self, THD *thd, enum_var_type type)
{
if (!var->save_result.string_value.str)
return true;
+ if (!is_valid_log_name(var->save_result.string_value.str,
+ var->save_result.string_value.length))
+ {
+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0),
+ self->name.str, var->save_result.string_value.str);
+ return true;
+ }
+
if (var->save_result.string_value.length > FN_REFLEN)
{ // path is too long
my_error(ER_PATH_LENGTH, MYF(0), self->name.str);
return false;
}
static bool fix_log(char** logname, const char* default_logname,
- const char*ext, bool enabled, void (*reopen)(char*))
+ const char*ext, bool enabled, bool (*reopen)(char*))
{
if (!*logname) // SET ... = DEFAULT
{
}
logger.lock_exclusive();
mysql_mutex_unlock(&LOCK_global_system_variables);
+ bool error= false;
if (enabled)
- reopen(*logname);
+ error= reopen(*logname);
logger.unlock();
mysql_mutex_lock(&LOCK_global_system_variables);
- return false;
+ return error;
}
-static void reopen_general_log(char* name)
+static bool reopen_general_log(char* name)
{
logger.get_log_file_handler()->close(0);
- logger.get_log_file_handler()->open_query_log(name);
+ return logger.get_log_file_handler()->open_query_log(name);
}
static bool fix_general_log_file(sys_var *self, THD *thd, enum_var_type type)
{
IN_FS_CHARSET, DEFAULT(0), NO_MUTEX_GUARD, NOT_IN_BINLOG,
ON_CHECK(check_log_path), ON_UPDATE(fix_general_log_file));
-static void reopen_slow_log(char* name)
+static bool reopen_slow_log(char* name)
{
logger.get_slow_log_file_handler()->close(0);
- logger.get_slow_log_file_handler()->open_slow_log(name);
+ return logger.get_slow_log_file_handler()->open_slow_log(name);
}
static bool fix_slow_log_file(sys_var *self, THD *thd, enum_var_type type)
{
static Sys_var_ulong Sys_wsrep_max_ws_size (
"wsrep_max_ws_size", "Max write set size (bytes)",
GLOBAL_VAR(wsrep_max_ws_size), CMD_LINE(REQUIRED_ARG),
- /* Upper limit is 65K short of 4G to avoid overlows on 32-bit systems */
- VALID_RANGE(1024, WSREP_MAX_WS_SIZE), DEFAULT(1073741824UL), BLOCK_SIZE(1));
+ VALID_RANGE(1024, WSREP_MAX_WS_SIZE), DEFAULT(WSREP_MAX_WS_SIZE),
+ BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
+ ON_UPDATE(wsrep_max_ws_size_update));
static Sys_var_ulong Sys_wsrep_max_ws_rows (
"wsrep_max_ws_rows", "Max number of rows in write set",
GLOBAL_VAR(wsrep_max_ws_rows), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(1, 1048576), DEFAULT(131072), BLOCK_SIZE(1));
+ VALID_RANGE(0, 1048576), DEFAULT(0), BLOCK_SIZE(1));
static Sys_var_charptr Sys_wsrep_notify_cmd(
"wsrep_notify_cmd", "",
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Get column name from column hash */
static uchar *get_field_name(Field **buff, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= (uint) strlen((*buff)->field_name);
return (uchar*) (*buff)->field_name;
/* Fix key->name and key_part->field */
if (key_parts)
{
- uint primary_key=(uint) (find_type(primary_key_name, &share->keynames,
- FIND_TYPE_NO_PREFIX) - 1);
+ const int pk_off= find_type(primary_key_name, &share->keynames,
+ FIND_TYPE_NO_PREFIX);
+ uint primary_key= (pk_off > 0 ? pk_off-1 : MAX_KEY);
+
longlong ha_option= handler_file->ha_table_flags();
keyinfo= share->key_info;
key_part= keyinfo->key_part;
@brief
Mark columns needed for doing an update of a row
+ @param mark_binlog_columns if true, mark columns as per binlog_row_image
+ requirements.
@details
Some engines needs to have all columns in an update (to be able to
build a complete row). If this is the case, we mark all not
updated columns to be read.
- If this is no the case, we do like in the delete case and mark
+ If this is not the case, we do like in the delete case and mark
if neeed, either the primary key column or all columns to be read.
(see mark_columns_needed_for_delete() for details)
mark all USED key columns as 'to-be-read'. This allows the engine to
loop over the given record to find all changed keys and doesn't have to
retrieve the row again.
-
+
Unlike other similar methods, it doesn't mark fields used by triggers,
that is the responsibility of the caller to do, by using
Table_triggers_list::mark_used_fields(TRG_EVENT_UPDATE)!
+
+ Note: Marking additional columns as per binlog_row_image requirements will
+ influence query execution plan. For example in the case of
+ binlog_row_image=FULL the entire read_set and write_set needs to be flagged.
+ This will influence update query to think that 'used key is being modified'
+ and query will create a temporary table to process the update operation.
+ Which will result in performance degradation. Hence callers who don't want
+ their query execution to be influenced as per binlog_row_image requirements
+ can skip marking binlog specific columns here and they should make an
+ explicit call to 'mark_columns_per_binlog_row_image()' function to mark
+ binlog_row_image specific columns.
*/
-void TABLE::mark_columns_needed_for_update()
+void TABLE::mark_columns_needed_for_update(bool mark_binlog_columns)
{
DBUG_ENTER("mark_columns_needed_for_update");
- mark_columns_per_binlog_row_image();
+
+ if (mark_binlog_columns)
+ mark_columns_per_binlog_row_image();
if (file->ha_table_flags() & HA_REQUIRES_KEY_COLUMNS_FOR_DELETE)
{
/* Mark all used key columns for read */
#ifndef TABLE_INCLUDED
#define TABLE_INCLUDED
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
void mark_columns_used_by_index_no_reset(uint index, MY_BITMAP *map);
void mark_columns_used_by_index(uint index);
void mark_auto_increment_column(void);
- void mark_columns_needed_for_update(void);
+ void mark_columns_needed_for_update(bool mark_binlog_columns);
void mark_columns_needed_for_delete(void);
void mark_columns_needed_for_insert(void);
void mark_columns_per_binlog_row_image(void);
-/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 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
extern "C" uchar *table_cache_key(const uchar *record,
size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
TABLE_SHARE *share= ((Table_cache_element*)record)->get_share();
*length= share->table_cache_key.length;
#ifdef WITH_WSREP
bool mdl_can_safely_rollback_to_savepoint=
(!((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open())
- && thd->variables.sql_log_bin) ||
+ && thd->variables.sql_log_bin) ||
ha_rollback_to_savepoint_can_release_mdl(thd));
#else
bool mdl_can_safely_rollback_to_savepoint=
-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern "C" uchar *
my_tz_names_get_key(Tz_names_entry *entry, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= entry->name.length();
return (uchar*) entry->name.ptr();
extern "C" uchar *
my_offset_tzs_get_key(Time_zone_offset *entry,
size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= sizeof(long);
return (uchar*) &entry->offset;
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
****************************************************************************/
-void metaphon_deinit(UDF_INIT *initid __attribute__((unused)))
+void metaphon_deinit(UDF_INIT *initid MY_ATTRIBUTE((unused)))
{
}
#define NOGHTOF(x) (codes[(x) - 'A'] & 16) /* BDH */
-char *metaphon(UDF_INIT *initid __attribute__((unused)),
+char *metaphon(UDF_INIT *initid MY_ATTRIBUTE((unused)),
UDF_ARGS *args, char *result, unsigned long *length,
- char *is_null, char *error __attribute__((unused)))
+ char *is_null, char *error MY_ATTRIBUTE((unused)))
{
const char *word=args->args[0];
const char *w_end;
}
-double myfunc_double(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
- char *is_null, char *error __attribute__((unused)))
+double myfunc_double(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
+ char *is_null, char *error MY_ATTRIBUTE((unused)))
{
unsigned long val = 0;
unsigned long v = 0;
/* This function returns the sum of all arguments */
-longlong myfunc_int(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
- char *is_null __attribute__((unused)),
- char *error __attribute__((unused)))
+longlong myfunc_int(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
+ char *is_null MY_ATTRIBUTE((unused)),
+ char *error MY_ATTRIBUTE((unused)))
{
longlong val = 0;
uint i;
At least one of _init/_deinit is needed unless the server is started
with --allow_suspicious_udfs.
*/
-my_bool myfunc_int_init(UDF_INIT *initid __attribute__((unused)),
- UDF_ARGS *args __attribute__((unused)),
- char *message __attribute__((unused)))
+my_bool myfunc_int_init(UDF_INIT *initid MY_ATTRIBUTE((unused)),
+ UDF_ARGS *args MY_ATTRIBUTE((unused)),
+ char *message MY_ATTRIBUTE((unused)))
{
return 0;
}
free(initid->ptr);
}
-longlong sequence(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
- char *is_null __attribute__((unused)),
- char *error __attribute__((unused)))
+longlong sequence(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
+ char *is_null MY_ATTRIBUTE((unused)),
+ char *error MY_ATTRIBUTE((unused)))
{
ulonglong val=0;
if (args->arg_count)
return 0;
}
-void lookup_deinit(UDF_INIT *initid __attribute__((unused)))
+void lookup_deinit(UDF_INIT *initid MY_ATTRIBUTE((unused)))
{
#if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
(void) pthread_mutex_destroy(&LOCK_hostname);
#endif
}
-char *lookup(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
+char *lookup(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
char *result, unsigned long *res_length, char *null_value,
- char *error __attribute__((unused)))
+ char *error MY_ATTRIBUTE((unused)))
{
uint length;
char name_buff[256];
return 0;
}
-void reverse_lookup_deinit(UDF_INIT *initid __attribute__((unused)))
+void reverse_lookup_deinit(UDF_INIT *initid MY_ATTRIBUTE((unused)))
{
#if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
(void) pthread_mutex_destroy(&LOCK_hostname);
#endif
}
-char *reverse_lookup(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
+char *reverse_lookup(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
char *result, unsigned long *res_length,
- char *null_value, char *error __attribute__((unused)))
+ char *null_value, char *error MY_ATTRIBUTE((unused)))
{
#if defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST)
char name_buff[256];
/* This is needed to get things to work in MySQL 4.1.1 and above */
void
-avgcost_clear(UDF_INIT* initid, char* is_null __attribute__((unused)),
- char* message __attribute__((unused)))
+avgcost_clear(UDF_INIT* initid, char* is_null MY_ATTRIBUTE((unused)),
+ char* message MY_ATTRIBUTE((unused)))
{
struct avgcost_data* data = (struct avgcost_data*)initid->ptr;
data->totalprice= 0.0;
void
avgcost_add(UDF_INIT* initid, UDF_ARGS* args,
- char* is_null __attribute__((unused)),
- char* message __attribute__((unused)))
+ char* is_null MY_ATTRIBUTE((unused)),
+ char* message MY_ATTRIBUTE((unused)))
{
if (args->args[0] && args->args[1])
{
double
-avgcost( UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)),
- char* is_null, char* error __attribute__((unused)))
+avgcost( UDF_INIT* initid, UDF_ARGS* args MY_ATTRIBUTE((unused)),
+ char* is_null, char* error MY_ATTRIBUTE((unused)))
{
struct avgcost_data* data = (struct avgcost_data*)initid->ptr;
if (!data->count || !data->totalquantity)
return 0;
}
-char *myfunc_argument_name(UDF_INIT *initid __attribute__((unused)),
+char *myfunc_argument_name(UDF_INIT *initid MY_ATTRIBUTE((unused)),
UDF_ARGS *args, char *result,
unsigned long *length, char *null_value,
- char *error __attribute__((unused)))
+ char *error MY_ATTRIBUTE((unused)))
{
if (!args->attributes[0])
{
return 0;
}
-char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
+char * is_const(UDF_INIT *initid, UDF_ARGS *args MY_ATTRIBUTE((unused)),
char *result, unsigned long *length,
- char *is_null, char *error __attribute__((unused)))
+ char *is_null, char *error MY_ATTRIBUTE((unused)))
{
if (initid->ptr != 0) {
sprintf(result, "const");
}
extern "C"
-char * check_const_len(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
+char * check_const_len(UDF_INIT *initid, UDF_ARGS *args MY_ATTRIBUTE((unused)),
char *result, unsigned long *length,
- char *is_null, char *error __attribute__((unused)))
+ char *is_null, char *error MY_ATTRIBUTE((unused)))
{
strmov(result, initid->ptr);
*length= (uint) strlen(result);
}
void my_median_add(UDF_INIT* initid, UDF_ARGS* args,
- char* is_null __attribute__((unused)),
- char* message __attribute__((unused)))
+ char* is_null MY_ATTRIBUTE((unused)),
+ char* message MY_ATTRIBUTE((unused)))
{
My_median_data *data=
static_cast<My_median_data*>(static_cast<void*>(initid->ptr));
}
void my_median_clear(UDF_INIT* initid, UDF_ARGS* args,
- char* is_null __attribute__((unused)),
- char* message __attribute__((unused)))
+ char* is_null MY_ATTRIBUTE((unused)),
+ char* message MY_ATTRIBUTE((unused)))
{
My_median_data *data=
static_cast<My_median_data*>(static_cast<void*>(initid->ptr));
longlong my_median(UDF_INIT* initid, UDF_ARGS* args,
char* is_null,
- char* message __attribute__((unused)))
+ char* message MY_ATTRIBUTE((unused)))
{
My_median_data *data=
static_cast<My_median_data*>(static_cast<void*>(initid->ptr));
const char *error= 0;
Log_event *res= 0;
- if (data_len > wsrep_max_ws_size)
- {
- error = "Event too big";
- goto err;
- }
-
res= Log_event::read_log_event(buf, data_len, &error, description_event, 0);
-err:
if (!res)
{
DBUG_ASSERT(error != 0);
#include "sql_class.h" // THD, IO_CACHE
#define HEAP_PAGE_SIZE 65536 /* 64K */
-#define WSREP_MAX_WS_SIZE (0xFFFFFFFFUL - HEAP_PAGE_SIZE)
+#define WSREP_MAX_WS_SIZE 2147483647 /* 2GB */
/*
Write the contents of a cache to a memory buffer.
*/
void wsrep_cleanup_transaction(THD *thd)
{
+ if (!WSREP(thd)) return;
+
if (wsrep_emulate_bin_log) thd_binlog_trx_reset(thd);
thd->wsrep_ws_handle.trx_id= WSREP_UNDEFINED_TRX_ID;
thd->wsrep_trx_meta.gtid= WSREP_GTID_UNDEFINED;
thd->wsrep_trx_meta.depends_on= WSREP_SEQNO_UNDEFINED;
thd->wsrep_exec_mode= LOCAL_STATE;
+ thd->wsrep_affected_rows= 0;
return;
}
*/
void wsrep_post_commit(THD* thd, bool all)
{
+ if (!WSREP(thd)) return;
+
switch (thd->wsrep_exec_mode)
{
case LOCAL_COMMIT:
int replay_round= 0;
if (thd->get_stmt_da()->is_error()) {
- WSREP_ERROR("commit issue, error: %d %s",
+ WSREP_DEBUG("commit issue, error: %d %s",
thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message());
}
"wsrep status (%d %d %d)",
WSREP_QUERY(thd),
thd->get_stmt_da()->affected_rows(),
- stmt_has_updated_trans_table(thd), thd->variables.sql_log_bin,
+ stmt_has_updated_trans_table(thd->transaction.stmt.ha_list),
+ thd->variables.sql_log_bin,
thd->wsrep_exec_mode, thd->wsrep_query_state,
thd->wsrep_conflict_state);
}
set to NO_CONFLICT and commit proceeds as usual.
*/
if (thd->wsrep_conflict_state == MUST_ABORT)
- thd->wsrep_conflict_state= NO_CONFLICT;
+ {
+ thd->killed= THD::NOT_KILLED;
+ thd->wsrep_conflict_state= NO_CONFLICT;
+ }
if (thd->wsrep_conflict_state != NO_CONFLICT)
{
DBUG_RETURN(WSREP_TRX_OK);
}
+bool wsrep_replicate_GTID(THD *thd)
+{
+ if (thd->slave_thread)
+ {
+ WSREP_DEBUG("GTID replication");
+ DBUG_ASSERT (WSREP_UNDEFINED_TRX_ID == thd->wsrep_ws_handle.trx_id);
+ (void)wsrep_ws_handle_for_trx(&thd->wsrep_ws_handle, thd->query_id);
+ DBUG_ASSERT (WSREP_UNDEFINED_TRX_ID != thd->wsrep_ws_handle.trx_id);
+ WSREP_DEBUG("slave trx using query ID %lu for replication GTID",
+ thd->wsrep_ws_handle.trx_id);
+ enum wsrep_trx_status rcode= wsrep_run_wsrep_commit(thd, wsrep_hton, true);
+ if (rcode)
+ {
+ /*
+ TODO: should error here cause stopping of MySQL slave?
+ Slave applying was totally filtered out, and fauílure in replicating
+ GTID event, would cause a hole in GTID history in other cluster nodes
+
+ */
+ WSREP_INFO("GTID replication failed: %d", rcode);
+ wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle);
+ thd->wsrep_replicate_GTID= false;
+ my_message(ER_ERROR_DURING_COMMIT,
+ "WSREP GTID replication was interrupted", MYF(0));
+ return true;
+ }
+ wsrep_post_commit(thd, true);
+ }
+ thd->wsrep_replicate_GTID= false;
+
+ return false;
+}
static int wsrep_hton_init(void *p)
{
* End configuration options
*/
-static const wsrep_uuid_t cluster_uuid = WSREP_UUID_UNDEFINED;
+static wsrep_uuid_t cluster_uuid = WSREP_UUID_UNDEFINED;
static char cluster_uuid_str[40]= { 0, };
static const char* cluster_status_str[WSREP_VIEW_MAX] =
{
if (memcmp(&cluster_uuid, &view->state_id.uuid, sizeof(wsrep_uuid_t)))
{
- memcpy((wsrep_uuid_t*)&cluster_uuid, &view->state_id.uuid,
- sizeof(cluster_uuid));
+ memcpy(&cluster_uuid, &view->state_id.uuid, sizeof(cluster_uuid));
wsrep_uuid_print (&cluster_uuid, cluster_uuid_str,
sizeof(cluster_uuid_str));
WSREP_ERROR("wsrep_load(%s) failed: %s (%d). Reverting to no provider.",
wsrep_provider, strerror(rcode), rcode);
strcpy((char*)wsrep_provider, WSREP_NONE); // damn it's a dirty hack
- (void) wsrep_init();
- return rcode;
+ return wsrep_init();
}
else /* this is for recursive call above */
{
wsrep_thr_lock_init(wsrep_thd_is_BF, wsrep_abort_thd,
wsrep_debug, wsrep_convert_LOCK_to_trx, wsrep_on);
+ /* Skip replication start if dummy wsrep provider is loaded */
+ if (!strcmp(wsrep_provider, WSREP_NONE)) return;
+
/* Skip replication start if no cluster address */
if (!wsrep_cluster_address || strlen(wsrep_cluster_address) == 0) return;
if (buf) my_free(buf);
wsrep_keys_free(&key_arr);
WSREP_DEBUG("TO BEGIN: %lld, %d",(long long)wsrep_thd_trx_seqno(thd),
- thd->wsrep_exec_mode);
+ thd->wsrep_exec_mode);
}
else if (key_arr.keys_len > 0) {
/* jump to error handler in mysql_execute_command() */
"connection state and retry the query.",
ret, (thd->db ? thd->db : "(null)"), WSREP_QUERY(thd));
my_error(ER_LOCK_DEADLOCK, MYF(0), "WSREP replication failed. Check "
- "your wsrep connection state and retry the query.");
+ "your wsrep connection state and retry the query.");
if (buf) my_free(buf);
wsrep_keys_free(&key_arr);
return -1;
else {
/* non replicated DDL, affecting temporary tables only */
WSREP_DEBUG("TO isolation skipped for: %d, sql: %s."
- "Only temporary tables affected.",
- ret, WSREP_QUERY(thd));
+ "Only temporary tables affected.",
+ ret, WSREP_QUERY(thd));
return 1;
}
return 0;
/* Other global variables */
extern wsrep_seqno_t wsrep_locked_seqno;
-#define WSREP_ON \
- (global_system_variables.wsrep_on)
+#define WSREP_ON \
+ ((global_system_variables.wsrep_on) && \
+ wsrep_provider && \
+ strcmp(wsrep_provider, WSREP_NONE))
+
+/* use xxxxxx_NNULL macros when thd pointer is guaranteed to be non-null to
+ * avoid compiler warnings (GCC 6 and later) */
+#define WSREP_NNULL(thd) \
+ (WSREP_ON && wsrep && thd->variables.wsrep_on)
#define WSREP(thd) \
- (WSREP_ON && wsrep && (thd && thd->variables.wsrep_on))
+ (thd && WSREP_NNULL(thd))
#define WSREP_CLIENT(thd) \
- (WSREP(thd) && thd->wsrep_client_thread)
+ (WSREP(thd) && thd->wsrep_client_thread)
+
+#define WSREP_EMULATE_BINLOG_NNULL(thd) \
+ (WSREP_NNULL(thd) && wsrep_emulate_bin_log)
#define WSREP_EMULATE_BINLOG(thd) \
(WSREP(thd) && wsrep_emulate_bin_log)
void wsrep_init_sidno(const wsrep_uuid_t&);
bool wsrep_node_is_donor();
bool wsrep_node_is_synced();
+bool wsrep_replicate_GTID(THD* thd);
+
#endif /* WSREP_MYSQLD_H */
"%s",
host, port, mysqld_port, mysqld_unix_port,
wsrep_defaults_file, uuid_str,
- (long long)seqno, bypass ? " "WSREP_SST_OPT_BYPASS : "");
+ (long long)seqno, bypass ? " " WSREP_SST_OPT_BYPASS : "");
if (ret < 0 || ret >= cmd_len)
{
wsrep_defaults_file, wsrep_defaults_group_suffix,
binlog_opt, binlog_opt_val,
uuid, (long long) seqno,
- bypass ? " "WSREP_SST_OPT_BYPASS : "");
+ bypass ? " " WSREP_SST_OPT_BYPASS : "");
my_free(binlog_opt_val);
if (ret < 0 || ret >= cmd_len)
/* must have (&thd->LOCK_wsrep_thd) */
void wsrep_client_rollback(THD *thd)
{
- WSREP_DEBUG("client rollback due to BF abort for (%ld), query: %s",
- thd->thread_id, WSREP_QUERY(thd));
+ WSREP_DEBUG("client rollback due to BF abort for (%ld %lld), query: %s",
+ thd->thread_id, thd->query_id, WSREP_QUERY(thd));
my_atomic_add64(&wsrep_bf_aborts_counter, 1);
thd->wsrep_conflict_state= ABORTING;
mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
- trans_rollback(thd);
+ if (trans_rollback(thd))
+ {
+ WSREP_WARN("client rollback failed for: %lu %lld, conf: %d",
+ thd->thread_id, thd->query_id, thd->wsrep_conflict_state);
+ }
if (thd->locked_tables_mode && thd->lock)
{
new Format_description_log_event(BINLOG_VERSION));
return (rli);
-
-#ifdef REMOVED
- Rpl_info_handler* handler_src= NULL;
- Rpl_info_handler* handler_dest= NULL;
- ulong *key_info_idx= NULL;
- const char *msg= "Failed to allocate memory for the relay log info "
- "structure";
-
- DBUG_ENTER("Rpl_info_factory::create_rli");
-
- if (!(rli= new Relay_log_info(false
-#ifdef HAVE_PSI_INTERFACE
- ,&key_relay_log_info_run_lock,
- &key_relay_log_info_data_lock,
- &key_relay_log_info_sleep_lock,
- &key_relay_log_info_data_cond,
- &key_relay_log_info_start_cond,
- &key_relay_log_info_stop_cond,
- &key_relay_log_info_sleep_cond
-#endif /* HAVE_PSI_INTERFACE */
- )))
- goto err;
-
- if (!(key_info_idx= new ulong[NUMBER_OF_FIELDS_TO_IDENTIFY_COORDINATOR]))
- goto err;
- key_info_idx[0]= server_id;
- rli->set_idx_info(key_info_idx, NUMBER_OF_FIELDS_TO_IDENTIFY_COORDINATOR);
-
- if(Rpl_info_factory::init_rli_repositories(rli, rli_option, &handler_src,
- &handler_dest, &msg))
- goto err;
-
- if (Rpl_info_factory::decide_repository(rli, rli_option, &handler_src,
- &handler_dest, &msg))
- goto err;
-
- DBUG_RETURN(rli);
-err:
- delete handler_src;
- delete handler_dest;
- delete []key_info_idx;
- if (rli)
- {
- /*
- The handler was previously deleted so we need to remove
- any reference to it.
- */
- rli->set_idx_info(NULL, 0);
- rli->set_rpl_info_handler(NULL);
- rli->set_rpl_info_type(INVALID_INFO_REPOSITORY);
- delete rli;
- }
- WSREP_ERROR("Error creating relay log info: %s.", msg);
- DBUG_RETURN(NULL);
-#endif /* REMOVED */
}
static void wsrep_prepare_bf_thd(THD *thd, struct wsrep_thd_shadow* shadow)
shadow->db = thd->db;
shadow->db_length = thd->db_length;
thd->reset_db(NULL, 0);
+
+ shadow->user_time = thd->user_time;
+ shadow->row_count_func= thd->get_row_count_func();
}
static void wsrep_return_from_bf_mode(THD *thd, struct wsrep_thd_shadow* shadow)
thd->net.vio = shadow->vio;
thd->variables.tx_isolation = shadow->tx_isolation;
thd->reset_db(shadow->db, shadow->db_length);
+ thd->user_time = shadow->user_time;
+ thd->set_row_count_func(shadow->row_count_func);
}
void wsrep_replay_transaction(THD *thd)
WSREP_WARN("dangling observer in replay transaction: (thr %lu %lld %s)",
thd->thread_id, thd->query_id, thd->query());
}
+
+ struct da_shadow
+ {
+ enum Diagnostics_area::enum_diagnostics_status status;
+ ulonglong affected_rows;
+ ulonglong last_insert_id;
+ char message[MYSQL_ERRMSG_SIZE];
+ };
+ struct da_shadow da_status;
+ da_status.status= thd->get_stmt_da()->status();
+ if (da_status.status == Diagnostics_area::DA_OK)
+ {
+ da_status.affected_rows= thd->get_stmt_da()->affected_rows();
+ da_status.last_insert_id= thd->get_stmt_da()->last_insert_id();
+ strmake(da_status.message,
+ thd->get_stmt_da()->message(),
+ sizeof(da_status.message)-1);
+ }
+
thd->get_stmt_da()->reset_diagnostics_area();
thd->wsrep_conflict_state= REPLAYING;
}
else
{
- my_ok(thd);
+ if (da_status.status == Diagnostics_area::DA_OK)
+ {
+ my_ok(thd,
+ da_status.affected_rows,
+ da_status.last_insert_id,
+ da_status.message);
+ }
+ else
+ {
+ my_ok(thd);
+ }
}
break;
case WSREP_TRX_FAIL:
aborting->store_globals();
mysql_mutex_lock(&aborting->LOCK_wsrep_thd);
+
+ /* prepare THD for rollback processing */
+ mysql_reset_thd_for_next_command(aborting);
+ aborting->lex->sql_command= SQLCOM_ROLLBACK;
+
wsrep_client_rollback(aborting);
WSREP_DEBUG("WSREP rollbacker aborted thd: (%lu %llu)",
aborting->thread_id, (long long)aborting->real_id);
{
THD* thd = (THD*)thd_ptr;
if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd);
-
+
status = ((thd->wsrep_exec_mode == REPL_RECV) ||
- (thd->wsrep_exec_mode == TOTAL_ORDER));
+ (thd->wsrep_exec_mode == TOTAL_ORDER));
if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
}
return status;
{
THD* thd = (THD*)thd_ptr;
if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd);
-
+
status = ((thd->wsrep_exec_mode == REPL_RECV) ||
- (thd->wsrep_exec_mode == TOTAL_ORDER) ||
- (thd->wsrep_exec_mode == LOCAL_COMMIT));
+ (thd->wsrep_exec_mode == TOTAL_ORDER) ||
+ (thd->wsrep_exec_mode == LOCAL_COMMIT));
if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
}
return status;
wsrep_set_local_position (val, false);
}
+static int get_provider_option_value(const char* opts,
+ const char* opt_name,
+ ulong* opt_value)
+{
+ int ret= 1;
+ ulong opt_value_tmp;
+ char *opt_value_str, *s, *opts_copy= my_strdup(opts, MYF(MY_WME));
+
+ if ((opt_value_str= strstr(opts_copy, opt_name)) == NULL)
+ goto end;
+ opt_value_str= strtok_r(opt_value_str, "=", &s);
+ if (opt_value_str == NULL) goto end;
+ opt_value_str= strtok_r(NULL, ";", &s);
+ if (opt_value_str == NULL) goto end;
+
+ opt_value_tmp= strtoul(opt_value_str, NULL, 10);
+ if (errno == ERANGE) goto end;
+
+ *opt_value= opt_value_tmp;
+ ret= 0;
+
+end:
+ my_free(opts_copy);
+ return ret;
+}
+
static bool refresh_provider_options()
{
WSREP_DEBUG("refresh_provider_options: %s",
char* opts= wsrep->options_get(wsrep);
if (opts)
{
- if (wsrep_provider_options) my_free((void *)wsrep_provider_options);
- wsrep_provider_options = (char*)my_memdup(opts, strlen(opts) + 1,
- MYF(MY_WME));
+ wsrep_provider_options_init(opts);
+ get_provider_option_value(wsrep_provider_options,
+ (char*)"repl.max_ws_size",
+ &wsrep_max_ws_size);
+ free(opts);
}
else
{
return false;
}
+bool wsrep_max_ws_size_update (sys_var *self, THD *thd, enum_var_type)
+{
+ char max_ws_size_opt[128];
+ my_snprintf(max_ws_size_opt, sizeof(max_ws_size_opt),
+ "repl.max_ws_size=%d", wsrep_max_ws_size);
+ wsrep_status_t ret= wsrep->options_set(wsrep, max_ws_size_opt);
+ if (ret != WSREP_OK)
+ {
+ WSREP_ERROR("Set options returned %d", ret);
+ refresh_provider_options();
+ return true;
+ }
+ return refresh_provider_options();
+}
+
/*
* Status variables stuff below
*/
extern bool wsrep_desync_check CHECK_ARGS;
extern bool wsrep_desync_update UPDATE_ARGS;
+extern bool wsrep_max_ws_size_update UPDATE_ARGS;
+
extern bool wsrep_reject_queries_update UPDATE_ARGS;
#endif /* WSREP_VAR_H */
-/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <m_string.h>
#include <my_getopt.h>
#include <mysql_version.h>
+#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
#define BUFFER_LEN 1024
#define ARCHIVE_ROW_HEADER_SIZE 4
static my_bool
get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
static void usage(void)
{
print_version();
- puts("Copyright 2007-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2007"));
+
puts("Read and modify Archive files directly\n");
printf("Usage: %s [OPTIONS] file_to_be_looked_at [file_for_backup]\n", my_progname);
print_defaults("my", load_default_groups);
-/* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
static uchar* blackhole_get_key(st_blackhole_share *share, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length= share->table_name_length;
return (uchar*) share->table_name;
-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
static uchar* tina_get_key(TINA_SHARE *share, size_t *length,
- my_bool not_used __attribute__((unused)))
+ my_bool not_used MY_ATTRIBUTE((unused)))
{
*length=share->table_name_length;
return (uchar*) share->table_name;
-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
int ha_example::index_read_map(uchar *buf, const uchar *key,
- key_part_map keypart_map __attribute__((unused)),
+ key_part_map keypart_map MY_ATTRIBUTE((unused)),
enum ha_rkey_function find_flag
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
int rc;
DBUG_ENTER("ha_example::index_read");
/* Function we use in the creation of our hash to get key */
static uchar *federated_get_key(FEDERATED_SHARE *share, size_t *length,
- my_bool not_used __attribute__ ((unused)))
+ my_bool not_used MY_ATTRIBUTE ((unused)))
{
*length= share->share_key_length;
return (uchar*) share->share_key;
@param[in] record record data (unused)
*/
-void ha_federated::position(const uchar *record __attribute__ ((unused)))
+void ha_federated::position(const uchar *record MY_ATTRIBUTE ((unused)))
{
DBUG_ENTER("ha_federated::position");
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
uint hp_rb_key_length(HP_KEYDEF *keydef,
- const uchar *key __attribute__((unused)))
+ const uchar *key MY_ATTRIBUTE((unused)))
{
return keydef->length;
}
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
reserved
This program is free software; you can redistribute it and/or modify
} /* rnd */
-static sig_handler endprog(int sig_number __attribute__((unused)))
+static sig_handler endprog(int sig_number MY_ATTRIBUTE((unused)))
{
{
hp_panic(HA_PANIC_CLOSE);
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, 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
@retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
(init_mtr == mtr, or the page was not previously freed in mtr)
@retval block (not allocated or initialized) otherwise */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
buf_block_t*
btr_page_alloc_low(
/*===============*/
@retval true if the operation was successful
@retval false if it is a compressed page, and recompression failed */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
bool
btr_page_reorganize_block(
/*======================*/
{
ulint level;
- ut_ad(ptr && end_ptr);
+ ut_ad(ptr != NULL);
+ ut_ad(end_ptr != NULL);
/* If dealing with a compressed page the record has the
compression level used during original compression written in
Returns TRUE if the insert fits on the appropriate half-page with the
chosen split_rec.
@return true if fits */
-static __attribute__((nonnull(1,3,4,6), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,3,4,6), warn_unused_result))
bool
btr_page_insert_fits(
/*=================*/
/**************************************************************//**
Attaches the halves of an index page on the appropriate level in an
index tree. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
btr_attach_half_pages(
/*==================*/
/*************************************************************//**
Determine if a tuple is smaller than any record on the page.
@return TRUE if smaller */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
btr_page_tuple_smaller(
/*===================*/
/*************************************************************//**
Removes a page from the level list of pages. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
btr_level_list_remove_func(
/*=======================*/
ulint prev_page_no;
ulint next_page_no;
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX));
ut_ad(space == page_get_space_id(page));
/* Get the previous and next page numbers of page */
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
or by invoking ibuf_reset_free_bits() before mtr_commit().
@return pointer to inserted record if succeed, else NULL */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
rec_t*
btr_cur_insert_if_possible(
/*=======================*/
/*************************************************************//**
For an insert, checks the locks and does the undo logging if desired.
@return DB_SUCCESS, DB_WAIT_LOCK, DB_FAIL, or error number */
-UNIV_INLINE __attribute__((warn_unused_result, nonnull(2,3,5,6)))
+UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,5,6)))
dberr_t
btr_cur_ins_lock_and_undo(
/*======================*/
/*************************************************************//**
For an update, checks the locks and does the undo logging.
@return DB_SUCCESS, DB_WAIT_LOCK, or error number */
-UNIV_INLINE __attribute__((warn_unused_result, nonnull(2,3,6,7)))
+UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,6,7)))
dberr_t
btr_cur_upd_lock_and_undo(
/*======================*/
const rec_t* rec;
dberr_t err;
- ut_ad(thr || (flags & BTR_NO_LOCKING_FLAG));
+ ut_ad((thr != NULL) || (flags & BTR_NO_LOCKING_FLAG));
rec = btr_cur_get_rec(cursor);
index = cursor->index;
ut_ad(page_is_leaf(page_align(rec)));
#ifdef UNIV_DEBUG
- if (btr_cur_print_record_ops && thr) {
+ if (btr_cur_print_record_ops && (thr != NULL)) {
btr_cur_trx_report(thr_get_trx(thr)->id, index, "del mark ");
rec_print_new(stderr, rec, offsets);
}
rec = btr_cur_get_rec(cursor);
#ifdef UNIV_DEBUG
- if (btr_cur_print_record_ops && thr) {
+ if (btr_cur_print_record_ops && (thr != NULL)) {
btr_cur_trx_report(thr_get_trx(thr)->id, cursor->index,
"del mark ");
rec_print(stderr, rec, cursor->index);
ulint i, /*!< in: field number of field_ref;
ignored if rec == NULL */
enum trx_rb_ctx rb_ctx, /*!< in: rollback context */
- mtr_t* local_mtr __attribute__((unused))) /*!< in: mtr
+ mtr_t* local_mtr MY_ATTRIBUTE((unused))) /*!< in: mtr
containing the latch to data an an
X-latch to the index tree */
{
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
/*==============================*/
btr_search_t* info, /*!< in: search info */
buf_block_t* block, /*!< in: buffer block */
- btr_cur_t* cursor __attribute__((unused)))
+ btr_cur_t* cursor MY_ATTRIBUTE((unused)))
/*!< in: cursor */
{
#ifdef UNIV_SYNC_DEBUG
/*****************************************************************************
-Copyright (c) 2006, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
/**********************************************************************//**
Check if a buddy is stamped free.
@return whether the buddy is free */
-UNIV_INLINE __attribute__((warn_unused_result))
+UNIV_INLINE MY_ATTRIBUTE((warn_unused_result))
bool
buf_buddy_stamp_is_free(
/*====================*/
@retval BUF_BUDDY_STATE_FREE if fully free
@retval BUF_BUDDY_STATE_USED if currently in use
@retval BUF_BUDDY_STATE_PARTIALLY_USED if partially in use. */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
buf_buddy_state_t
buf_buddy_is_free(
/*==============*/
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
/********************************************************************//**
Inits a page to the buffer buf_pool. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
buf_page_init(
/*==========*/
/*****************************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
or by:
SHOW STATUS LIKE 'innodb_buffer_pool_dump_status'; */
-static __attribute__((nonnull, format(printf, 2, 3)))
+static MY_ATTRIBUTE((nonnull, format(printf, 2, 3)))
void
buf_dump_status(
/*============*/
variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
or by:
SHOW STATUS LIKE 'innodb_buffer_pool_load_status'; */
-static __attribute__((nonnull, format(printf, 2, 3)))
+static MY_ATTRIBUTE((nonnull, format(printf, 2, 3)))
void
buf_load_status(
/*============*/
os_thread_ret_t
DECLARE_THREAD(buf_dump_thread)(
/*============================*/
- void* arg __attribute__((unused))) /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
ut_ad(!srv_read_only_mode);
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
os_thread_ret_t
DECLARE_THREAD(buf_flush_page_cleaner_thread)(
/*==========================================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
caller needs to free the page to the free list
@retval false if BUF_BLOCK_ZIP_PAGE was removed from page_hash. In
this case the block is already returned to the buddy allocator. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
buf_LRU_block_remove_hashed(
/*========================*/
mutex and try to force a context switch. Then reacquire the same mutexes.
The current page is "fixed" before the release of the mutexes and then
"unfixed" again once we have reacquired the mutexes. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
buf_flush_yield(
/*============*/
pool and flush list mutex and do a thread yield. Set the current page
to "sticky" so that it is not relocated during the yield.
@return true if yielded */
-static __attribute__((nonnull(1), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
bool
buf_flush_try_yield(
/*================*/
Removes a single page from a given tablespace inside a specific
buffer pool instance.
@return true if page was removed. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
buf_flush_or_remove_page(
/*=====================*/
@retval DB_SUCCESS if all freed
@retval DB_FAIL if not all freed
@retval DB_INTERRUPTED if the transaction was interrupted */
-static __attribute__((nonnull(1), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
dberr_t
buf_flush_or_remove_pages(
/*======================*/
inside a specific buffer pool instance. The pages will remain in the LRU
list and will be evicted from the LRU list as they age and move towards
the tail of the LRU list. */
-static __attribute__((nonnull(1)))
+static MY_ATTRIBUTE((nonnull(1)))
void
buf_flush_dirty_pages(
/*==================*/
/******************************************************************//**
Remove all pages that belong to a given tablespace inside a specific
buffer pool instance when we are DISCARDing the tablespace. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
buf_LRU_remove_all_pages(
/*=====================*/
tablespace. The pages still remain a part of LRU and are evicted from
the list as they age towards the tail of the LRU only if buf_remove
is BUF_REMOVE_FLUSH_NO_WRITE. */
-static __attribute__((nonnull(1)))
+static MY_ATTRIBUTE((nonnull(1)))
void
buf_LRU_remove_pages(
/*=================*/
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ulint n_fields;
ulint i;
- ut_ad(tuple1 && tuple2);
+ ut_ad(tuple1 != NULL);
+ ut_ad(tuple2 != NULL);
ut_ad(tuple1->magic_n == DATA_TUPLE_MAGIC_N);
ut_ad(tuple2->magic_n == DATA_TUPLE_MAGIC_N);
ut_ad(dtuple_check_typed(tuple1));
void
dtuple_convert_back_big_rec(
/*========================*/
- dict_index_t* index __attribute__((unused)), /*!< in: index */
+ dict_index_t* index MY_ATTRIBUTE((unused)), /*!< in: index */
dtuple_t* entry, /*!< in: entry whose data was put to vector */
big_rec_t* vector) /*!< in, own: big rec vector; it is
freed in this function */
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/***************************************************************//**
Builds a table definition to insert.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_build_table_def_step(
/*======================*/
/***************************************************************//**
Builds an index definition row to insert.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_build_index_def_step(
/*======================*/
/***************************************************************//**
Creates an index tree for the index if it is not a member of a cluster.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_create_index_tree_step(
/*========================*/
/****************************************************************//**
Evaluate the given foreign key SQL statement.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_foreign_eval_sql(
/*==================*/
Add a single foreign key field definition to the data dictionary tables in
the database.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
dict_create_add_foreign_field_to_dictionary(
/*========================================*/
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, 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
dict_index_t* index, /*!< in/out: index */
dict_table_t* table) /*!< in/out: table */
{
- ut_ad(index);
+ ut_ad(index != NULL);
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(!dict_table_is_comp(dict_sys->sys_tables));
ut_ad(!dict_table_is_comp(dict_sys->sys_indexes));
if (dict_index_is_clust(index)) {
dict_table_t* corrupt_table;
- corrupt_table = table ? table : index->table;
- ut_ad(!index->table || !table || index->table == table);
+ corrupt_table = (table != NULL) ? table : index->table;
+ ut_ad((index->table != NULL) || (table != NULL)
+ || index->table == table);
if (corrupt_table) {
corrupt_table->corrupted = TRUE;
{
dict_index_t* index;
- /* If name is NULL, just return */
- if (!name) {
- return(NULL);
- }
-
index = dict_table_get_first_index(table);
while (index != NULL) {
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
goto err_len;
}
type = mach_read_from_4(field);
- if (type & (~0 << DICT_IT_BITS)) {
+ if (type & (~0U << DICT_IT_BITS)) {
return("unknown SYS_INDEXES.TYPE bits");
}
cache.
@return DB_SUCCESS if ok, DB_CORRUPTION if corruption of dictionary
table or DB_UNSUPPORTED if table has unknown index type */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
dict_load_indexes(
/*==============*/
/* the table->fts could be created in dict_load_column
when a user defined FTS_DOC_ID is present, but no
FTS */
+ fts_optimize_remove_table(table);
fts_free(table);
} else {
fts_optimize_add_table(table);
btr_pcur_open_on_user_rec(sys_table_ids, tuple, PAGE_CUR_GE,
BTR_SEARCH_LEAF, &pcur, &mtr);
-check_rec:
rec = btr_pcur_get_rec(&pcur);
if (page_rec_is_user_rec(rec)) {
/*---------------------------------------------------*/
/* Now we have the record in the secondary index
containing the table ID and NAME */
-
+check_rec:
field = rec_get_nth_field_old(
rec, DICT_FLD__SYS_TABLE_IDS__ID, &len);
ut_ad(len == 8);
if (rec_get_deleted_flag(rec, 0)) {
/* Until purge has completed, there
may be delete-marked duplicate records
- for the same SYS_TABLES.ID.
- Due to Bug #60049, some delete-marked
- records may survive the purge forever. */
- if (btr_pcur_move_to_next(&pcur, &mtr)) {
-
- goto check_rec;
+ for the same SYS_TABLES.ID, but different
+ SYS_TABLES.NAME. */
+ while (btr_pcur_move_to_next(&pcur, &mtr)) {
+ rec = btr_pcur_get_rec(&pcur);
+
+ if (page_rec_is_user_rec(rec)) {
+ goto check_rec;
+ }
}
} else {
/* Now we get the table name from the record */
/***********************************************************************//**
Loads a foreign key constraint to the dictionary cache.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull(1), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
dberr_t
dict_load_foreign(
/*==============*/
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, 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
/**********************************************************************//**
Renames a column of a table in the data dictionary cache. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
dict_mem_table_col_rename_low(
/*==========================*/
/*****************************************************************************
-Copyright (c) 2009, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2009, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
them away) which brings non-determinism. We skip only
leaf-level delete marks because delete marks on
non-leaf level do not make sense. */
- if (level == 0 &&
+
+ if (level == 0 && srv_stats_include_delete_marked? 0:
rec_get_deleted_flag(
rec,
page_is_comp(btr_pcur_get_page(&pcur)))) {
the given page and count the number of
distinct ones, also ignore delete marked
records */
- QUIT_ON_FIRST_NON_BORING/* quit when the first record that differs
+ QUIT_ON_FIRST_NON_BORING,/* quit when the first record that differs
from its right neighbor is found */
+ COUNT_ALL_NON_BORING_INCLUDE_DEL_MARKED/* scan all records on
+ the given page and count the number of
+ distinct ones, include delete marked
+ records */
};
/* @} */
offsets_rec = dict_stats_scan_page(
&rec, offsets1, offsets2, index, page, n_prefix,
+ srv_stats_include_delete_marked ?
+ COUNT_ALL_NON_BORING_INCLUDE_DEL_MARKED:
COUNT_ALL_NON_BORING_AND_SKIP_DEL_MARKED, n_diff,
n_external_pages);
/*****************************************************************************
-Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
os_thread_ret_t
DECLARE_THREAD(dict_stats_thread)(
/*==============================*/
- void* arg __attribute__((unused))) /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
ut_a(!srv_read_only_mode);
Writes the flushed lsn and the latest archived log number to the page header
of the first page of a data file of the system tablespace (space 0),
which is uncompressed. */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
dberr_t
fil_write_lsn_and_arch_no_to_file(
/*==============================*/
ulint sum_of_sizes, /*!< in: combined size of previous files
in space, in database pages */
lsn_t lsn, /*!< in: lsn to write */
- ulint arch_log_no __attribute__((unused)))
+ ulint arch_log_no MY_ATTRIBUTE((unused)))
/*!< in: archived log number to write */
{
byte* buf1;
at database startup.
@retval NULL on success, or if innodb_force_recovery is set
@return pointer to an error message string */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
const char*
fil_check_first_page(
/*=================*/
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
/********************************************************************//**
Marks a page used. The page must reside within the extents of the given
segment. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
fseg_mark_page_used(
/*================*/
ulint space, /*!< in: space */
fsp_header_t* header, /*!< in/out: space header */
mtr_t* mtr) /*!< in/out: mini-transaction */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Allocates a single free page from a segment. This function implements
the intelligent allocation strategy which tries to minimize file space
in which the page should be initialized.
If init_mtr!=mtr, but the page is already
latched in mtr, do not initialize the page. */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
file.
@return pointer to the extent descriptor, NULL if the page does not
exist in the space or if the offset is >= the free limit */
-UNIV_INLINE __attribute__((nonnull, warn_unused_result))
+UNIV_INLINE MY_ATTRIBUTE((nonnull, warn_unused_result))
xdes_t*
xdes_get_descriptor_with_space_hdr(
/*===============================*/
above the free limit.
@return pointer to the extent descriptor, NULL if the page does not
exist in the space or if the offset exceeds the free limit */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
xdes_t*
xdes_get_descriptor(
/*================*/
fsp_parse_init_file_page(
/*=====================*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
buf_block_t* block) /*!< in: block or NULL */
{
ut_ad(ptr && end_ptr);
Tries to extend a single-table tablespace so that a page would fit in the
data file.
@return TRUE if success */
-static UNIV_COLD __attribute__((nonnull, warn_unused_result))
+static UNIV_COLD MY_ATTRIBUTE((nonnull, warn_unused_result))
ibool
fsp_try_extend_data_file_with_pages(
/*================================*/
/***********************************************************************//**
Tries to extend the last data file of a tablespace if it is auto-extending.
@return FALSE if not auto-extending */
-static UNIV_COLD __attribute__((nonnull))
+static UNIV_COLD MY_ATTRIBUTE((nonnull))
ibool
fsp_try_extend_data_file(
/*=====================*/
ulint i;
mtr_t ibuf_mtr;
- ut_ad(header && mtr);
+ ut_ad(header != NULL);
+ ut_ad(mtr != NULL);
ut_ad(page_offset(header) == FSP_HEADER_OFFSET);
/* Check if we can fill free list from above the free list limit */
/**********************************************************************//**
Allocates a single free page from a space. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
fsp_alloc_from_free_frag(
/*=====================*/
@retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
(init_mtr == mtr, or the page was not previously freed in mtr)
@retval block (not allocated or initialized) otherwise */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
buf_block_t*
fsp_alloc_free_page(
/*================*/
/*=============================*/
page_t* page, /*!< in: segment inode page */
ulint i, /*!< in: inode index on page */
- ulint zip_size __attribute__((unused)),
+ ulint zip_size MY_ATTRIBUTE((unused)),
/*!< in: compressed page size, or 0 */
- mtr_t* mtr __attribute__((unused)))
+ mtr_t* mtr MY_ATTRIBUTE((unused)))
/*!< in/out: mini-transaction */
{
ut_ad(i < FSP_SEG_INODES_PER_PAGE(zip_size));
/*======================*/
fseg_inode_t* inode, /*!< in: segment inode */
ulint n, /*!< in: slot index */
- mtr_t* mtr __attribute__((unused)))
+ mtr_t* mtr MY_ATTRIBUTE((unused)))
/*!< in/out: mini-transaction */
{
ut_ad(inode && mtr);
/********************************************************************//**
Marks a page used. The page must reside within the extents of the given
segment. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
fseg_mark_page_used(
/*================*/
ib_id_t seg_id;
ulint i;
- ut_ad(seg_inode && mtr);
+ ut_ad(seg_inode != NULL);
+ ut_ad(mtr != NULL);
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N)
== FSEG_MAGIC_N_VALUE);
ut_ad(!((page_offset(seg_inode) - FSEG_ARR_OFFSET) % FSEG_INODE_SIZE));
ulint descr_n_used;
ulint i;
- ut_ad(seg_inode && mtr);
+ ut_ad(seg_inode != NULL);
+ ut_ad(mtr != NULL);
descr = xdes_get_descriptor(space, zip_size, page, mtr);
YY_BUFFER_STATE fts0b_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE fts0b_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-void *fts0balloc (yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
-void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
-void fts0bfree (void * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+void *fts0balloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+void fts0bfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
#define yy_new_buffer fts0b_create_buffer
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
#line 1 "fts0blex.l"
/*****************************************************************************
-Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
+static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
+static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
#endif
#ifndef YY_NO_INPUT
#define YY_EXIT_FAILURE 2
#endif
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
register int i;
for ( i = 0; i < n; ++i )
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
register int n;
for ( n = 0; s[n]; ++n )
}
#endif
-void *fts0balloc (yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void *fts0balloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
return (void *) malloc( size );
}
-void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
return (void *) realloc( (char *) ptr, size );
}
-void fts0bfree (void * ptr , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void fts0bfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
free( (char *) ptr ); /* see fts0brealloc() for (char *) cast */
}
/** variable to record innodb_fts_internal_tbl_name for information
schema table INNODB_FTS_INSERTED etc. */
UNIV_INTERN char* fts_internal_tbl_name = NULL;
+UNIV_INTERN char* fts_internal_tbl_name2 = NULL;
/** InnoDB default stopword list:
There are different versions of stopwords, the stop words listed
@param[in,out] sync sync state
@param[in] unlock_cache whether unlock cache lock when write node
@param[in] wait whether wait when a sync is in progress
+@param[in] has_dict whether has dict operation lock
@return DB_SUCCESS if all OK */
static
dberr_t
fts_sync(
fts_sync_t* sync,
bool unlock_cache,
- bool wait);
+ bool wait,
+ bool has_dict);
/****************************************************************//**
Release all resources help by the words rb tree e.g., the node ilist. */
fts_words_free(
/*===========*/
ib_rbt_t* words) /*!< in: rb tree of words */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef FTS_CACHE_SIZE_DEBUG
/****************************************************************//**
Read the max cache size parameter from the config table. */
/*==============*/
fts_trx_table_t*ftt, /*!< in: FTS trx table */
doc_id_t doc_id, /*!< in: doc id */
- ib_vector_t* fts_indexes __attribute__((unused)));
+ ib_vector_t* fts_indexes MY_ATTRIBUTE((unused)));
/*!< in: affected fts indexes */
#ifdef FTS_DOC_STATS_DEBUG
/****************************************************************//**
fts_table_t* fts_table, /*!< in: table instance */
const fts_string_t* word, /*!< in: the word to check */
ibool* found) /*!< out: TRUE if exists */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* FTS_DOC_STATS_DEBUG */
/******************************************************************//**
const char* table_name, /*!< in: table name, or NULL */
doc_id_t doc_id, /*!< in: last document id */
trx_t* trx) /*!< in: update trx, or NULL */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/****************************************************************//**
This function loads the default InnoDB stopword list */
}
}
-/*********************************************************************//**
-Clear cache. */
+/** Clear cache.
+@param[in,out] cache fts cache */
UNIV_INTERN
void
fts_cache_clear(
-/*============*/
- fts_cache_t* cache) /*!< in: cache */
+ fts_cache_t* cache)
{
ulint i;
/****************************************************************//**
Drops a table. If the table can't be found we return a SUCCESS code.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_drop_table(
/*===========*/
/****************************************************************//**
Rename a single auxiliary table due to database name change.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_rename_one_aux_table(
/*=====================*/
on the given table. row_mysql_lock_data_dictionary must have been called
before this.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_drop_common_tables(
/*===================*/
on the given table. row_mysql_lock_data_dictionary must have been called
before this.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_drop_all_index_tables(
/*======================*/
This function fetch the Doc ID from CONFIG table, and compare with
the Doc ID supplied. And store the larger one to the CONFIG table.
@return DB_SUCCESS if OK */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
fts_cmp_set_sync_doc_id(
/*====================*/
/*********************************************************************//**
Do commit-phase steps necessary for the deletion of a row.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_delete(
/*=======*/
/*********************************************************************//**
Do commit-phase steps necessary for the modification of a row.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_modify(
/*=======*/
The given transaction is about to be committed; do whatever is necessary
from the FTS system's POV.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_commit_table(
/*=============*/
/*==============*/
fts_trx_table_t*ftt, /*!< in: FTS trx table */
doc_id_t doc_id, /*!< in: doc id */
- ib_vector_t* fts_indexes __attribute__((unused)))
+ ib_vector_t* fts_indexes MY_ATTRIBUTE((unused)))
/*!< in: affected fts indexes */
{
mtr_t mtr;
get_doc, clust_index, doc_pcur, offsets, &doc);
if (doc.found) {
- ibool success __attribute__((unused));
+ ibool success MY_ATTRIBUTE((unused));
btr_pcur_store_position(doc_pcur, &mtr);
mtr_commit(&mtr);
DBUG_EXECUTE_IF(
"fts_instrument_sync_debug",
- fts_sync(cache->sync, true, true);
+ fts_sync(cache->sync, true, true, false);
);
DEBUG_SYNC_C("fts_instrument_sync_request");
dict_table_t* table) /*!< in: user table */
{
dict_index_t* index;
- dict_field_t* dfield __attribute__((unused)) = NULL;
+ dict_field_t* dfield MY_ATTRIBUTE((unused)) = NULL;
doc_id_t doc_id = 0;
mtr_t mtr;
btr_pcur_t pcur;
/*********************************************************************//**
Add rows to the DELETED_CACHE table.
@return DB_SUCCESS if all went well else error code*/
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_add_deleted_cache(
/*=======================*/
@param[in] index_cache index cache
@param[in] unlock_cache whether unlock cache when write node
@return DB_SUCCESS if all went well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_write_words(
trx_t* trx,
/*********************************************************************//**
Write a single documents statistics to disk.
@return DB_SUCCESS if all went well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_write_doc_stat(
/*====================*/
Run SYNC on the table, i.e., write out data from the index specific
cache to the FTS aux INDEX table and FTS aux doc id stats table.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_index(
/*===========*/
}
/** Check if index cache has been synced completely
-@param[in,out] sync sync state
@param[in,out] index_cache index cache
@return true if index is synced, otherwise false. */
static
bool
fts_sync_index_check(
- fts_sync_t* sync,
fts_index_cache_t* index_cache)
{
const ib_rbt_node_t* rbt_node;
return(true);
}
-/*********************************************************************//**
-Commit the SYNC, change state of processed doc ids etc.
+/** Reset synced flag in index cache when rollback
+@param[in,out] index_cache index cache */
+static
+void
+fts_sync_index_reset(
+ fts_index_cache_t* index_cache)
+{
+ const ib_rbt_node_t* rbt_node;
+
+ for (rbt_node = rbt_first(index_cache->words);
+ rbt_node != NULL;
+ rbt_node = rbt_next(index_cache->words, rbt_node)) {
+
+ fts_tokenizer_word_t* word;
+ word = rbt_value(fts_tokenizer_word_t, rbt_node);
+
+ fts_node_t* fts_node;
+ fts_node = static_cast<fts_node_t*>(ib_vector_last(word->nodes));
+
+ fts_node->synced = false;
+ }
+}
+
+/** Commit the SYNC, change state of processed doc ids etc.
+@param[in,out] sync sync state
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_sync_commit(
-/*============*/
- fts_sync_t* sync) /*!< in: sync state */
+ fts_sync_t* sync)
{
dberr_t error;
trx_t* trx = sync->trx;
(double) n_nodes/ (double) elapsed_time);
}
+ /* Avoid assertion in trx_free(). */
+ trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx);
return(error);
}
-/*********************************************************************//**
-Rollback a sync operation */
+/** Rollback a sync operation
+@param[in,out] sync sync state */
static
void
fts_sync_rollback(
-/*==============*/
- fts_sync_t* sync) /*!< in: sync state */
+ fts_sync_t* sync)
{
trx_t* trx = sync->trx;
fts_cache_t* cache = sync->table->fts->cache;
index_cache = static_cast<fts_index_cache_t*>(
ib_vector_get(cache->indexes, i));
+ /* Reset synced flag so nodes will not be skipped
+ in the next sync, see fts_sync_write_words(). */
+ fts_sync_index_reset(index_cache);
+
for (j = 0; fts_index_selector[j].value; ++j) {
if (index_cache->ins_graph[j] != NULL) {
rw_lock_x_unlock(&cache->lock);
fts_sql_rollback(trx);
+
+ /* Avoid assertion in trx_free(). */
+ trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx);
}
@param[in,out] sync sync state
@param[in] unlock_cache whether unlock cache lock when write node
@param[in] wait whether wait when a sync is in progress
+@param[in] has_dict whether has dict operation lock
@return DB_SUCCESS if all OK */
static
dberr_t
fts_sync(
fts_sync_t* sync,
bool unlock_cache,
- bool wait)
+ bool wait,
+ bool has_dict)
{
ulint i;
dberr_t error = DB_SUCCESS;
DEBUG_SYNC_C("fts_sync_begin");
fts_sync_begin(sync);
+ /* When sync in background, we hold dict operation lock
+ to prevent DDL like DROP INDEX, etc. */
+ if (has_dict) {
+ sync->trx->dict_operation_lock_mode = RW_S_LATCH;
+ }
+
begin_sync:
if (cache->total_size > fts_max_cache_size) {
/* Avoid the case: sync never finish when
ib_vector_get(cache->indexes, i));
if (index_cache->index->to_be_dropped
- || fts_sync_index_check(sync, index_cache)) {
+ || fts_sync_index_check(index_cache)) {
continue;
}
}
rw_lock_x_lock(&cache->lock);
+ sync->interrupted = false;
sync->in_progress = false;
os_event_set(sync->event);
rw_lock_x_unlock(&cache->lock);
@param[in,out] table fts table
@param[in] unlock_cache whether unlock cache when write node
@param[in] wait whether wait for existing sync to finish
+@param[in] has_dict whether has dict operation lock
@return DB_SUCCESS on success, error code on failure. */
UNIV_INTERN
dberr_t
fts_sync_table(
dict_table_t* table,
bool unlock_cache,
- bool wait)
+ bool wait,
+ bool has_dict)
{
dberr_t err = DB_SUCCESS;
ut_ad(table->fts);
if (!dict_table_is_discarded(table) && table->fts->cache) {
- err = fts_sync(table->fts->cache->sync, unlock_cache, wait);
+ err = fts_sync(table->fts->cache->sync,
+ unlock_cache, wait, has_dict);
}
return(err);
/*********************************************************************//**
Rename an aux table to HEX format. It's called when "%016llu" is used
to format an object id in table name, which only happens in Windows. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_rename_one_aux_table_to_hex_format(
/*===================================*/
This function should make sure that either all the parent table and aux tables
are set DICT_TF2_FTS_AUX_HEX_NAME with flags2 or none of them are set */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_rename_aux_tables_to_hex_format_low(
/*====================================*/
{
ib_id_t dec_id = 0;
char tmp_id[FTS_AUX_MIN_TABLE_ID_LENGTH];
- int ret __attribute__((unused));
+ int ret MY_ATTRIBUTE((unused));
ret = sprintf(tmp_id, UINT64PFx, id);
ut_ad(ret == 16);
#ifdef _WIN32
ret = sscanf(tmp_id, "%016llu", &dec_id);
#else
- ret = sscanf(tmp_id, "%016"PRIu64, &dec_id);
+ ret = sscanf(tmp_id, "%016" PRIu64, &dec_id);
#endif /* _WIN32 */
ut_ad(ret == 1);
return(0);
}
+/* Get parent table name if it's a fts aux table
+@param[in] aux_table_name aux table name
+@param[in] aux_table_len aux table length
+@return parent table name, or NULL */
+char*
+fts_get_parent_table_name(
+ const char* aux_table_name,
+ ulint aux_table_len)
+{
+ fts_aux_table_t aux_table;
+ char* parent_table_name = NULL;
+
+ if (fts_is_aux_table_name(&aux_table, aux_table_name, aux_table_len)) {
+ dict_table_t* parent_table;
+
+ parent_table = dict_table_open_on_id(
+ aux_table.parent_id, TRUE, DICT_TABLE_OP_NORMAL);
+
+ if (parent_table != NULL) {
+ parent_table_name = mem_strdupl(
+ parent_table->name,
+ strlen(parent_table->name));
+
+ dict_table_close(parent_table, TRUE, FALSE);
+ }
+ }
+
+ return(parent_table_name);
+}
+
/** Check the validity of the parent table.
@param[in] aux_table auxiliary table
@return true if it is a valid table or false if it is not */
Check and drop all orphaned FTS auxiliary tables, those that don't have
a parent table or FTS index defined on them.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
fts_check_and_drop_orphaned_tables(
/*===============================*/
fts_zip_t* zip, /*!< in: Zip state + data */
fts_string_t* word) /*!< out: uncompressed word */
{
-#ifdef UNIV_DEBUG
- ulint i;
-#endif
short len = 0;
void* null = NULL;
byte* ptr = word->f_str;
}
}
-#ifdef UNIV_DEBUG
/* All blocks must be freed at end of inflate. */
if (zip->status != Z_OK) {
- for (i = 0; i < ib_vector_size(zip->blocks); ++i) {
+ for (ulint i = 0; i < ib_vector_size(zip->blocks); ++i) {
if (ib_vector_getp(zip->blocks, i)) {
ut_free(ib_vector_getp(zip->blocks, i));
ib_vector_set(zip->blocks, i, &null);
if (ptr != NULL) {
ut_ad(word->f_len == strlen((char*) ptr));
}
-#endif /* UNIV_DEBUG */
return(zip->status == Z_OK || zip->status == Z_STREAM_END ? ptr : NULL);
}
Read the words from the FTS INDEX.
@return DB_SUCCESS if all OK, DB_TABLE_NOT_FOUND if no more indexes
to search else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_index_fetch_words(
/*==================*/
/**********************************************************************//**
Encode the word pos list into the node
@return DB_SUCCESS or error code*/
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
fts_optimize_encode_node(
/*=====================*/
/**********************************************************************//**
Optimize the data contained in a node.
@return DB_SUCCESS or error code*/
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
fts_optimize_node(
/*==============*/
/**********************************************************************//**
Determine the starting pos within the deleted doc id vector for a word.
@return delete position */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
int
fts_optimize_deleted_pos(
/*=====================*/
/**********************************************************************//**
Update the FTS index table. This is a delete followed by an insert.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_write_word(
/*====================*/
/**********************************************************************//**
Optimize the word ilist and rewrite data to the FTS index.
@return status one of RESTART, EXIT, ERROR */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_compact(
/*=================*/
/**********************************************************************//**
Get optimize start time of an FTS index.
@return DB_SUCCESS if all OK else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_get_index_start_time(
/*==============================*/
/**********************************************************************//**
Set the optimize start time of an FTS index.
@return DB_SUCCESS if all OK else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_set_index_start_time(
/*==============================*/
/**********************************************************************//**
Get optimize end time of an FTS index.
@return DB_SUCCESS if all OK else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_get_index_end_time(
/*============================*/
/**********************************************************************//**
Set the optimize end time of an FTS index.
@return DB_SUCCESS if all OK else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_set_index_end_time(
/*============================*/
Optimize is complete. Set the completion time, and reset the optimize
start string for this FTS index to "".
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_index_completed(
/*=========================*/
Read the list of words from the FTS auxiliary index that will be
optimized in this pass.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_index_read_words(
/*==========================*/
Run OPTIMIZE on the given FTS index. Note: this can take a very long
time (hours).
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_index(
/*===============*/
/**********************************************************************//**
Delete the document ids in the delete, and delete cache tables.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_purge_deleted_doc_ids(
/*===============================*/
/**********************************************************************//**
Delete the document ids in the pending delete, and delete tables.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_purge_deleted_doc_id_snapshot(
/*=======================================*/
to the being deleted FTS auxiliary tables. The transaction is committed
upon successfull copy and rolled back on DB_DUPLICATE_KEY error.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_create_deleted_doc_id_snapshot(
/*========================================*/
Read in the document ids that are to be purged during optimize. The
transaction is committed upon successfully read.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_read_deleted_doc_id_snapshot(
/*======================================*/
optimized, since the FTS auxiliary indexes are not guaranteed to be
of the same cardinality.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_indexes(
/*=================*/
/*********************************************************************//**
Cleanup the snapshot tables and the master deleted table.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_purge_snapshot(
/*========================*/
/*********************************************************************//**
Reset the start time to 0 so that a new optimize can be started.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_optimize_reset_start_time(
/*==========================*/
/*********************************************************************//**
Run OPTIMIZE on the given table by a background thread.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
fts_optimize_table_bk(
/*==================*/
empty_slot = i;
} else if (slot->table->id == table->id) {
/* Already exists in our optimize queue. */
+ ut_ad(slot->table_id = table->id);
return(FALSE);
}
}
{
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) {
if (dict_table_has_fts_index(table) && table->fts->cache) {
- fts_sync_table(table, true, false);
+ fts_sync_table(table, true, false, true);
}
dict_table_close(table, FALSE, FALSE);
}
+
+ rw_lock_s_unlock(&dict_operation_lock);
}
/**********************************************************************//**
/*****************************************************************************
-Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
dict_index_t* index, /*!< in: FTS index to search */
fts_query_t* query) /*!< in: query result, to be freed
by the client */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
This function finds documents that contain all words in a
phrase or proximity search. And if proximity search, verify
/*****************************************************************//**
Set difference.
@return DB_SUCCESS if all go well */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_difference(
/*=================*/
/*****************************************************************//**
Intersect the token doc ids with the current set.
@return DB_SUCCESS if all go well */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_intersect(
/*================*/
/*****************************************************************//**
Set union.
@return DB_SUCCESS if all go well */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_union(
/*============*/
Read the rows from the FTS index, that match word and where the
doc id is between first and last doc id.
@return DB_SUCCESS if all go well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_find_term(
/*================*/
/********************************************************************
Calculate the total documents that contain a particular word (term).
@return DB_SUCCESS if all go well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_total_docs_containing_term(
/*=================================*/
/********************************************************************
Get the total number of words in a documents.
@return DB_SUCCESS if all go well else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_terms_in_document(
/*========================*/
/*****************************************************************//**
Retrieve the document and match the phrase tokens.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_match_document(
/*=====================*/
This function fetches the original documents and count the
words in between matching words to see that is in specified distance
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
fts_query_is_in_proximity_range(
/*============================*/
Iterate over the matched document ids and search the for the
actual phrase in the text.
@return DB_SUCCESS if all OK */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_search_phrase(
/*====================*/
/*****************************************************************//**
Text/Phrase search.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_phrase_search(
/*====================*/
/*****************************************************************//**
Find the word and evaluate.
@return DB_SUCCESS if all go well */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_query_execute(
/*==============*/
search arguments to search the document again, thus "expand"
the search result set.
@return DB_SUCCESS if success, otherwise the error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
fts_expand_query(
/*=============*/
YY_BUFFER_STATE fts0t_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE fts0t_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
-void *fts0talloc (yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
-void *fts0trealloc (void *,yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
-void fts0tfree (void * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+void *fts0talloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+void *fts0trealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+void fts0tfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
#define yy_new_buffer fts0t_create_buffer
static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
#line 1 "fts0tlex.l"
/*****************************************************************************
-Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
+static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
+static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
#endif
#ifndef YY_NO_INPUT
#define YY_EXIT_FAILURE 2
#endif
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
register int i;
for ( i = 0; i < n; ++i )
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
register int n;
for ( n = 0; s[n]; ++n )
}
#endif
-void *fts0talloc (yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void *fts0talloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
return (void *) malloc( size );
}
-void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void *fts0trealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
return (void *) realloc( (char *) ptr, size );
}
-void fts0tfree (void * ptr , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
+void fts0tfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
{
free( (char *) ptr ); /* see fts0trealloc() for (char *) cast */
}
#!/bin/sh
#
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
echo '#include "univ.i"' > $TMPF
# This is to avoid compiler warning about unused parameters.
-# FIXME: gcc extension "__attribute__" causing compilation errors on windows
+# FIXME: gcc extension "MY_ATTRIBUTE" causing compilation errors on windows
# platform. Quote them out for now.
sed -e '
-s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
+s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
' < fts0blex.cc >> $TMPF
mv $TMPF fts0blex.cc
echo '#include "univ.i"' > $TMPF
sed -e '
-s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
-s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 __attribute__((unused))/;
+s/^\(static.*void.*yy_fatal_error.*msg.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(static.*void.*yy_flex_strncpy.*n.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(static.*int.*yy_flex_strlen.*s.*,\)\(.*yyscanner\)/\1 \2 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]alloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]realloc.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
+s/^\(\(static\|void\).*fts0[bt]free.*,\)\(.*yyscanner\)/\1 \3 MY_ATTRIBUTE((unused))/;
' < fts0tlex.cc >> $TMPF
mv $TMPF fts0tlex.cc
/********************************************************************//**
Obtain the InnoDB transaction of a MySQL thread.
@return reference to transaction pointer */
-__attribute__((warn_unused_result, nonnull))
+MY_ATTRIBUTE((warn_unused_result, nonnull))
static inline
trx_t*&
thd_to_trx(
innobase_end(
/*=========*/
handlerton* hton, /*!< in/out: InnoDB handlerton */
- ha_panic_function type __attribute__((unused)))
+ ha_panic_function type MY_ATTRIBUTE((unused)))
/*!< in: ha_panic() parameter */
{
int err= 0;
ha_innobase::innobase_lock_autoinc(void)
/*====================================*/
{
+ DBUG_ENTER("ha_innobase::innobase_lock_autoinc");
dberr_t error = DB_SUCCESS;
ut_ad(!srv_read_only_mode);
/* Fall through to old style locking. */
case AUTOINC_OLD_STYLE_LOCKING:
+ DBUG_EXECUTE_IF("die_if_autoinc_old_lock_style_used",
+ ut_ad(0););
error = row_lock_table_autoinc_for_mysql(prebuilt);
if (error == DB_SUCCESS) {
ut_error;
}
- return(error);
+ DBUG_RETURN(error);
}
/********************************************************************//**
/*****************************************************************//**
Creates a table definition to an InnoDB database. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
int
create_table_def(
/*=============*/
/* Commit the transaction in order to release the table lock. */
trx_commit_for_mysql(prebuilt->trx);
+ if (err == DB_SUCCESS && !discard
+ && dict_stats_is_persistent_enabled(dict_table)) {
+ dberr_t ret;
+
+ /* Adjust the persistent statistics. */
+ ret = dict_stats_update(dict_table,
+ DICT_STATS_RECALC_PERSISTENT);
+
+ if (ret != DB_SUCCESS) {
+ push_warning_printf(
+ ha_thd(),
+ Sql_condition::WARN_LEVEL_WARN,
+ ER_ALTER_INFO,
+ "Error updating stats for table '%s'"
+ " after table rebuild: %s",
+ dict_table->name, ut_strerr(ret));
+ }
+ }
+
DBUG_RETURN(convert_error_code_to_mysql(err, dict_table->flags, NULL));
}
/*********************************************************************//**
Renames an InnoDB table.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
innobase_rename_table(
/*==================*/
if (innodb_optimize_fulltext_only) {
if (prebuilt->table->fts && prebuilt->table->fts->cache
&& !dict_table_is_discarded(prebuilt->table)) {
- fts_sync_table(prebuilt->table, false, true);
+ fts_sync_table(prebuilt->table, false, true, false);
fts_optimize_table(prebuilt->table);
}
return(HA_ADMIN_OK);
ulonglong col_max_value = innobase_get_int_col_max_value(
table->next_number_field);
+ /** The following logic is needed to avoid duplicate key error
+ for autoincrement column.
+
+ (1) InnoDB gives the current autoincrement value with respect
+ to increment and offset value.
+
+ (2) Basically it does compute_next_insert_id() logic inside InnoDB
+ to avoid the current auto increment value changed by handler layer.
+
+ (3) It is restricted only for insert operations. */
+
+ if (increment > 1 && thd_sql_command(user_thd) != SQLCOM_ALTER_TABLE
+ && autoinc < col_max_value) {
+
+ ulonglong prev_auto_inc = autoinc;
+
+ autoinc = ((autoinc - 1) + increment - offset)/ increment;
+
+ autoinc = autoinc * increment + offset;
+
+ /* If autoinc exceeds the col_max_value then reset
+ to old autoinc value. Because in case of non-strict
+ sql mode, boundary value is not considered as error. */
+
+ if (autoinc >= col_max_value) {
+ autoinc = prev_auto_inc;
+ }
+
+ ut_ad(autoinc > 0);
+ }
+
/* Called for the first time ? */
if (trx->n_autoinc_rows == 0) {
my_free(old);
}
- fts_internal_tbl_name = *(char**) var_ptr;
+ fts_internal_tbl_name2 = *(char**) var_ptr;
+ if (fts_internal_tbl_name2 == NULL) {
+ fts_internal_tbl_name = const_cast<char*>("default");
+ } else {
+ fts_internal_tbl_name = fts_internal_tbl_name2;
+ }
}
/****************************************************************//**
Evict all uncompressed pages of compressed tables from the buffer pool.
Keep the compressed pages in the buffer pool.
@return whether all uncompressed pages were evicted */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
bool
innodb_buffer_pool_evict_uncompressed(void)
/*=======================================*/
purge_run_now_set(
/*==============*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
purge_stop_now_set(
/*===============*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
checkpoint_now_set(
/*===============*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
buf_flush_list_now_set(
/*===================*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
buffer_pool_dump_now(
/*=================*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
buffer_pool_load_now(
/*=================*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
buffer_pool_load_abort(
/*===================*/
THD* thd /*!< in: thread handle */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
struct st_mysql_sys_var* var /*!< in: pointer to system
variable */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
void* var_ptr /*!< out: where the formal
string goes */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const void* save) /*!< in: immediate result from
check function */
{
static
void
innodb_status_output_update(
- THD* thd __attribute__((unused)),
- struct st_mysql_sys_var* var __attribute__((unused)),
- void* var_ptr __attribute__((unused)),
- const void* save __attribute__((unused)))
+ THD* thd MY_ATTRIBUTE((unused)),
+ struct st_mysql_sys_var* var MY_ATTRIBUTE((unused)),
+ void* var_ptr MY_ATTRIBUTE((unused)),
+ const void* save MY_ATTRIBUTE((unused)))
{
*static_cast<my_bool*>(var_ptr) = *static_cast<const my_bool*>(save);
/* The lock timeout monitor thread also takes care of this
"Disable with --skip-innodb-doublewrite.",
NULL, NULL, TRUE);
+static MYSQL_SYSVAR_BOOL(stats_include_delete_marked,
+ srv_stats_include_delete_marked,
+ PLUGIN_VAR_OPCMDARG,
+ "Scan delete marked records for persistent stat",
+ NULL, NULL, FALSE);
+
static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity,
PLUGIN_VAR_RQCMDARG,
"Number of IOPs the server can do. Tunes the background IO rate",
"Whether to disable OS system file cache for sort I/O",
NULL, NULL, FALSE);
-static MYSQL_SYSVAR_STR(ft_aux_table, fts_internal_tbl_name,
+static MYSQL_SYSVAR_STR(ft_aux_table, fts_internal_tbl_name2,
PLUGIN_VAR_NOCMDARG,
"FTS internal auxiliary table to be checked",
innodb_internal_table_validate,
MYSQL_SYSVAR(data_file_path),
MYSQL_SYSVAR(data_home_dir),
MYSQL_SYSVAR(doublewrite),
+ MYSQL_SYSVAR(stats_include_delete_marked),
MYSQL_SYSVAR(api_enable_binlog),
MYSQL_SYSVAR(api_enable_mdl),
MYSQL_SYSVAR(api_disable_rowlock),
/*****************************************************************************
-Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@param off auto_increment_offset
@param inc auto_increment_increment */
void thd_get_autoinc(const MYSQL_THD thd, ulong* off, ulong* inc)
-__attribute__((nonnull));
+MY_ATTRIBUTE((nonnull));
/** Is strict sql_mode set.
@param thd Thread object
@return True if sql_mode has strict mode (all or trans), false otherwise.
*/
bool thd_is_strict_mode(const MYSQL_THD thd)
-__attribute__((nonnull));
+MY_ATTRIBUTE((nonnull));
} /* extern "C" */
#ifdef WITH_WSREP
extern "C" void wsrep_thd_set_trx_to_replay(THD *thd, uint64 trx_id);
-extern "C"void wsrep_thd_LOCK(THD *thd);
-extern "C"void wsrep_thd_UNLOCK(THD *thd);
+extern "C" void wsrep_thd_LOCK(THD *thd);
+extern "C" void wsrep_thd_UNLOCK(THD *thd);
extern "C" uint32 wsrep_thd_wsrep_rand(THD *thd);
extern "C" time_t wsrep_thd_query_start(THD *thd);
extern "C" my_thread_id wsrep_thd_thread_id(THD *thd);
const KEY* key_info, /*!< in: Indexes to be created */
ulint num_of_keys) /*!< in: Number of indexes to
be created. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Determines InnoDB table flags.
outside system tablespace */
ulint* flags, /*!< out: DICT_TF flags */
ulint* flags2) /*!< out: DICT_TF2 flags */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Validates the create options. We may build on this function
columns and indexes */
HA_CREATE_INFO* create_info, /*!< in: create info. */
bool use_tablespace) /*!< in: srv_file_per_table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Retrieve the FTS Relevance Ranking result for doc with doc_id
innobase_fts_close_ranking(
/*=======================*/
FT_INFO* fts_hdl) /*!< in: FTS handler */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*****************************************************************//**
Initialize the table FTS stopword list
@return TRUE if success */
dict_table_t* table, /*!< in: Table has the FTS */
trx_t* trx, /*!< in: transaction */
THD* thd) /*!< in: current thread */
- __attribute__((nonnull(1,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,3), warn_unused_result));
/** Some defines for innobase_fts_check_doc_id_index() return value */
enum fts_doc_id_index_enum {
that is being altered */
ulint* fts_doc_col_no) /*!< out: The column number for
Doc ID */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*******************************************************************//**
Check whether the table has a unique index with FTS_DOC_ID_INDEX_NAME
/*===================================*/
ulint n_key, /*!< in: Number of keys */
const KEY* key_info) /*!< in: Key definitions */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************
@return version of the extended FTS API */
/*****************************************************************************
-Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
| Alter_inplace_info::ALTER_COLUMN_NAME;
/* Report an InnoDB error to the client by invoking my_error(). */
-static UNIV_COLD __attribute__((nonnull))
+static UNIV_COLD MY_ATTRIBUTE((nonnull))
void
my_error_innodb(
/*============*/
Determine if ALTER TABLE needs to rebuild the table.
@param ha_alter_info the DDL operation
@return whether it is necessary to rebuild the table */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_need_rebuild(
/*==================*/
const Alter_inplace_info* ha_alter_info)
{
- if (ha_alter_info->handler_flags
+ Alter_inplace_info::HA_ALTER_FLAGS alter_inplace_flags =
+ ha_alter_info->handler_flags & ~(INNOBASE_INPLACE_IGNORE);
+
+ if (alter_inplace_flags
== Alter_inplace_info::CHANGE_CREATE_OPTION
&& !(ha_alter_info->create_info->used_fields
& (HA_CREATE_USED_ROW_FORMAT
/*************************************************************//**
Initialize the dict_foreign_t structure with supplied info
@return true if added, false if duplicate foreign->id */
-static __attribute__((nonnull(1,3,5,7)))
+static MY_ATTRIBUTE((nonnull(1,3,5,7)))
bool
innobase_init_foreign(
/*==================*/
/*************************************************************//**
Check whether the foreign key options is legit
@return true if it is */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_check_fk_option(
/*=====================*/
/*************************************************************//**
Set foreign key options
@return true if successfully set */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_set_foreign_key_option(
/*============================*/
Check if a foreign key constraint can make use of an index
that is being created.
@return useable index, or NULL if none found */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const KEY*
innobase_find_equiv_index(
/*======================*/
Find an index whose first fields are the columns in the array
in the same order and is not marked for deletion
@return matching index, NULL if not found */
-static __attribute__((nonnull(1,2,6), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,6), warn_unused_result))
dict_index_t*
innobase_find_fk_index(
/*===================*/
Create InnoDB foreign key structure from MySQL alter_info
@retval true if successful
@retval false on error (will call my_error()) */
-static __attribute__((nonnull(1,2,3,7,8), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,3,7,8), warn_unused_result))
bool
innobase_get_foreign_key_info(
/*==========================*/
/*******************************************************************//**
This function checks that index keys are sensible.
@return 0 or error number */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
int
innobase_check_index_keys(
/*======================*/
/*******************************************************************//**
Create index field definition for key part */
-static __attribute__((nonnull(2,3)))
+static MY_ATTRIBUTE((nonnull(2,3)))
void
innobase_create_index_field_def(
/*============================*/
/*******************************************************************//**
Create index definition for key */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
innobase_create_index_def(
/*======================*/
return(FTS_NOT_EXIST_DOC_ID_INDEX);
}
+
/*******************************************************************//**
Create an index table where indexes are ordered as follows:
ENDIF
@return key definitions */
-static __attribute__((nonnull, warn_unused_result, malloc))
+static MY_ATTRIBUTE((nonnull, warn_unused_result, malloc))
index_def_t*
innobase_create_key_defs(
/*=====================*/
(only prefix/part of the column is indexed), MySQL will treat the
index as a PRIMARY KEY unless the table already has one. */
- if (n_add > 0 && !new_primary && got_default_clust
- && (key_info[*add].flags & HA_NOSAME)
- && !(key_info[*add].flags & HA_KEY_HAS_PART_KEY_SEG)) {
- uint key_part = key_info[*add].user_defined_key_parts;
-
- new_primary = true;
-
- while (key_part--) {
- const uint maybe_null
- = key_info[*add].key_part[key_part].key_type
- & FIELDFLAG_MAYBE_NULL;
- DBUG_ASSERT(!maybe_null
- == !key_info[*add].key_part[key_part].
- field->real_maybe_null());
+ ut_ad(altered_table->s->primary_key == 0
+ || altered_table->s->primary_key == MAX_KEY);
- if (maybe_null) {
- new_primary = false;
- break;
- }
- }
+ if (got_default_clust && !new_primary) {
+ new_primary = (altered_table->s->primary_key != MAX_KEY);
}
const bool rebuild = new_primary || add_fts_doc_id
ulint primary_key_number;
if (new_primary) {
- DBUG_ASSERT(n_add > 0);
- primary_key_number = *add;
+ if (n_add == 0) {
+ DBUG_ASSERT(got_default_clust);
+ DBUG_ASSERT(altered_table->s->primary_key
+ == 0);
+ primary_key_number = 0;
+ } else {
+ primary_key_number = *add;
+ }
} else if (got_default_clust) {
/* Create the GEN_CLUST_INDEX */
index_def_t* index = indexdef++;
/*******************************************************************//**
Check each index column size, make sure they do not exceed the max limit
@return true if index column size exceeds limit */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_check_column_length(
/*=========================*/
/********************************************************************//**
Drop any indexes that we were not able to free previously due to
open table handles. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
online_retry_drop_indexes(
/*======================*/
/********************************************************************//**
Commit a dictionary transaction and drop any indexes that we were not
able to free previously due to open table handles. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
online_retry_drop_indexes_with_trx(
/*===============================*/
@param drop_fk constraints being dropped
@param n_drop_fk number of constraints that are being dropped
@return whether the constraint is being dropped */
-inline __attribute__((pure, nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
bool
innobase_dropping_foreign(
/*======================*/
@retval true Not allowed (will call my_error())
@retval false Allowed
*/
-static __attribute__((pure, nonnull, warn_unused_result))
+static MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
bool
innobase_check_foreigns_low(
/*========================*/
@retval true Not allowed (will call my_error())
@retval false Allowed
*/
-static __attribute__((pure, nonnull, warn_unused_result))
+static MY_ATTRIBUTE((pure, nonnull, warn_unused_result))
bool
innobase_check_foreigns(
/*====================*/
@param dfield InnoDB data field to copy to
@param field MySQL value for the column
@param comp nonzero if in compact format */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
innobase_build_col_map_add(
/*=======================*/
@param heap Memory heap where allocated
@return array of integers, mapping column numbers in the table
to column numbers in altered_table */
-static __attribute__((nonnull(1,2,3,4,5,7), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,3,4,5,7), warn_unused_result))
const ulint*
innobase_build_col_map(
/*===================*/
@param user_table InnoDB table as it is before the ALTER operation
@param heap Memory heap for the allocation
@return array of new column names in rebuilt_table, or NULL if not renamed */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const char**
innobase_get_col_names(
Alter_inplace_info* ha_alter_info,
@retval true Failure
@retval false Success
*/
-static __attribute__((warn_unused_result, nonnull(1,2,3,4)))
+static MY_ATTRIBUTE((warn_unused_result, nonnull(1,2,3,4)))
bool
prepare_inplace_alter_table_dict(
/*=============================*/
ctx->add_cols = add_cols;
} else {
DBUG_ASSERT(!innobase_need_rebuild(ha_alter_info));
+ DBUG_ASSERT(old_table->s->primary_key
+ == altered_table->s->primary_key);
if (!ctx->new_table->fts
&& innobase_fulltext_exist(altered_table)) {
/* Check whether an index is needed for the foreign key constraint.
If so, if it is dropped, is there an equivalent index can play its role.
@return true if the index is needed and can't be dropped */
-static __attribute__((nonnull(1,2,3,5), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,3,5), warn_unused_result))
bool
innobase_check_foreign_key_index(
/*=============================*/
}
if (!(ha_alter_info->handler_flags & INNOBASE_ALTER_DATA)
- || (ha_alter_info->handler_flags
+ || ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
== Alter_inplace_info::CHANGE_CREATE_OPTION
&& !innobase_need_rebuild(ha_alter_info))) {
add_fts_doc_id_idx));
}
+/** Get the name of an erroneous key.
+@param[in] error_key_num InnoDB number of the erroneus key
+@param[in] ha_alter_info changes that were being performed
+@param[in] table InnoDB table
+@return the name of the erroneous key */
+static
+const char*
+get_error_key_name(
+ ulint error_key_num,
+ const Alter_inplace_info* ha_alter_info,
+ const dict_table_t* table)
+{
+ if (error_key_num == ULINT_UNDEFINED) {
+ return(FTS_DOC_ID_INDEX_NAME);
+ } else if (ha_alter_info->key_count == 0) {
+ return(dict_table_get_first_index(table)->name);
+ } else {
+ return(ha_alter_info->key_info_buffer[error_key_num].name);
+ }
+}
+
/** Alter the table structure in-place with operations
specified using Alter_inplace_info.
The level of concurrency allowed during this operation depends
DBUG_RETURN(false);
}
- if (ha_alter_info->handler_flags
+ if ((ha_alter_info->handler_flags & ~INNOBASE_INPLACE_IGNORE)
== Alter_inplace_info::CHANGE_CREATE_OPTION
&& !innobase_need_rebuild(ha_alter_info)) {
goto ok_exit;
case DB_ONLINE_LOG_TOO_BIG:
DBUG_ASSERT(ctx->online);
my_error(ER_INNODB_ONLINE_LOG_TOO_BIG, MYF(0),
- (prebuilt->trx->error_key_num == ULINT_UNDEFINED)
- ? FTS_DOC_ID_INDEX_NAME
- : ha_alter_info->key_info_buffer[
- prebuilt->trx->error_key_num].name);
+ get_error_key_name(prebuilt->trx->error_key_num,
+ ha_alter_info, prebuilt->table));
break;
case DB_INDEX_CORRUPT:
my_error(ER_INDEX_CORRUPT, MYF(0),
- (prebuilt->trx->error_key_num == ULINT_UNDEFINED)
- ? FTS_DOC_ID_INDEX_NAME
- : ha_alter_info->key_info_buffer[
- prebuilt->trx->error_key_num].name);
+ get_error_key_name(prebuilt->trx->error_key_num,
+ ha_alter_info, prebuilt->table));
break;
default:
my_error_innodb(error,
@param locked TRUE=table locked, FALSE=may need to do a lazy drop
@param trx the transaction
*/
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
innobase_rollback_sec_index(
/*========================*/
@retval true Failure
@retval false Success
*/
-inline __attribute__((nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
rollback_inplace_alter_table(
/*=========================*/
@param foreign_id Foreign key constraint identifier
@retval true Failure
@retval false Success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_drop_foreign_try(
/*======================*/
@param new_clustered whether the table has been rebuilt
@retval true Failure
@retval false Success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_rename_column_try(
/*=======================*/
@param table_name Table name in MySQL
@retval true Failure
@retval false Success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_rename_columns_try(
/*========================*/
@param ha_alter_info Data used during in-place alter.
@param table the TABLE
@param user_table InnoDB table that was being altered */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
innobase_rename_columns_cache(
/*==========================*/
@param altered_table MySQL table that is being altered
@param old_table MySQL table as it is before the ALTER operation
@return the next auto-increment value (0 if not present) */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulonglong
commit_get_autoinc(
/*===============*/
@retval true Failure
@retval false Success
*/
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
innobase_update_foreign_try(
/*========================*/
@param ctx In-place ALTER TABLE context
@param user_thd MySQL connection
@return InnoDB error code (should always be DB_SUCCESS) */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
innobase_update_foreign_cache(
/*==========================*/
"Foreign key constraints for table '%s'"
" are loaded with charset check off",
user_table->name);
-
}
}
@retval true Failure
@retval false Success
*/
-inline __attribute__((nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
commit_try_rebuild(
/*===============*/
DBUG_RETURN(true);
case DB_ONLINE_LOG_TOO_BIG:
my_error(ER_INNODB_ONLINE_LOG_TOO_BIG, MYF(0),
- ha_alter_info->key_info_buffer[0].name);
+ get_error_key_name(err_key, ha_alter_info,
+ rebuilt_table));
DBUG_RETURN(true);
case DB_INDEX_CORRUPT:
my_error(ER_INDEX_CORRUPT, MYF(0),
- (err_key == ULINT_UNDEFINED)
- ? FTS_DOC_ID_INDEX_NAME
- : ha_alter_info->key_info_buffer[err_key]
- .name);
+ get_error_key_name(err_key, ha_alter_info,
+ rebuilt_table));
DBUG_RETURN(true);
default:
my_error_innodb(error, table_name, user_table->flags);
/** Apply the changes made during commit_try_rebuild(),
to the data dictionary cache and the file system.
@param ctx In-place ALTER TABLE context */
-inline __attribute__((nonnull))
+inline MY_ATTRIBUTE((nonnull))
void
commit_cache_rebuild(
/*=================*/
@retval true Failure
@retval false Success
*/
-inline __attribute__((nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
commit_try_norebuild(
/*=================*/
@param trx Data dictionary transaction object
(will be started and committed)
@return whether all replacements were found for dropped indexes */
-inline __attribute__((nonnull, warn_unused_result))
+inline MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
commit_cache_norebuild(
/*===================*/
/*****************************************************************************
-Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
DBUG_RETURN(0);
}
- deleted = fts_doc_ids_create();
+ /* Prevent DDL to drop fts aux tables. */
+ rw_lock_s_lock(&dict_operation_lock);
user_table = dict_table_open_on_name(
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
if (!user_table) {
+ rw_lock_s_unlock(&dict_operation_lock);
+
+ DBUG_RETURN(0);
+ } else if (!dict_table_has_fts_index(user_table)) {
+ dict_table_close(user_table, FALSE, FALSE);
+
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
+ deleted = fts_doc_ids_create();
+
trx = trx_allocate_for_background();
trx->op_info = "Select for FTS DELETE TABLE";
dict_table_close(user_table, FALSE, FALSE);
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
DBUG_RETURN(0);
}
+ if (user_table->fts == NULL || user_table->fts->cache == NULL) {
+ dict_table_close(user_table, FALSE, FALSE);
+
+ DBUG_RETURN(0);
+ }
+
cache = user_table->fts->cache;
ut_a(cache);
DBUG_RETURN(0);
}
+ /* Prevent DDL to drop fts aux tables. */
+ rw_lock_s_lock(&dict_operation_lock);
+
user_table = dict_table_open_on_name(
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
if (!user_table) {
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
dict_table_close(user_table, FALSE, FALSE);
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
DBUG_RETURN(0);
}
+ DEBUG_SYNC_C("i_s_fts_config_fille_check");
+
fields = table->field;
+ /* Prevent DDL to drop fts aux tables. */
+ rw_lock_s_lock(&dict_operation_lock);
+
user_table = dict_table_open_on_name(
fts_internal_tbl_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);
if (!user_table) {
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
} else if (!dict_table_has_fts_index(user_table)) {
dict_table_close(user_table, FALSE, FALSE);
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
dict_table_close(user_table, FALSE, FALSE);
+ rw_lock_s_unlock(&dict_operation_lock);
+
DBUG_RETURN(0);
}
/*****************************************************************************
-Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
ibuf_parse_bitmap_init(
/*===================*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
buf_block_t* block, /*!< in: block or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
{
/*******************************************************************//**
Get the matching records for space id.
@return current rec or NULL */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const rec_t*
ibuf_get_user_rec(
/*===============*/
Reads page numbers for a space id from an ibuf tree.
@return a lower limit for the combined volume of records which will be
merged */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulint
ibuf_get_merge_pages(
/*=================*/
}
/*********************************************************************//**
-Get the table instance from the table id.
-@return table instance */
-static __attribute__((warn_unused_result))
-dict_table_t*
-ibuf_get_table(
-/*===========*/
- table_id_t table_id) /*!< in: valid table id */
-{
- rw_lock_s_lock_func(&dict_operation_lock, 0, __FILE__, __LINE__);
-
- dict_table_t* table = dict_table_open_on_id(
- table_id, FALSE, DICT_TABLE_OP_NORMAL);
-
- rw_lock_s_unlock_gen(&dict_operation_lock, 0);
-
- return(table);
-}
-
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
-@return a lower limit for the combined size in bytes of entries which
-will be merged from ibuf trees to the pages read, 0 if ibuf is
-empty */
-static
+Contracts insert buffer trees by reading pages referring to space_id
+to the buffer pool.
+@returns number of pages merged.*/
+UNIV_INTERN
ulint
ibuf_merge_space(
/*=============*/
- ulint space, /*!< in: tablespace id to merge */
- ulint* n_pages)/*!< out: number of pages to which merged */
+ ulint space) /*!< in: tablespace id to merge */
{
mtr_t mtr;
btr_pcur_t pcur;
mem_heap_t* heap = mem_heap_create(512);
dtuple_t* tuple = ibuf_search_tuple_build(space, 0, heap);
+ ulint n_pages = 0;
+
+ ut_ad(space < SRV_LOG_SPACE_FIRST_ID);
ibuf_mtr_start(&mtr);
} else {
sum_sizes = ibuf_get_merge_pages(
- &pcur, space, IBUF_MAX_N_PAGES_MERGED,
- &pages[0], &spaces[0], &versions[0], n_pages,
- &mtr);
+ &pcur, space, IBUF_MAX_N_PAGES_MERGED,
+ &pages[0], &spaces[0], &versions[0], &n_pages,
+ &mtr);
+ ib_logf(IB_LOG_LEVEL_INFO,"\n Size of pages merged %lu"
+ ,sum_sizes);
- ++sum_sizes;
}
ibuf_mtr_commit(&mtr);
btr_pcur_close(&pcur);
- if (sum_sizes > 0) {
-
- ut_a(*n_pages > 0 || sum_sizes == 1);
+ if (n_pages > 0) {
#ifdef UNIV_DEBUG
- ut_ad(*n_pages <= UT_ARR_SIZE(pages));
+ ut_ad(n_pages <= UT_ARR_SIZE(pages));
- for (ulint i = 0; i < *n_pages; ++i) {
+ for (ulint i = 0; i < n_pages; ++i) {
ut_ad(spaces[i] == space);
ut_ad(i == 0 || versions[i] == versions[i - 1]);
}
#endif /* UNIV_DEBUG */
buf_read_ibuf_merge_pages(
- true, spaces, versions, pages, *n_pages);
+ true, spaces, versions, pages, n_pages);
}
- return(sum_sizes);
+ return(n_pages);
}
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
+/** Contract the change buffer by reading pages to the buffer pool.
+@param[out] n_pages number of pages merged
+@param[in] sync whether the caller waits for
+the issued reads to complete
@return a lower limit for the combined size in bytes of entries which
will be merged from ibuf trees to the pages read, 0 if ibuf is
empty */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulint
ibuf_merge(
/*=======*/
- table_id_t table_id, /*!< in: if merge should be
- done only for a specific
- table, for all tables this
- should be 0 */
ulint* n_pages, /*!< out: number of pages to
which merged */
bool sync) /*!< in: TRUE if the caller
read with the highest
tablespace address to complete */
{
- dict_table_t* table;
-
*n_pages = 0;
/* We perform a dirty read of ibuf->empty, without latching
} else if (ibuf_debug) {
return(0);
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
- } else if (table_id == 0) {
+ } else {
return(ibuf_merge_pages(n_pages, sync));
- } else if ((table = ibuf_get_table(table_id)) == 0) {
- /* Table has been dropped. */
- return(0);
}
-
- ulint volume = ibuf_merge_space(table->space, n_pages);
-
- dict_table_close(table, FALSE, FALSE);
-
- return(volume);
}
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
+/** Contract the change buffer by reading pages to the buffer pool.
+@param[in] sync whether the caller waits for
+the issued reads to complete
@return a lower limit for the combined size in bytes of entries which
-will be merged from ibuf trees to the pages read, 0 if ibuf is
-empty */
+will be merged from ibuf trees to the pages read, 0 if ibuf is empty */
static
ulint
ibuf_contract(
/*==========*/
- ibool sync) /*!< in: TRUE if the caller wants to wait for the
+ bool sync) /*!< in: TRUE if the caller wants to wait for the
issued read with the highest tablespace address
to complete */
{
ulint n_pages;
- return(ibuf_merge(0, &n_pages, sync));
+ return(ibuf_merge_pages(&n_pages, sync));
}
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
+/** Contract the change buffer by reading pages to the buffer pool.
+@param[in] full If true, do a full contraction based
+on PCT_IO(100). If false, the size of contract batch is determined
+based on the current size of the change buffer.
@return a lower limit for the combined size in bytes of entries which
will be merged from ibuf trees to the pages read, 0 if ibuf is
empty */
UNIV_INTERN
ulint
-ibuf_contract_in_background(
-/*========================*/
- table_id_t table_id, /*!< in: if merge should be done only
- for a specific table, for all tables
- this should be 0 */
- ibool full) /*!< in: TRUE if the caller wants to
- do a full contract based on PCT_IO(100).
- If FALSE then the size of contract
- batch is determined based on the
- current size of the ibuf tree. */
+ibuf_merge_in_background(
+/*=====================*/
+ bool full) /*!< in: TRUE if the caller wants to
+ do a full contract based on PCT_IO(100).
+ If FALSE then the size of contract
+ batch is determined based on the
+ current size of the ibuf tree. */
{
ulint sum_bytes = 0;
ulint sum_pages = 0;
ulint n_pages;
#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
- if (srv_ibuf_disable_background_merge && table_id == 0) {
+ if (srv_ibuf_disable_background_merge) {
return(0);
}
#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
while (sum_pages < n_pages) {
ulint n_bytes;
- n_bytes = ibuf_merge(table_id, &n_pag2, FALSE);
+ n_bytes = ibuf_merge(&n_pag2, false);
if (n_bytes == 0) {
return(sum_bytes);
Buffer an operation in the insert/delete buffer, instead of doing it
directly to the disk page, if this is possible.
@return DB_SUCCESS, DB_STRONG_FAIL or other error */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
ibuf_insert_low(
/*============*/
#ifdef UNIV_IBUF_DEBUG
fputs("Ibuf too big\n", stderr);
#endif
- /* Use synchronous contract (== TRUE) */
- ibuf_contract(TRUE);
+ ibuf_contract(true);
return(DB_STRONG_FAIL);
}
During merge, inserts to an index page a secondary index entry extracted
from the insert buffer.
@return newly inserted record */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
rec_t*
ibuf_insert_to_index_page_low(
/*==========================*/
/*********************************************************************//**
Restores insert buffer tree cursor position
@return TRUE if the position was restored; FALSE if not */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
ibool
ibuf_restore_pos(
/*=============*/
resort to a pessimistic delete, this function commits mtr and closes
the cursor.
@return TRUE if mtr was committed and pcur closed in this operation */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
ibool
ibuf_delete_rec(
/*============*/
/*****************************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
#endif
#if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
-#define UNIV_NO_IGNORE __attribute__ ((warn_unused_result))
+#define UNIV_NO_IGNORE MY_ATTRIBUTE ((warn_unused_result))
#else
#define UNIV_NO_IGNORE
#endif /* __GNUC__ && __GNUC__ > 2 && !__INTEL_COMPILER */
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, 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
/*==================*/
const buf_block_t* block, /*!< in: corrupted block */
const dict_index_t* index) /*!< in: index tree */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/** Assert that a B-tree page is not corrupted.
@param block buffer block containing a B-tree page
ulint page_no, /*!< in: start page of the column */
dict_index_t* index, /*!< in/out: index tree */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Display the references to off-page columns.
This function is to be called from a debugger,
btr_blob_dbg_print(
/*===============*/
const dict_index_t* index) /*!< in: index tree */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Check that there are no references to off-page columns from or to
the given page. Invoked when freeing or clearing a page.
/*==================*/
dict_index_t* index, /*!< in: index */
ulint page_no) /*!< in: page number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Modify the 'deleted' flag of a record. */
dict_index_t* index, /*!< in/out: index */
const ulint* offsets,/*!< in: rec_get_offs(rec, index) */
ibool del) /*!< in: TRUE=deleted, FALSE=exists */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Change the ownership of an off-page column. */
UNIV_INTERN
const ulint* offsets,/*!< in: rec_get_offs(rec, index) */
ulint i, /*!< in: ith field in rec */
ibool own) /*!< in: TRUE=owned, FALSE=disowned */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Assert that there are no BLOB references to or from the given page. */
# define btr_blob_dbg_assert_empty(index, page_no) \
ut_a(btr_blob_dbg_is_empty(index, page_no))
/*=========*/
const dict_index_t* index, /*!< in: index tree */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Checks and adjusts the root node of a tree during IMPORT TABLESPACE.
btr_root_adjust_on_import(
/*======================*/
const dict_index_t* index) /*!< in: index tree */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Gets the height of the B-tree (the level of the root, when the leaf
/*===========*/
dict_index_t* index, /*!< in: index tree */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Gets a buffer page and declares its latching order level. */
UNIV_INLINE
btr_page_get_index_id(
/*==================*/
const page_t* page) /*!< in: index page */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/********************************************************//**
Gets the node level field in an index page.
btr_page_get_level_low(
/*===================*/
const page_t* page) /*!< in: index page */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#define btr_page_get_level(page, mtr) btr_page_get_level_low(page)
/********************************************************//**
Gets the next index page number.
/*==============*/
const page_t* page, /*!< in: index page */
mtr_t* mtr) /*!< in: mini-transaction handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************//**
Gets the previous index page number.
@return prev page number */
/*==============*/
const page_t* page, /*!< in: index page */
mtr_t* mtr) /*!< in: mini-transaction handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Gets pointer to the previous user record in the tree. It is assumed
that the caller has appropriate latches on the page and its neighbor.
rec_t* rec, /*!< in: record on leaf level */
mtr_t* mtr) /*!< in: mtr holding a latch on the page, and if
needed, also to the previous page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Gets pointer to the next user record in the tree. It is assumed
that the caller has appropriate latches on the page and its neighbor.
rec_t* rec, /*!< in: record on leaf level */
mtr_t* mtr) /*!< in: mtr holding a latch on the page, and if
needed, also to the next page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Releases the latch on a leaf page and bufferunfixes it. */
UNIV_INLINE
ulint latch_mode, /*!< in: BTR_SEARCH_LEAF or
BTR_MODIFY_LEAF */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Gets the child node file address in a node pointer.
NOTE: the offsets array must contain all offsets for the record since
/*===========================*/
const rec_t* rec, /*!< in: node pointer record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/************************************************************//**
Creates the root node for a new index tree.
@return page number of the created root, FIL_NULL if did not succeed */
index_id_t index_id,/*!< in: index id */
dict_index_t* index, /*!< in: index */
mtr_t* mtr) /*!< in: mini-transaction handle */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/************************************************************//**
Frees a B-tree except the root page, which MUST be freed after this
by calling btr_free_root. */
or 0 for uncompressed pages */
ulint root_page_no, /*!< in: root page number */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Makes tree one level higher by splitting the root, and inserts
the tuple. It is assumed that mtr contains an x-latch on the tree.
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Reorganizes an index page.
page_cur_t* cursor, /*!< in/out: page cursor */
dict_index_t* index, /*!< in: the index tree of the page */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Reorganizes an index page.
page_cur_t* cursor, /*!< in/out: page cursor */
dict_index_t* index, /*!< in: the index tree of the page */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Decides if the page should be split at the convergence point of
inserts converging to left.
rec_t** split_rec)/*!< out: if split recommended,
the first record on upper half page,
or NULL if tuple should be first */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Decides if the page should be split at the convergence point of
inserts converging to right.
rec_t** split_rec)/*!< out: if split recommended,
the first record on upper half page,
or NULL if tuple should be first */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Splits an index page to halves and inserts the tuple. It is assumed
that mtr holds an x-latch to the index tree. NOTE: the tree x-latch is
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************//**
Inserts a data tuple to a tree on a non-leaf level. It is assumed
that mtr holds an x-latch on the tree. */
const char* file, /*!< in: file name */
ulint line, /*!< in: line where called */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
# define btr_insert_on_non_leaf_level(f,i,l,t,m) \
btr_insert_on_non_leaf_level_func(f,i,l,t,__FILE__,__LINE__,m)
#endif /* !UNIV_HOTBACKUP */
/*=================*/
rec_t* rec, /*!< in/out: record */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/*************************************************************//**
Deletes on the upper level the node pointer to a page. */
dict_index_t* index, /*!< in: index tree */
buf_block_t* block, /*!< in: page whose node pointer is deleted */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
/************************************************************//**
Checks that the node pointer to a page is appropriate.
dict_index_t* index, /*!< in: index tree */
buf_block_t* block, /*!< in: index page */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/*************************************************************//**
Tries to merge the page first to the left immediate brother if such a
ibool adjust, /*!< in: TRUE if should adjust the
cursor position even if compression occurs */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Discards a page from a B-tree. This is used to remove the last record from
a B-tree page: the whole page must be removed at the same time. This cannot
btr_cur_t* cursor, /*!< in: cursor on the page to discard: not on
the root page */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/****************************************************************//**
Parses the redo log record for setting an index record as the predefined
ulint comp, /*!< in: nonzero=compact page format */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
- __attribute__((nonnull(1,2), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2), warn_unused_result));
/***********************************************************//**
Parses a redo log record of reorganizing a page.
@return end of log record or NULL */
bool compressed,/*!< in: true if compressed page */
buf_block_t* block, /*!< in: page to be reorganized, or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
- __attribute__((nonnull(1,2,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3), warn_unused_result));
#ifndef UNIV_HOTBACKUP
/**************************************************************//**
Gets the number of pages in a B-tree.
ulint flag, /*!< in: BTR_N_LEAF_PAGES or BTR_TOTAL_SIZE */
mtr_t* mtr) /*!< in/out: mini-transaction where index
is s-latched */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Allocates a new file page to be used in an index tree. NOTE: we assume
that the caller has made the reservation for free extents!
mtr_t* init_mtr) /*!< in/out: mini-transaction
for x-latching and initializing
the page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Frees a file page used in an index tree. NOTE: cannot free field external
storage pages because the page must contain info on its level. */
dict_index_t* index, /*!< in: index tree */
buf_block_t* block, /*!< in: block to be freed, x-latched */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Frees a file page used in an index tree. Can be used also to BLOB
external storage pages, because the page level 0 can be given as an
buf_block_t* block, /*!< in: block to be freed, x-latched */
ulint level, /*!< in: page level */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_BTR_PRINT
/*************************************************************//**
Prints size info of a B-tree. */
btr_print_size(
/*===========*/
dict_index_t* index) /*!< in: index tree */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Prints directories and other info of all nodes in the index. */
UNIV_INTERN
dict_index_t* index, /*!< in: index */
ulint width) /*!< in: print this many entries from start
and end */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* UNIV_BTR_PRINT */
/************************************************************//**
Checks the size and number of fields in a record based on the definition of
ibool dump_on_error) /*!< in: TRUE if the function
should print hex dump of record
and page on error */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Checks the consistency of an index tree.
@return TRUE if ok */
/*===============*/
dict_index_t* index, /*!< in: index */
const trx_t* trx) /*!< in: transaction or 0 */
- __attribute__((nonnull(1), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
#define BTR_N_LEAF_PAGES 1
#define BTR_TOTAL_SIZE 2
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
btr_page_get_next(
/*==============*/
const page_t* page, /*!< in: index page */
- mtr_t* mtr __attribute__((unused)))
+ mtr_t* mtr MY_ATTRIBUTE((unused)))
/*!< in: mini-transaction handle */
{
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
ut_ad(mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_X_FIX)
|| mtr_memo_contains_page(mtr, page, MTR_MEMO_PAGE_S_FIX));
ulint next, /*!< in: next page number */
mtr_t* mtr) /*!< in: mini-transaction handle */
{
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
if (page_zip) {
mach_write_to_4(page + FIL_PAGE_NEXT, next);
btr_page_get_prev(
/*==============*/
const page_t* page, /*!< in: index page */
- mtr_t* mtr __attribute__((unused))) /*!< in: mini-transaction handle */
+ mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in: mini-transaction handle */
{
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
return(mach_read_from_4(page + FIL_PAGE_PREV));
}
ulint prev, /*!< in: previous page number */
mtr_t* mtr) /*!< in: mini-transaction handle */
{
- ut_ad(page && mtr);
+ ut_ad(page != NULL);
+ ut_ad(mtr != NULL);
if (page_zip) {
mach_write_to_4(page + FIL_PAGE_PREV, prev);
/*****************************************************************************
-Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
const char* file, /*!< in: file name */
ulint line, /*!< in: line where called */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define btr_cur_open_at_index_side(f,i,l,c,lv,m) \
btr_cur_open_at_index_side_func(f,i,l,c,lv,__FILE__,__LINE__,m)
/**********************************************************************//**
compressed tablespace, the caller must
mtr_commit(mtr) before latching
any further pages */
- __attribute__((nonnull(2,3,4,5,6,7,10), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(2,3,4,5,6,7,10), warn_unused_result));
/*************************************************************//**
Performs an insert on a page of an index tree. It is assumed that mtr
holds an x-latch on the tree and on the cursor page. If the insert is
ulint n_ext, /*!< in: number of externally stored columns */
que_thr_t* thr, /*!< in: query thread or NULL */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull(2,3,4,5,6,7,10), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(2,3,4,5,6,7,10), warn_unused_result));
/*************************************************************//**
See if there is enough place in the page modification log to log
an update-in-place.
bool create, /*!< in: true=delete-and-insert,
false=update-in-place */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_DEBUG
# define btr_cur_update_alloc_zip(page_zip,cursor,index,offsets,len,cr,mtr) \
btr_cur_update_alloc_zip_func(page_zip,cursor,index,offsets,len,cr,mtr)
is a secondary index, the caller must
mtr_commit(mtr) before latching any
further pages */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/***********************************************************//**
Writes a redo log record of updating a record in-place. */
UNIV_INTERN
trx_id_t trx_id, /*!< in: transaction id */
roll_ptr_t roll_ptr, /*!< in: roll ptr */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Tries to update a record on a page in an index tree. It is assumed that mtr
holds an x-latch on the page. The operation does not succeed if there is too
is a secondary index, the caller must
mtr_commit(mtr) before latching any
further pages */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/*************************************************************//**
Performs an update of a record on a page of a tree. It is assumed
that mtr holds an x-latch on the tree and on the cursor page. If the
trx_id_t trx_id, /*!< in: transaction id */
mtr_t* mtr) /*!< in/out: mini-transaction; must be committed
before latching any further pages */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/***********************************************************//**
Marks a clustered index record deleted. Writes an undo log record to
undo log on this delete marking. Writes in the trx id field the id
const ulint* offsets,/*!< in: rec_get_offsets(rec) */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************//**
Sets a secondary index record delete mark to TRUE or FALSE.
@return DB_SUCCESS, DB_LOCK_WAIT, or error number */
ibool val, /*!< in: value to set */
que_thr_t* thr, /*!< in: query thread */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Tries to compress a page of the tree if it seems useful. It is assumed
that mtr holds an x-latch on the tree and on the cursor page. To avoid
ibool adjust, /*!< in: TRUE if should adjust the
cursor position even if compression occurs */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************//**
Removes the record on which the tree cursor is positioned. It is assumed
that the mtr has an x-latch on the page where the cursor is positioned,
TRUE on a leaf page of a secondary
index, the mtr must be committed
before latching any further pages */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# ifdef UNIV_DEBUG
# define btr_cur_optimistic_delete(cursor, flags, mtr) \
btr_cur_optimistic_delete_func(cursor, flags, mtr)
ulint flags, /*!< in: BTR_CREATE_FLAG or 0 */
enum trx_rb_ctx rb_ctx, /*!< in: rollback context */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Parses a redo log record of updating a record in-place.
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
const upd_t* update, /*!< in: update vector */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull(2,3,4,5,6)));
+ MY_ATTRIBUTE((nonnull(2,3,4,5,6)));
/** Operation code for btr_store_big_rec_extern_fields(). */
enum blob_op {
btr_blob_op_is_update(
/*==================*/
enum blob_op op) /*!< in: operation */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*******************************************************************//**
Stores the fields in big_rec_vec to the tablespace and puts pointers to
mtr_t* btr_mtr, /*!< in: mtr containing the
latches to the clustered index */
enum blob_op op) /*! in: operation code */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Frees the space in an externally stored field to the file space
dtuple_t* tuple, /*!< in/out: data tuple */
const upd_t* update, /*!< in: update vector */
mem_heap_t* heap) /*!< in: memory heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Sets a secondary index record's delete mark to the given value. This
function is only used by the insert buffer merge mechanism. */
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
ulint level, /*!< in: level to search for
(0=leaf) */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Gets the up_match value for a pcur after a search.
@return number of matched fields at the cursor or to the right if
/*****************************************************************************
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
btr_search_get_info(
/*================*/
dict_index_t* index) /*!< in: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*****************************************************************//**
Creates and initializes a search info struct.
@return own: search info struct */
/*****************************************************************************
-Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
dict_index_t* index, /*!< in/out: index tree */
const btr_blob_dbg_t* b, /*!< in: the reference */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Remove from index->blobs a reference to an off-page column.
@param index the index tree
dict_index_t* index, /*!< in/out: index tree */
const btr_blob_dbg_t* b, /*!< in: the reference */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Add to index->blobs any references to off-page columns from a record.
dict_index_t* index, /*!< in/out: index */
const ulint* offsets,/*!< in: offsets */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Remove from index->blobs any references to off-page columns from a record.
@return number of references removed */
dict_index_t* index, /*!< in/out: index */
const ulint* offsets,/*!< in: offsets */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Count and add to index->blobs any references to off-page columns
from records on a page.
const page_t* page, /*!< in: rewritten page */
dict_index_t* index, /*!< in/out: index */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Count and remove from index->blobs any references to off-page columns
from records on a page.
const page_t* page, /*!< in: b-tree page */
dict_index_t* index, /*!< in/out: index */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Restore in index->blobs any references to off-page columns
Used when page reorganize fails due to compressed page overflow. */
const page_t* page, /*!< in: copy of original page */
dict_index_t* index, /*!< in/out: index */
const char* ctx) /*!< in: context (for logging) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Operation that processes the BLOB references of an index record
@param[in] rec record on index page
dict_index_t* index, /*!< in/out: index */
const char* ctx, /*!< in: context (for logging) */
const btr_blob_dbg_op_f op) /*!< in: operation on records */
- __attribute__((nonnull(1,3,4,5)));
+ MY_ATTRIBUTE((nonnull(1,3,4,5)));
#else /* UNIV_BLOB_DEBUG */
# define btr_blob_dbg_add_rec(rec, index, offsets, ctx) ((void) 0)
# define btr_blob_dbg_add(page, index, ctx) ((void) 0)
/*****************************************************************************
-Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
storage was allocated from the
LRU list and buf_pool->mutex was
temporarily released */
- __attribute__((malloc, nonnull));
+ MY_ATTRIBUTE((malloc, nonnull));
/**********************************************************************//**
Deallocate a block. */
be pointed to by the buffer pool */
ulint size) /*!< in: block size,
up to UNIV_PAGE_SIZE */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_NONINL
# include "buf0buddy.ic"
/*****************************************************************************
-Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
allocated from the LRU list and
buf_pool->mutex was temporarily
released */
- __attribute__((malloc, nonnull));
+ MY_ATTRIBUTE((malloc, nonnull));
/**********************************************************************//**
Deallocate a block. */
pointed to by the buffer pool */
ulint i) /*!< in: index of buf_pool->zip_free[],
or BUF_BUDDY_SIZES */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Get the index of buf_pool->zip_free[] for a given block size.
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
buf_page_get_state(bpage) must be
BUF_BLOCK_ZIP_DIRTY or BUF_BLOCK_ZIP_PAGE */
buf_page_t* dpage) /*!< in/out: destination control block */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets the current size of buffer buf_pool in bytes.
@return size in bytes */
buf_page_t*
buf_page_alloc_descriptor(void)
/*===========================*/
- __attribute__((malloc));
+ MY_ATTRIBUTE((malloc));
/********************************************************************//**
Free a buf_page_t descriptor. */
UNIV_INLINE
buf_page_free_descriptor(
/*=====================*/
buf_page_t* bpage) /*!< in: bpage descriptor to free. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Allocates a buffer block.
buf_page_get_freed_page_clock(
/*==========================*/
const buf_page_t* bpage) /*!< in: block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/********************************************************************//**
Reads the freed_page_clock of a buffer block.
@return freed_page_clock */
buf_block_get_freed_page_clock(
/*===========================*/
const buf_block_t* block) /*!< in: block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/********************************************************************//**
Tells if a block is still close enough to the MRU end of the LRU list
ulint line, /*!< in: line */
# endif /* UNIV_SYNC_DEBUG */
buf_block_t* block) /*!< in/out: block to bufferfix */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Increments the bufferfix count. */
const byte* read_buf, /*!< in: a database page */
ulint zip_size) /*!< in: size of compressed page;
0 for uncompressed pages */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Checks if a page is all zeroes.
@return TRUE if the page is all zeroes */
buf_block_get_lock_hash_val(
/*========================*/
const buf_block_t* block) /*!< in: block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#ifdef UNIV_DEBUG
/*********************************************************************//**
Finds a block in the buffer pool that points to a
ulint flags) /*!< in: 0 or
BUF_PAGE_PRINT_NO_CRASH or
BUF_PAGE_PRINT_NO_FULL */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Decompress a block.
@return TRUE if successful */
buf_block_get_state(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Sets the state of a block. */
UNIV_INLINE
buf_page_in_file(
/*=============*/
const buf_page_t* bpage) /*!< in: pointer to control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
Determines if a block should be on unzip_LRU list.
buf_page_belongs_to_unzip_LRU(
/*==========================*/
const buf_page_t* bpage) /*!< in: pointer to control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the mutex of a block.
buf_page_get_mutex(
/*===============*/
const buf_page_t* bpage) /*!< in: pointer to control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Get the flush type of a page.
buf_page_get_flush_type(
/*====================*/
const buf_page_t* bpage) /*!< in: buffer page */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Set the flush type of a page. */
UNIV_INLINE
buf_page_get_io_fix(
/*================*/
const buf_page_t* bpage) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the io_fix state of a block.
@return io_fix state */
buf_block_get_io_fix(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Sets the io_fix state of a block. */
UNIV_INLINE
buf_page_can_relocate(
/*==================*/
const buf_page_t* bpage) /*!< control block being relocated */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Determine if a block has been flagged old.
buf_page_is_old(
/*============*/
const buf_page_t* bpage) /*!< in: control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Flag a block old. */
UNIV_INLINE
buf_page_is_accessed(
/*=================*/
const buf_page_t* bpage) /*!< in: control block */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************************//**
Flag a block accessed. */
UNIV_INLINE
buf_page_set_accessed(
/*==================*/
buf_page_t* bpage) /*!< in/out: control block */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets the buf_block_t handle of a buffered file block if an uncompressed
page frame exists, or NULL. Note: even though bpage is not declared a
buf_page_get_block(
/*===============*/
buf_page_t* bpage) /*!< in: control block, or NULL */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/*********************************************************************//**
buf_block_get_frame(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#else /* UNIV_DEBUG */
# define buf_block_get_frame(block) (block)->frame
#endif /* UNIV_DEBUG */
buf_page_get_space(
/*===============*/
const buf_page_t* bpage) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the space id of a block.
@return space id */
buf_block_get_space(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the page number of a block.
@return page number */
buf_page_get_page_no(
/*=================*/
const buf_page_t* bpage) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the page number of a block.
@return page number */
buf_block_get_page_no(
/*==================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the compressed page size of a block.
@return compressed page size, or 0 */
buf_page_get_zip_size(
/*==================*/
const buf_page_t* bpage) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the compressed page size of a block.
@return compressed page size, or 0 */
buf_block_get_zip_size(
/*===================*/
const buf_block_t* block) /*!< in: pointer to the control block */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/*********************************************************************//**
Gets the compressed page descriptor corresponding to an uncompressed page
if applicable. */
/*==================*/
ulint space, /*!< in: space id */
ulint offset) /*!< in: offset of the page within space */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************************//**
Calculates the index of a buffer pool to the buf_pool[] array.
@return the position of the buffer pool in buf_pool[] */
buf_pool_index(
/*===========*/
const buf_pool_t* buf_pool) /*!< in: buffer pool */
- __attribute__((nonnull, const));
+ MY_ATTRIBUTE((nonnull, const));
/******************************************************************//**
Returns the buffer pool instance given a page instance
@return buf_pool */
/*=======================*/
buf_pool_t* buf_pool, /*!< buffer pool instance */
const buf_page_t* bpage) /*!< in: block */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
Add watch for the given page to be read in. Caller must have the buffer pool
@return NULL if watch set, block if the page is in the buffer pool */
ulint space, /*!< in: space id */
ulint offset, /*!< in: page number */
ulint fold) /*!< in: buf_page_address_fold(space, offset) */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/****************************************************************//**
Stop watching if the page has been read in.
buf_pool_watch_set(space,offset) must have returned NULL before. */
/*====================*/
ulint space, /*!< in: space id */
ulint offset) /*!< in: page number */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/********************************************************************//**
Get total buffer pool statistics. */
UNIV_INTERN
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
/*===============*/
buf_pool_t* buf_pool, /*!< in/out: buffer pool instance */
buf_block_t* block) /*!< in/out: buffer control block */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */
/*******************************************************************//**
This utility flushes dirty blocks from the end of the flush list of
buf_page_t* bpage, /*!< in: buffer control block, must be
buf_page_in_file(bpage) */
buf_flush_t flush_type)/*!< in: type of flush */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#ifdef UNIV_DEBUG
/******************************************************************//**
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
buf_page_t* bpage, /*!< in: block to be freed */
bool zip) /*!< in: true if should remove also the
compressed page of an uncompressed page */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Try to free a replaceable block.
@return TRUE if found and freed */
ibool scan_all) /*!< in: scan whole LRU list
if TRUE, otherwise scan only
'old' blocks. */
- __attribute__((nonnull,warn_unused_result));
+ MY_ATTRIBUTE((nonnull,warn_unused_result));
/******************************************************************//**
Returns a free block from the buf_pool. The block is taken off the
free list. If it is empty, returns NULL.
buf_LRU_get_free_block(
/*===================*/
buf_pool_t* buf_pool) /*!< in/out: buffer pool instance */
- __attribute__((nonnull,warn_unused_result));
+ MY_ATTRIBUTE((nonnull,warn_unused_result));
/******************************************************************//**
Determines if the unzip_LRU list should be used for evicting a victim
instead of the general LRU list.
buf_page_t* bpage) /*!< in/out: block, must contain a file page and
be in a state where it can be freed; there
may or may not be a hash index to the page */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/**********************************************************************//**
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
dfield_get_type(
/*============*/
const dfield_t* field) /*!< in: SQL data field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets pointer to the data in a field.
@return pointer to data */
dfield_get_data(
/*============*/
const dfield_t* field) /*!< in: field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#else /* UNIV_DEBUG */
# define dfield_get_type(field) (&(field)->type)
# define dfield_get_data(field) ((field)->data)
/*============*/
dfield_t* field, /*!< in: SQL data field */
const dtype_t* type) /*!< in: pointer to data type struct */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets length of field data.
@return length of data; UNIV_SQL_NULL if SQL null data */
dfield_get_len(
/*===========*/
const dfield_t* field) /*!< in: field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets length in a field. */
UNIV_INLINE
/*===========*/
dfield_t* field, /*!< in: field */
ulint len) /*!< in: length or UNIV_SQL_NULL */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Determines if a field is SQL NULL
@return nonzero if SQL null data */
dfield_is_null(
/*===========*/
const dfield_t* field) /*!< in: field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Determines if a field is externally stored
@return nonzero if externally stored */
dfield_is_ext(
/*==========*/
const dfield_t* field) /*!< in: field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets the "external storage" flag */
UNIV_INLINE
dfield_set_ext(
/*===========*/
dfield_t* field) /*!< in/out: field */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Sets pointer to the data and length in a field. */
UNIV_INLINE
dfield_t* field, /*!< in: field */
const void* data, /*!< in: data */
ulint len) /*!< in: length or UNIV_SQL_NULL */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*********************************************************************//**
Sets a data field to SQL NULL. */
UNIV_INLINE
dfield_set_null(
/*============*/
dfield_t* field) /*!< in/out: field */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Writes an SQL null field full of zeros. */
UNIV_INLINE
/*================*/
byte* data, /*!< in: pointer to a buffer of size len */
ulint len) /*!< in: SQL null size in bytes */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Copies the data and len fields. */
UNIV_INLINE
/*=============*/
dfield_t* field1, /*!< out: field to copy to */
const dfield_t* field2) /*!< in: field to copy from */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Copies a data field to another. */
UNIV_INLINE
/*========*/
dfield_t* field1, /*!< out: field to copy to */
const dfield_t* field2) /*!< in: field to copy from */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Copies the data pointed to by a data field. */
UNIV_INLINE
/*=======*/
dfield_t* field, /*!< in/out: data field */
mem_heap_t* heap) /*!< in: memory heap where allocated */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
Tests if two data fields are equal.
const dfield_t* field2, /*!< in: field */
ulint len) /*!< in: maximum prefix to compare,
or 0 to compare the whole field length */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Tests if dfield data length and content is equal to the given.
@return TRUE if equal */
const dfield_t* field, /*!< in: field */
ulint len, /*!< in: data length or UNIV_SQL_NULL */
const byte* data) /*!< in: data */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//**
Gets number of fields in a data tuple.
dtuple_get_n_fields(
/*================*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_DEBUG
/*********************************************************************//**
Gets nth field of a tuple.
dtuple_get_info_bits(
/*=================*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets info bits in a data tuple. */
UNIV_INLINE
/*=================*/
dtuple_t* tuple, /*!< in: tuple */
ulint info_bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets number of fields used in record comparisons.
@return number of fields used in comparisons in rem0cmp.* */
dtuple_get_n_fields_cmp(
/*====================*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets number of fields used in record comparisons. */
UNIV_INLINE
dtuple_t* tuple, /*!< in: tuple */
ulint n_fields_cmp) /*!< in: number of fields used in
comparisons in rem0cmp.* */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/* Estimate the number of bytes that are going to be allocated when
creating a new dtuple_t object */
void* buf, /*!< in, out: buffer to use */
ulint buf_size, /*!< in: buffer size */
ulint n_fields) /*!< in: number of fields */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Creates a data tuple to a memory heap. The default value for number
is created, DTUPLE_EST_ALLOC(n_fields)
bytes will be allocated from this heap */
ulint n_fields)/*!< in: number of fields */
- __attribute__((nonnull, malloc));
+ MY_ATTRIBUTE((nonnull, malloc));
/*********************************************************************//**
Sets number of fields used in a tuple. Normally this is set in
/*================*/
dtuple_t* tuple, /*!< in: tuple */
ulint n_fields) /*!< in: number of fields */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Copies a data tuple to another. This is a shallow copy; if a deep copy
is desired, dfield_dup() will have to be invoked on each field.
const dtuple_t* tuple, /*!< in: tuple to copy from */
mem_heap_t* heap) /*!< in: memory heap
where the tuple is created */
- __attribute__((nonnull, malloc));
+ MY_ATTRIBUTE((nonnull, malloc));
/**********************************************************//**
The following function returns the sum of data lengths of a tuple. The space
occupied by the field structs or the tuple struct is not counted.
/*=================*/
const dtuple_t* tuple, /*!< in: typed data tuple */
ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Computes the number of externally stored fields in a data tuple.
@return number of fields */
dtuple_get_n_ext(
/*=============*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/************************************************************//**
Compare two data tuples, respecting the collation of character fields.
@return 1, 0 , -1 if tuple1 is greater, equal, less, respectively,
/*============*/
const dtuple_t* tuple1, /*!< in: tuple 1 */
const dtuple_t* tuple2) /*!< in: tuple 2 */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/************************************************************//**
Folds a prefix given as the number of fields of a tuple.
@return the folded value */
ulint n_bytes,/*!< in: number of bytes to fold in an
incomplete last field */
index_id_t tree_id)/*!< in: index tree id */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/*******************************************************************//**
Sets types of fields binary in a tuple. */
UNIV_INLINE
/*====================*/
dtuple_t* tuple, /*!< in: data tuple */
ulint n) /*!< in: number of fields to set */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Checks if a dtuple contains an SQL null value.
@return TRUE if some field is SQL null */
dtuple_contains_null(
/*=================*/
const dtuple_t* tuple) /*!< in: dtuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Checks that a data field is typed. Asserts an error if not.
@return TRUE if ok */
dfield_check_typed(
/*===============*/
const dfield_t* field) /*!< in: data field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Checks that a data tuple is typed. Asserts an error if not.
@return TRUE if ok */
dtuple_check_typed(
/*===============*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Checks that a data tuple is typed.
@return TRUE if ok */
dtuple_check_typed_no_assert(
/*=========================*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_DEBUG
/**********************************************************//**
Validates the consistency of a tuple which must be complete, i.e,
dtuple_validate(
/*============*/
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/*************************************************************//**
Pretty prints a dfield value according to its data type. */
dfield_print(
/*=========*/
const dfield_t* dfield) /*!< in: dfield */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Pretty prints a dfield value according to its data type. Also the hex string
is printed if a string contains non-printable characters. */
dfield_print_also_hex(
/*==================*/
const dfield_t* dfield) /*!< in: dfield */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************//**
The following function prints the contents of a tuple. */
UNIV_INTERN
/*=========*/
FILE* f, /*!< in: output stream */
const dtuple_t* tuple) /*!< in: tuple */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Moves parts of long fields in entry to the big record vector so that
the size of tuple drops below the maximum record size allowed in the
dtuple_t* entry, /*!< in/out: index entry */
ulint* n_ext) /*!< in/out: number of
externally stored columns */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
/**************************************************************//**
Puts back to entry the data stored in vector. Note that to ensure the
fields in entry can accommodate the data, vector must have been created
dtuple_t* entry, /*!< in: entry whose data was put to vector */
big_rec_t* vector) /*!< in, own: big rec vector; it is
freed in this function */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Frees the memory in a big rec vector. */
UNIV_INLINE
/*================*/
big_rec_t* vector) /*!< in, own: big rec vector; it is
freed in this function */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*######################################################################*/
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
dfield_t* field, /*!< in: SQL data field */
const dtype_t* type) /*!< in: pointer to data type struct */
{
- ut_ad(field && type);
+ ut_ad(field != NULL);
+ ut_ad(type != NULL);
field->type = *type;
}
dfield_t* field1, /*!< out: field to copy to */
const dfield_t* field2) /*!< in: field to copy from */
{
- ut_ad(field1 && field2);
+ ut_ad(field1 != NULL);
+ ut_ad(field2 != NULL);
field1->data = field2->data;
field1->len = field2->len;
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
dberr_t
dict_boot(void)
/*===========*/
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*****************************************************************//**
Creates and initializes the data dictionary at the server bootstrap.
dberr_t
dict_create(void)
/*=============*/
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
Check if a table id belongs to system table.
dict_is_sys_table(
/*==============*/
table_id_t id) /*!< in: table id to check */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/* Space id and page no where the dictionary header resides */
#define DICT_HDR_SPACE 0 /* the SYSTEM tablespace */
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
incremented if used */
const char* name, /*!< in: table name */
dict_foreign_t* foreign)/*!< in/out: foreign key */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Adds the given set of foreign key objects to the dictionary tables
in the database. This function does not modify the dictionary cache. The
const dict_foreign_set& local_fk_set,
const dict_table_t* table,
trx_t* trx)
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
Creates the tablespaces and datafiles system tables inside InnoDB
at server bootstrap or server start if they are not found or are
const char* name, /*!< in: table name */
const dict_foreign_t* foreign,/*!< in: foreign key */
trx_t* trx) /*!< in/out: dictionary transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/* Table create node structure */
struct tab_node_t{
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
bool
row_is_mysql_tmp_table_name(
/*========================*/
- const char* name) __attribute__((warn_unused_result));
+ const char* name) MY_ATTRIBUTE((warn_unused_result));
/*!< in: table name in the form
'database/tablename' */
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, 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
dict_casedn_str(
/*============*/
char* a) /*!< in/out: string to put in lower case */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Get the database name length in a table name.
@return database name length */
/*=================*/
const char* name) /*!< in: table name in the form
dbname '/' tablename */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Open a table from its database and table name, this is currently used by
foreign constraint parser to get the referenced table.
/*================*/
const char* name) /*!< in: table name in the form
dbname '/' tablename */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Operation to perform when opening a table */
enum dict_table_op_t {
table_id_t table_id, /*!< in: table id */
ibool dict_locked, /*!< in: TRUE=data dictionary locked */
dict_table_op_t table_op) /*!< in: operation to perform */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/********************************************************************//**
Decrements the count of open handles to a table. */
UNIV_INTERN
ibool try_drop) /*!< in: TRUE=try to drop any orphan
indexes after an aborted online
index creation */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Inits the data dictionary module. */
UNIV_INTERN
dict_col_get_mbminlen(
/*==================*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the maximum number of bytes per character.
@return maximum multi-byte char size, in bytes */
dict_col_get_mbmaxlen(
/*==================*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets the minimum and maximum number of bytes per character. */
UNIV_INLINE
character size, in bytes */
ulint mbmaxlen) /*!< in: minimum multi-byte
character size, in bytes */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets the column data type. */
UNIV_INLINE
/*===============*/
const dict_col_t* col, /*!< in: column */
dtype_t* type) /*!< out: data type */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Determine bytes of column prefix to be stored in the undo log. Please
note if the table format is UNIV_FORMAT_A (< UNIV_FORMAT_B), no prefix
dict_table_t* table, /*!< in: table */
const dict_col_t* col) /*!< in: column which index prefix
is based on */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
#ifdef UNIV_DEBUG
/*********************************************************************//**
/*=======================*/
const dict_col_t* col, /*!< in: column */
const dtype_t* type) /*!< in: data type */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
#ifndef UNIV_HOTBACKUP
/***********************************************************************//**
dict_col_get_min_size(
/*==================*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Returns the maximum size of the column.
@return maximum size */
dict_col_get_max_size(
/*==================*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Returns the size of a fixed size column, 0 if not a fixed size column.
@return fixed size, or 0 */
/*====================*/
const dict_col_t* col, /*!< in: column */
ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Returns the ROW_FORMAT=REDUNDANT stored SQL NULL size of a column.
For fixed length types it is the fixed length of the type, otherwise 0.
/*=======================*/
const dict_col_t* col, /*!< in: column */
ulint comp) /*!< in: nonzero=ROW_FORMAT=COMPACT */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the column number.
@return col->ind, table column position (starting from 0) */
dict_col_get_no(
/*============*/
const dict_col_t* col) /*!< in: column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the column position in the clustered index. */
UNIV_INLINE
/*===================*/
const dict_col_t* col, /*!< in: table column */
const dict_index_t* clust_index) /*!< in: clustered index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
If the given column name is reserved for InnoDB system columns, return
TRUE.
dict_col_name_is_reserved(
/*======================*/
const char* name) /*!< in: column name */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Acquire the autoinc lock. */
UNIV_INTERN
dict_table_autoinc_lock(
/*====================*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Unconditionally set the autoinc counter. */
UNIV_INTERN
/*==========================*/
dict_table_t* table, /*!< in/out: table */
ib_uint64_t value) /*!< in: next value to assign to a row */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Store autoinc value when the table is evicted.
@param[in] table table evicted */
dict_table_autoinc_read(
/*====================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Updates the autoinc counter if the value supplied is greater than the
current value. */
dict_table_t* table, /*!< in/out: table */
ib_uint64_t value) /*!< in: value which was assigned to a row */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Release the autoinc lock. */
UNIV_INTERN
dict_table_autoinc_unlock(
/*======================*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
Adds system columns to a table object. */
/*==========================*/
dict_table_t* table, /*!< in/out: table */
mem_heap_t* heap) /*!< in: temporary heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Adds a table object to the dictionary cache. */
dict_table_t* table, /*!< in: table */
ibool can_be_evicted, /*!< in: TRUE if can be evicted*/
mem_heap_t* heap) /*!< in: temporary heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Removes a table object from the dictionary cache. */
UNIV_INTERN
dict_table_remove_from_cache(
/*=========================*/
dict_table_t* table) /*!< in, own: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Removes a table object from the dictionary cache. */
UNIV_INTERN
/*!< in: in ALTER TABLE we want
to preserve the original table name
in constraints which reference it */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Removes an index from the dictionary cache. */
UNIV_INTERN
/*=========================*/
dict_table_t* table, /*!< in/out: table */
dict_index_t* index) /*!< in, own: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Change the id of a table object in the dictionary cache. This is used in
DISCARD TABLESPACE. */
/*==========================*/
dict_table_t* table, /*!< in/out: table object already in cache */
table_id_t new_id) /*!< in: new id to set */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Removes a foreign constraint struct from the dictionary cache. */
UNIV_INTERN
dict_foreign_remove_from_cache(
/*===========================*/
dict_foreign_t* foreign) /*!< in, own: foreign constraint */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Adds a foreign key constraint object to the dictionary cache. May free
the object if there already is an object with the same identifier in.
compatibility */
dict_err_ignore_t ignore_err)
/*!< in: error to be ignored */
- __attribute__((nonnull(1), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
/*********************************************************************//**
Checks if a table is referenced by foreign keys.
@return TRUE if table is referenced by a foreign key */
dict_table_is_referenced_by_foreign_key(
/*====================================*/
const dict_table_t* table) /*!< in: InnoDB table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Replace the index passed in with another equivalent index in the
foreign key lists of the table.
/*!< in: column names, or NULL
to use table->col_names */
const dict_index_t* index) /*!< in: index to be replaced */
- __attribute__((nonnull(1,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,3), warn_unused_result));
/**********************************************************************//**
Determines whether a string starts with the specified keyword.
@return TRUE if str starts with keyword */
THD* thd, /*!< in: MySQL thread handle */
const char* str, /*!< in: string to scan for keyword */
const char* keyword) /*!< in: keyword to look for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Scans a table create SQL string and adds to the data dictionary
the foreign key constraints declared in the string. This function
ibool reject_fks) /*!< in: if TRUE, fail with error
code DB_CANNOT_ADD_CONSTRAINT if
any foreign keys are found. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Parses the CONSTRAINT id's to be dropped in an ALTER TABLE statement.
@return DB_SUCCESS or DB_CANNOT_DROP_CONSTRAINT if syntax error or the
to drop */
const char*** constraints_to_drop) /*!< out: id's of the
constraints to drop */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Returns a table object and increments its open handle count.
NOTE! This is a high-level function to be used mainly from outside the
dict_err_ignore_t
ignore_err) /*!< in: error to be ignored when
loading the table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Tries to find an index whose first fields are the columns in the array,
/*!< in: nonzero if none of
the columns must be declared
NOT NULL */
- __attribute__((nonnull(1,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,3), warn_unused_result));
/**********************************************************************//**
Returns a column's name.
@return column name. NOTE: not guaranteed to stay valid if table is
/*====================*/
const dict_table_t* table, /*!< in: table */
ulint col_nr) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Prints a table data. */
UNIV_INTERN
dict_table_print(
/*=============*/
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Outputs info on foreign keys of a table. */
UNIV_INTERN
FILE* file, /*!< in: file where to print */
trx_t* trx, /*!< in: transaction */
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Outputs info on a foreign key of a table in a format suitable for
CREATE TABLE. */
trx_t* trx, /*!< in: transaction */
dict_foreign_t* foreign, /*!< in: foreign key constraint */
ibool add_newline) /*!< in: whether to add a newline */
- __attribute__((nonnull(1,3)));
+ MY_ATTRIBUTE((nonnull(1,3)));
/********************************************************************//**
Displays the names of the index and the table. */
UNIV_INTERN
FILE* file, /*!< in: output stream */
const trx_t* trx, /*!< in: transaction */
const dict_index_t* index) /*!< in: index to print */
- __attribute__((nonnull(1,3)));
+ MY_ATTRIBUTE((nonnull(1,3)));
/*********************************************************************//**
Tries to find an index whose first fields are the columns in the array,
in the same order and is not marked for deletion and is not the same
/*!< in: nonzero if none of
the columns must be declared
NOT NULL */
- __attribute__((nonnull(1,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,3), warn_unused_result));
#ifdef UNIV_DEBUG
/********************************************************************//**
Gets the first index on the table (the clustered index).
dict_table_get_first_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the last index on the table.
@return index, NULL if none exists */
dict_table_get_last_index(
/*=======================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the next index on the table.
@return index, NULL if none left */
dict_table_get_next_index(
/*======================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#else /* UNIV_DEBUG */
# define dict_table_get_first_index(table) UT_LIST_GET_FIRST((table)->indexes)
# define dict_table_get_last_index(table) UT_LIST_GET_LAST((table)->indexes)
dict_index_is_clust(
/*================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check whether the index is unique.
@return nonzero for unique index, zero for other indexes */
dict_index_is_unique(
/*=================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check whether the index is the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
dict_index_is_ibuf(
/*===============*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check whether the index is a secondary index or the insert buffer tree.
@return nonzero for insert buffer, zero for other indexes */
dict_index_is_sec_or_ibuf(
/*======================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/************************************************************************
Gets the all the FTS indexes for the table. NOTE: must not be called for
/* out: number of indexes collected */
dict_table_t* table, /* in: table */
ib_vector_t* indexes)/* out: vector for collecting FTS indexes */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Gets the number of user-defined columns in a table in the dictionary
cache.
dict_table_get_n_user_cols(
/*=======================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Gets the number of system columns in a table in the dictionary cache.
@return number of system (e.g., ROW_ID) columns of a table */
dict_table_get_n_sys_cols(
/*======================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Gets the number of all columns (also system) in a table in the dictionary
cache.
dict_table_get_n_cols(
/*==================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Gets the approximately estimated number of rows in the table.
@return estimated number of rows */
dict_table_get_n_rows(
/*==================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Increment the number of rows in the table by one.
Notice that this operation is not protected by any latch, the number is
dict_table_n_rows_inc(
/*==================*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Decrement the number of rows in the table by one.
Notice that this operation is not protected by any latch, the number is
dict_table_n_rows_dec(
/*==================*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
/********************************************************************//**
Gets the nth column of a table.
/*===================*/
const dict_table_t* table, /*!< in: table */
ulint pos) /*!< in: position of column */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the given system column of a table.
@return pointer to column object */
/*===================*/
const dict_table_t* table, /*!< in: table */
ulint sys) /*!< in: DATA_ROW_ID, ... */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#else /* UNIV_DEBUG */
#define dict_table_get_nth_col(table, pos) \
((table)->cols + (pos))
/*======================*/
const dict_table_t* table, /*!< in: table */
ulint sys) /*!< in: DATA_ROW_ID, ... */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/********************************************************************//**
Returns the minimum data size of an index record.
dict_index_get_min_size(
/*====================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//**
Check whether the table uses the compact page format.
dict_table_is_comp(
/*===============*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Determine the file format of a table.
@return file format version */
dict_table_get_format(
/*==================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Determine the file format from a dict_table_t::flags.
@return file format version */
dict_tf_get_format(
/*===============*/
ulint flags) /*!< in: dict_table_t::flags */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/********************************************************************//**
Set the various values in a dict_table_t::flags pointer. */
UNIV_INLINE
rec_format_t format, /*!< in: file format */
ulint zip_ssize, /*!< in: zip shift size */
bool remote_path) /*!< in: table uses DATA DIRECTORY */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Convert a 32 bit integer table flags to the 32 bit integer that is
written into the tablespace header at the offset FSP_SPACE_FLAGS and is
dict_tf_to_fsp_flags(
/*=================*/
ulint flags) /*!< in: dict_table_t::flags */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************************//**
Extract the compressed page size from table flags.
@return compressed page size, or 0 if not compressed */
dict_tf_get_zip_size(
/*=================*/
ulint flags) /*!< in: flags */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************************//**
Check whether the table uses the compressed compact page format.
@return compressed page size, or 0 if not compressed */
dict_table_zip_size(
/*================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
Obtain exclusive locks on all index trees of the table. This is to prevent
dict_table_x_lock_indexes(
/*======================*/
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Release the exclusive locks on all index tree. */
UNIV_INLINE
dict_table_x_unlock_indexes(
/*========================*/
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Checks if a column is in the ordering columns of the clustered index of a
table. Column prefixes are treated like whole columns.
/*============================*/
const dict_table_t* table, /*!< in: table */
ulint n) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Check if the table has an FTS index.
@return TRUE if table has an FTS index */
dict_table_has_fts_index(
/*=====================*/
dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Copies types of columns contained in table to tuple and sets all
fields of the tuple to the SQL NULL value. This function should
/*==================*/
dtuple_t* tuple, /*!< in/out: data tuple */
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************
Wait until all the background threads of the given table have exited, i.e.,
bg_threads == 0. Note: bg_threads_mutex must be reserved when
dict_table_t* table, /* in: table */
ulint delay) /* in: time in microseconds to wait between
checks of bg_threads. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Looks for an index with the given id. NOTE that we do not reserve
the dictionary mutex: this function is for emergency purposes like
dict_index_find_on_id_low(
/*======================*/
index_id_t id) /*!< in: index id */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/**********************************************************************//**
Make room in the table cache by evicting an unused table. The unused table
should not be part of FK relationship and currently not used in any user
ibool strict) /*!< in: TRUE=refuse to create the index
if records could be too big to fit in
an B-tree page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Removes an index from the dictionary cache. */
UNIV_INTERN
/*=========================*/
dict_table_t* table, /*!< in/out: table */
dict_index_t* index) /*!< in, own: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//**
Gets the number of fields in the internal representation of an index,
const dict_index_t* index) /*!< in: an internal
representation of index (in
the dictionary cache) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of fields in the internal representation of an index
that uniquely determine the position of an index entry in the index, if
/*====================*/
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of fields in the internal representation of an index
which uniquely determine the position of an index entry in the index, if
/*============================*/
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of user-defined ordering fields in the index. In the internal
representation we add the row id to the ordering fields to make all indexes
/*======================================*/
const dict_index_t* index) /*!< in: an internal representation
of index (in the dictionary cache) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_DEBUG
/********************************************************************//**
Gets the nth field of an index.
/*=====================*/
const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#else /* UNIV_DEBUG */
# define dict_index_get_nth_field(index, pos) ((index)->fields + (pos))
#endif /* UNIV_DEBUG */
/*===================*/
const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of the field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the column number of the nth field in an index.
@return column number */
/*======================*/
const dict_index_t* index, /*!< in: index */
ulint pos) /*!< in: position of the field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Looks for column n in an index.
@return position in internal representation of the index;
/*=======================*/
const dict_index_t* index, /*!< in: index */
ulint n) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Looks for column n in an index.
@return position in internal representation of the index;
ulint n, /*!< in: column number */
ibool inc_prefix) /*!< in: TRUE=consider
column prefixes too */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Returns TRUE if the index contains a column or a prefix of that column.
@return TRUE if contains the column or its prefix */
/*==============================*/
const dict_index_t* index, /*!< in: index */
ulint n) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Looks for a matching field in an index. The column has to be the same. The
column in index must be complete, or must contain a prefix longer than the
const dict_index_t* index, /*!< in: index from which to search */
const dict_index_t* index2, /*!< in: index */
ulint n) /*!< in: field number in index2 */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Looks for column n position in the clustered index.
@return position in internal representation of the clustered index */
/*=======================*/
const dict_table_t* table, /*!< in: table */
ulint n) /*!< in: column number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Returns the position of a system column in an index.
@return position, ULINT_UNDEFINED if not contained */
/*=======================*/
const dict_index_t* index, /*!< in: index */
ulint type) /*!< in: DATA_ROW_ID, ... */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Adds a column to index. */
UNIV_INTERN
const dict_table_t* table, /*!< in: table */
dict_col_t* col, /*!< in: column */
ulint prefix_len) /*!< in: column prefix length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/*******************************************************************//**
Copies types of fields contained in index to tuple. */
const dict_index_t* index, /*!< in: index */
ulint n_fields) /*!< in: number of
field types to copy */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//**
Gets the field column.
dict_field_get_col(
/*===============*/
const dict_field_t* field) /*!< in: index field */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Returns an index object if it is found in the dictionary cache.
dict_index_get_if_in_cache_low(
/*===========================*/
index_id_t index_id) /*!< in: index id */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
/**********************************************************************//**
Returns an index object if it is found in the dictionary cache.
dict_index_get_if_in_cache(
/*=======================*/
index_id_t index_id) /*!< in: index id */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
#ifdef UNIV_DEBUG
/**********************************************************************//**
/*==========================*/
const dict_index_t* index, /*!< in: index tree */
const dtuple_t* tuple) /*!< in: tuple used in a search */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Whether and when to allow temporary index names */
enum check_name {
/** Require all indexes to be complete. */
in this table */
enum check_name check) /*!< in: whether and when to allow
temporary index names */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* UNIV_DEBUG */
/**********************************************************************//**
Builds a node pointer out of a physical record and a page number.
created */
ulint level) /*!< in: level of rec in tree:
0 means leaf level */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Copies an initial segment of a physical record, long enough to specify an
index entry uniquely.
byte** buf, /*!< in/out: memory buffer for the
copied prefix, or NULL */
ulint* buf_size)/*!< in/out: buffer size */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Builds a typed data tuple out of a physical record.
@return own: data tuple */
rec_t* rec, /*!< in: record for which to build data tuple */
ulint n_fields,/*!< in: number of data fields */
mem_heap_t* heap) /*!< in: memory heap where tuple created */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the space id of the root of the index tree.
@return space id */
dict_index_get_space(
/*=================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets the space id of the root of the index tree. */
UNIV_INLINE
/*=================*/
dict_index_t* index, /*!< in/out: index */
ulint space) /*!< in: space id */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Gets the page number of the root of the index tree.
@return page number */
dict_index_get_page(
/*================*/
const dict_index_t* tree) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Gets the read-write lock of the index tree.
@return read-write lock */
dict_index_get_lock(
/*================*/
dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Returns free space reserved for future updates of records. This is
relevant only in the case of many consecutive inserts, as updates
dict_index_get_online_status(
/*=========================*/
const dict_index_t* index) /*!< in: secondary index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Sets the status of online index creation. */
UNIV_INLINE
/*=========================*/
dict_index_t* index, /*!< in/out: index */
enum online_index_status status) /*!< in: status */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Determines if a secondary index is being or has been created online,
or if the table is being rebuilt online, allowing concurrent modifications
dict_index_is_online_ddl(
/*=====================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Calculates the minimum record length in an index. */
UNIV_INTERN
dict_index_calc_min_rec_len(
/*========================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Reserves the dictionary system mutex for MySQL. */
UNIV_INTERN
dbname '/' tablename */
const char* name2) /*!< in: table name in the form
dbname '/' tablename */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Removes an index from the cache */
UNIV_INTERN
/*=========================*/
dict_table_t* table, /*!< in/out: table */
dict_index_t* index) /*!< in, own: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Get index by name
@return index, NULL if does not exist */
/*=========================*/
dict_table_t* table, /*!< in: table */
const char* name) /*!< in: name of the index to find */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
In case there is more than one index with the same name return the index
with the min(id).
/*====================================*/
dict_table_t* table, /*!< in: table */
const char* name) /*!< in: name of the index to find */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************
Check whether a column exists in an FTS index. */
UNIV_INLINE
the offset within the vector */
ib_vector_t* indexes,/* in: vector containing only FTS indexes */
ulint col_no) /* in: col number to search for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Move a table to the non LRU end of the LRU list. */
UNIV_INTERN
dict_table_move_from_lru_to_non_lru(
/*================================*/
dict_table_t* table) /*!< in: table to move from LRU to non-LRU */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Move a table to the LRU list from the non-LRU list. */
UNIV_INTERN
dict_table_move_from_non_lru_to_lru(
/*================================*/
dict_table_t* table) /*!< in: table to move from non-LRU to LRU */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Move to the most recently used segment of the LRU list. */
UNIV_INTERN
dict_move_to_mru(
/*=============*/
dict_table_t* table) /*!< in: table to move to MRU */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Maximum number of columns in a foreign key constraint. Please Note MySQL
has a much lower limit on the number of columns allowed in a foreign key
!= DB_TABLE_NOT_FOUND is
returned */
size_t errstr_sz) /*!< in: errstr size */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/* @} */
/*********************************************************************//**
size_t db_utf8_size, /*!< in: dbname_utf8 size */
char* table_utf8, /*!< out: table name, e.g. aюbØc */
size_t table_utf8_size)/*!< in: table_utf8 size */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Closes the data dictionary module. */
dict_table_is_corrupted(
/*====================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Check whether the index is corrupted.
dict_index_is_corrupted(
/*====================*/
const dict_index_t* index) /*!< in: index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
dict_index_t* index, /*!< in/out: index */
trx_t* trx, /*!< in/out: transaction */
const char* ctx) /*!< in: context */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Flags an index corrupted in the data dictionary cache only. This
/*================================*/
dict_index_t* index, /*!< in/out: index */
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Flags a table with specified space_id corrupted in the table dictionary
dict_tf_is_valid(
/*=============*/
ulint flags) /*!< in: table flags */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/********************************************************************//**
Check if the tablespace for the table has been discarded.
dict_table_is_discarded(
/*====================*/
const dict_table_t* table) /*!< in: table to check */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/********************************************************************//**
Check if it is a temporary table.
dict_table_is_temporary(
/*====================*/
const dict_table_t* table) /*!< in: table to check */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/*********************************************************************//**
dict_index_zip_success(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
This function should be called whenever a page compression attempt
fails. Updates the compression padding information. */
dict_index_zip_failure(
/*===================*/
dict_index_t* index) /*!< in/out: index to be updated. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Return the optimal page size, for which page will likely compress.
@return page size beyond which page may not compress*/
/*=================================*/
dict_index_t* index) /*!< in: index for which page size
is requested */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Convert table flag to row format string.
@return row format name */
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
const dict_col_t* col, /*!< in: column */
dtype_t* type) /*!< out: data type */
{
- ut_ad(col && type);
+ ut_ad(col != NULL);
+ ut_ad(type != NULL);
type->mtype = col->mtype;
type->prtype = col->prtype;
ulint
dict_table_get_n_sys_cols(
/*======================*/
- const dict_table_t* table __attribute__((unused))) /*!< in: table */
+ const dict_table_t* table MY_ATTRIBUTE((unused))) /*!< in: table */
{
ut_ad(table);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
bool check_charsets, /*!< in: whether to check
charset compatibility */
dict_err_ignore_t ignore_err) /*!< in: error to be ignored */
- __attribute__((nonnull(1), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
/********************************************************************//**
Prints to the standard output information on all tables found in the data
dictionary system table. */
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2016, 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
/** Bit mask of the COMPACT field */
#define DICT_TF_MASK_COMPACT \
- ((~(~0 << DICT_TF_WIDTH_COMPACT)) \
+ ((~(~0U << DICT_TF_WIDTH_COMPACT)) \
<< DICT_TF_POS_COMPACT)
/** Bit mask of the ZIP_SSIZE field */
#define DICT_TF_MASK_ZIP_SSIZE \
- ((~(~0 << DICT_TF_WIDTH_ZIP_SSIZE)) \
+ ((~(~0U << DICT_TF_WIDTH_ZIP_SSIZE)) \
<< DICT_TF_POS_ZIP_SSIZE)
/** Bit mask of the ATOMIC_BLOBS field */
#define DICT_TF_MASK_ATOMIC_BLOBS \
- ((~(~0 << DICT_TF_WIDTH_ATOMIC_BLOBS)) \
+ ((~(~0U << DICT_TF_WIDTH_ATOMIC_BLOBS)) \
<< DICT_TF_POS_ATOMIC_BLOBS)
/** Bit mask of the DATA_DIR field */
#define DICT_TF_MASK_DATA_DIR \
- ((~(~0 << DICT_TF_WIDTH_DATA_DIR)) \
+ ((~(~0U << DICT_TF_WIDTH_DATA_DIR)) \
<< DICT_TF_POS_DATA_DIR)
/** Return the value of the COMPACT field */
/* @{ */
/** Total number of bits in table->flags2. */
#define DICT_TF2_BITS 7
-#define DICT_TF2_BIT_MASK ~(~0 << DICT_TF2_BITS)
+#define DICT_TF2_BIT_MASK ~(~0U << DICT_TF2_BITS)
/** TEMPORARY; TRUE for tables from CREATE TEMPORARY TABLE. */
#define DICT_TF2_TEMPORARY 1
ulint mtype, /*!< in: main datatype */
ulint prtype, /*!< in: precise type */
ulint len) /*!< in: precision */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/**********************************************************************//**
Renames a column of a table in the data dictionary cache. */
UNIV_INTERN
unsigned nth_col,/*!< in: column index */
const char* from, /*!< in: old column name */
const char* to) /*!< in: new column name */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
This function populates a dict_col_t memory structure with
supplied information. */
/*****************************************************************************
-Copyright (c) 2009, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2009, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
dict_table_t* table, /*!< in/out: table */
ibool ps_on, /*!< in: persistent stats explicitly enabled */
ibool ps_off) /*!< in: persistent stats explicitly disabled */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Check whether persistent statistics is enabled for a given table.
dict_stats_is_persistent_enabled(
/*=============================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Set the auto recalc flag for a given table (only honored for a persistent
dict_stats_deinit(
/*==============*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Calculates new estimates for table and index statistics. The statistics
dict_stats_update_for_index(
/*========================*/
dict_index_t* index) /*!< in/out: index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Renames a table in InnoDB persistent stats storage.
/*****************************************************************************
-Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
dict_stats_stop_bg(
/*===============*/
dict_table_t* table) /*!< in/out: table */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*****************************************************************//**
Wait until background stats thread has stopped using the specified table.
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/*=============*/
dyn_array_t* arr) /*!< in/out memory buffer of
size sizeof(dyn_array_t) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/************************************************************//**
Frees a dynamic array. */
UNIV_INLINE
dyn_array_free(
/*===========*/
dyn_array_t* arr) /*!< in,own: dyn array */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Makes room on top of a dyn array and returns a pointer to a buffer in it.
After copying the elements, the caller must close the buffer using
dyn_array_t* arr, /*!< in: dynamic array */
ulint size) /*!< in: size in bytes of the buffer; MUST be
smaller than DYN_ARRAY_DATA_SIZE! */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Closes the buffer returned by dyn_array_open. */
UNIV_INLINE
/*============*/
dyn_array_t* arr, /*!< in: dynamic array */
const byte* ptr) /*!< in: end of used space */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Makes room on top of a dyn array and returns a pointer to
the added element. The caller must copy the element to
/*===========*/
dyn_array_t* arr, /*!< in/out: dynamic array */
ulint size) /*!< in: size in bytes of the element */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/************************************************************//**
Returns pointer to an element in dyn array.
@return pointer to element */
const dyn_array_t* arr, /*!< in: dyn array */
ulint pos) /*!< in: position of element
in bytes from array start */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/************************************************************//**
Returns the size of stored data in a dyn array.
@return data size in bytes */
dyn_array_get_data_size(
/*====================*/
const dyn_array_t* arr) /*!< in: dyn array */
- __attribute__((nonnull, warn_unused_result, pure));
+ MY_ATTRIBUTE((nonnull, warn_unused_result, pure));
/************************************************************//**
Gets the first block in a dyn array.
@param arr dyn array
dyn_block_get_used(
/*===============*/
const dyn_block_t* block) /*!< in: dyn array block */
- __attribute__((nonnull, warn_unused_result, pure));
+ MY_ATTRIBUTE((nonnull, warn_unused_result, pure));
/********************************************************************//**
Gets pointer to the start of data in a dyn array block.
@return pointer to data */
dyn_block_get_data(
/*===============*/
const dyn_block_t* block) /*!< in: dyn array block */
- __attribute__((nonnull, warn_unused_result, pure));
+ MY_ATTRIBUTE((nonnull, warn_unused_result, pure));
/********************************************************//**
Pushes n bytes to a dyn array. */
UNIV_INLINE
dyn_array_t* arr, /*!< in/out: dyn array */
const byte* str, /*!< in: string to write */
ulint len) /*!< in: string length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*#################################################################*/
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
dyn_array_add_block(
/*================*/
dyn_array_t* arr) /*!< in/out: dyn array */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Gets the number of used bytes in a dyn array block.
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
ulint id, /*!< in: space id where to append */
ibool is_raw) /*!< in: TRUE if a raw device or
a raw disk partition */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifdef UNIV_LOG_ARCHIVE
/****************************************************************//**
Drops files from the start of a file space, so that its size is cut by
lsn values in data files */
lsn_t* max_flushed_lsn) /*!< out: max of flushed
lsn values in data files */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*******************************************************************//**
Increments the count of pending operation, if space is not being deleted.
@return TRUE if being deleted, and operation should be skipped */
fil_discard_tablespace(
/*===================*/
ulint id) /*!< in: space id */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/** Test if a tablespace file can be renamed to a new filepath by checking
ulint size) /*!< in: the initial size of the
tablespace file in pages,
must be >= FIL_IBD_FILE_INITIAL_SIZE */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/********************************************************************//**
Tries to open a single-table tablespace and optionally checks the space id is
const char* tablename, /*!< in: table name in the
databasename/tablename format */
const char* filepath) /*!< in: tablespace filepath */
- __attribute__((nonnull(5), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(5), warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/********************************************************************//**
appropriately aligned */
void* message) /*!< in: message for aio handler if non-sync
aio used, else ignored */
- __attribute__((nonnull(8)));
+ MY_ATTRIBUTE((nonnull(8)));
/**********************************************************************//**
Waits for an aio operation to complete. This function is used to write the
handler for completed requests. The aio array of pending requests is divided
dict_table_t* table,
ulint n_io_buffers,
PageCallback& callback)
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Checks if a single-table tablespace for a given table name exists in the
/*================*/
space_name_list_t& space_name_list)
/*!< in/out: Vector for collecting the names. */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/** Generate redo log for swapping two .ibd files
@param[in] old_table old table
const dict_table_t* new_table,
const char* tmp_name,
mtr_t* mtr)
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Finds the given page_no of the given space id from the double write buffer,
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
/** Bit mask of the POST_ANTELOPE field */
#define FSP_FLAGS_MASK_POST_ANTELOPE \
- ((~(~0 << FSP_FLAGS_WIDTH_POST_ANTELOPE)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_POST_ANTELOPE)) \
<< FSP_FLAGS_POS_POST_ANTELOPE)
/** Bit mask of the ZIP_SSIZE field */
#define FSP_FLAGS_MASK_ZIP_SSIZE \
- ((~(~0 << FSP_FLAGS_WIDTH_ZIP_SSIZE)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_ZIP_SSIZE)) \
<< FSP_FLAGS_POS_ZIP_SSIZE)
/** Bit mask of the ATOMIC_BLOBS field */
#define FSP_FLAGS_MASK_ATOMIC_BLOBS \
- ((~(~0 << FSP_FLAGS_WIDTH_ATOMIC_BLOBS)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_ATOMIC_BLOBS)) \
<< FSP_FLAGS_POS_ATOMIC_BLOBS)
/** Bit mask of the PAGE_SSIZE field */
#define FSP_FLAGS_MASK_PAGE_SSIZE \
- ((~(~0 << FSP_FLAGS_WIDTH_PAGE_SSIZE)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_PAGE_SSIZE)) \
<< FSP_FLAGS_POS_PAGE_SSIZE)
/** Bit mask of the DATA_DIR field */
#define FSP_FLAGS_MASK_DATA_DIR \
- ((~(~0 << FSP_FLAGS_WIDTH_DATA_DIR)) \
+ ((~(~0U << FSP_FLAGS_WIDTH_DATA_DIR)) \
<< FSP_FLAGS_POS_DATA_DIR)
/** Return the value of the POST_ANTELOPE field */
in which the page should be initialized.
If init_mtr!=mtr, but the page is already
latched in mtr, do not initialize the page. */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/**********************************************************************//**
Reserves free pages from a tablespace. All mini-transactions which may
use several pages from the tablespace should call this function beforehand
fseg_header_t* seg_header, /*!< in: segment header */
ulint space, /*!< in: space id */
ulint page) /*!< in: page offset */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************************//**
Frees part of a segment. This function can be used to free a segment
by repeatedly calling this function in different mini-transactions.
fsp_flags_is_valid(
/*===============*/
ulint flags) /*!< in: tablespace flags */
- __attribute__((warn_unused_result, const));
+ MY_ATTRIBUTE((warn_unused_result, const));
/********************************************************************//**
Determine if the tablespace is compressed from dict_table_t::flags.
@return TRUE if compressed, FALSE if not compressed */
/*****************************************************************************
-Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
and ignored processing an
operator, currently we only
ignore FTS_IGNORE operator */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Process (nested) sub-expression, create a new result set to store the
sub-expression result by processing nodes under current sub-expression
fts_ast_node_t* node, /*!< in: instance to traverse*/
fts_ast_callback visitor, /*!< in: callback */
void* arg) /*!< in: callback arg */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************
Create a lex instance.*/
UNIV_INTERN
ibool boolean_mode, /*!< in: query type */
const byte* query, /*!< in: query string */
ulint query_len) /*!< in: query string len */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
/********************************************************************
Free an fts_lexer_t instance.*/
UNIV_INTERN
/*===========*/
fts_lexer_t* fts_lexer) /*!< in: lexer instance to
free */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**
Create an ast string object, with NUL-terminator, so the string
/** Threshold where our optimize thread automatically kicks in */
#define FTS_OPTIMIZE_THRESHOLD 10000000
-#define FTS_DOC_ID_MAX_STEP 10000
+/** Threshold to avoid exhausting of doc ids. Consecutive doc id difference
+should not exceed FTS_DOC_ID_MAX_STEP */
+#define FTS_DOC_ID_MAX_STEP 65535
+
/** Variable specifying the FTS parallel sort degree */
extern ulong fts_sort_pll_degree;
/** Variable specifying the table that has Fulltext index to display its
content through information schema table */
extern char* fts_internal_tbl_name;
+extern char* fts_internal_tbl_name2;
#define fts_que_graph_free(graph) \
do { \
/*================*/
const dict_table_t* table, /*!< in: table */
doc_id_t* doc_id) /*!< out: new document id */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Update the next and last Doc ID in the CONFIG table to be the input
"doc_id" value (+ 1). We would do so after each FTS index build or
const dict_table_t* table, /*!< in: table */
const char* table_name, /*!< in: table name, or NULL */
doc_id_t doc_id) /*!< in: DOC ID to set */
- __attribute__((nonnull(2)));
+ MY_ATTRIBUTE((nonnull(2)));
/******************************************************************//**
Create a new document id .
current row that is being
inserted. */
mem_heap_t* heap) /*!< in: heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Create a new fts_doc_ids_t.
@return new fts_doc_ids_t. */
fts_row_state state, /*!< in: state of the row */
ib_vector_t* fts_indexes) /*!< in: FTS indexes affected
(NULL=all) */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/******************************************************************//**
Free an FTS trx. */
index */
const char* name, /*!< in: table name */
bool skip_doc_id_index) /*!< in: Skip index on doc id */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Wrapper function of fts_create_index_tables_low(), create auxiliary
tables for an FTS index
trx_t* trx, /*!< in: transaction handle */
const dict_index_t* index) /*!< in: the FTS index
instance */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Creates the column specific ancillary tables needed for supporting an
FTS index on the given table. row_mysql_lock_data_dictionary must have
instance */
const char* table_name, /*!< in: the table name */
table_id_t table_id) /*!< in: the table id */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Add the FTS document id hidden column. */
UNIV_INTERN
/*==================*/
dict_table_t* table, /*!< in/out: Table with FTS index */
mem_heap_t* heap) /*!< in: temporary memory heap, or NULL */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*********************************************************************//**
Drops the ancillary tables needed for supporting an FTS index on the
trx_t* trx, /*!< in: transaction */
dict_table_t* table) /*!< in: table has the FTS
index */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
The given transaction is about to be committed; do whatever is necessary
from the FTS system's POV.
fts_commit(
/*=======*/
trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
FTS Query entry point.
in bytes */
fts_result_t** result) /*!< out: query result, to be
freed by the caller.*/
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Retrieve the FTS Relevance Ranking result for doc with doc_id
fts_optimize_table(
/*===============*/
dict_table_t* table) /*!< in: table to optimiza */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Startup the optimize thread and create the work queue. */
/*==================*/
trx_t* trx, /*!< in: transaction */
dict_index_t* index) /*!< in: Index to drop */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Remove the table from the OPTIMIZER's list. We do wait for
trx_t* trx, /*!< in: transaction */
fts_trx_t* fts_trx, /*!< in: fts transaction */
const char* name) /*!< in: savepoint name */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Refresh last statement savepoint. */
UNIV_INTERN
fts_savepoint_laststmt_refresh(
/*===========================*/
trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Release the savepoint data identified by name. */
UNIV_INTERN
/*==============*/
fts_cache_t* cache); /*!< in: cache*/
-/*********************************************************************//**
-Clear cache. */
+/** Clear cache.
+@param[in,out] cache fts cache */
UNIV_INTERN
void
fts_cache_clear(
-/*============*/
- fts_cache_t* cache); /*!< in: cache */
+ fts_cache_t* cache);
/*********************************************************************//**
Initialize things in cache. */
fts_drop_orphaned_tables(void);
/*==========================*/
+/* Get parent table name if it's a fts aux table
+@param[in] aux_table_name aux table name
+@param[in] aux_table_len aux table length
+@return parent table name, or NULL */
+char*
+fts_get_parent_table_name(
+ const char* aux_table_name,
+ ulint aux_table_len);
+
/******************************************************************//**
Since we do a horizontal split on the index table, we need to drop
all the split tables.
/*========================*/
trx_t* trx, /*!< in: transaction */
dict_index_t* index) /*!< in: fts instance */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Run SYNC on the table, i.e., write out data from the cache to the
FTS auxiliary INDEX table and clear the cache at the end.
@param[in,out] table fts table
@param[in] unlock_cache whether unlock cache when write node
@param[in] wait whether wait for existing sync to finish
+@param[in] has_dict whether has dict operation lock
@return DB_SUCCESS on success, error code on failure. */
UNIV_INTERN
dberr_t
fts_sync_table(
dict_table_t* table,
bool unlock_cache,
- bool wait);
+ bool wait,
+ bool has_dict);
/****************************************************************//**
Free the query graph but check whether dict_sys->mutex is already
dict_table_t* table, /*!< in: Table where indexes are dropped */
dict_index_t* index, /*!< in: Index to be dropped */
trx_t* trx) /*!< in: Transaction for the drop */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/****************************************************************//**
Rename auxiliary tables for all fts index for a table
/*****************************************************************************
-Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
fts_table_t* fts_table, /*!< in: FTS aux table */
pars_info_t* info, /*!< in: info struct, or NULL */
const char* sql) /*!< in: SQL string to evaluate */
- __attribute__((nonnull(3), malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull(3), malloc, warn_unused_result));
/******************************************************************//**
Evaluate a parsed SQL statement
@return DB_SUCCESS or error code */
/*=========*/
trx_t* trx, /*!< in: transaction */
que_t* graph) /*!< in: Parsed statement */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Construct the name of an ancillary FTS table for the given table.
@return own: table name, must be freed with mem_free() */
/*===============*/
const fts_table_t*
fts_table) /*!< in: FTS aux table info */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
/******************************************************************//**
Construct the column specification part of the SQL string for selecting the
indexed FTS columns for the given table. Adds the necessary bound
dict_index_t* index, /*!< in: FTS index */
pars_info_t* info, /*!< in/out: parser info */
mem_heap_t* heap) /*!< in: memory heap */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** define for fts_doc_fetch_by_doc_id() "option" value, defines whether
we want to get Doc whose ID is equal to or greater or smaller than supplied
callback, /*!< in: callback to read
records */
void* arg) /*!< in: callback arg */
- __attribute__((nonnull(6)));
+ MY_ATTRIBUTE((nonnull(6)));
/*******************************************************************//**
Callback function for fetch that stores the text of an FTS document,
/*==========================*/
void* row, /*!< in: sel_node_t* */
void* user_arg) /*!< in: fts_doc_t* */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************
Write out a single word's data as new entry/entries in the INDEX table.
@return DB_SUCCESS if all OK. */
fts_table_t* fts_table, /*!< in: the FTS aux index */
fts_string_t* word, /*!< in: word in UTF-8 */
fts_node_t* node) /*!< in: node columns */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Tokenize a document. */
UNIV_INTERN
tokenize */
fts_doc_t* result) /*!< out: if provided, save
result tokens here */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*******************************************************************//**
Continue to tokenize a document. */
tokens from this tokenization */
fts_doc_t* result) /*!< out: if provided, save
result tokens here */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/******************************************************************//**
Initialize a document. */
UNIV_INTERN
fts_doc_init(
/*=========*/
fts_doc_t* doc) /*!< in: doc to initialize */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Do a binary search for a doc id in the array
int lower, /*!< in: lower bound of array*/
int upper, /*!< in: upper bound of array*/
doc_id_t doc_id) /*!< in: doc id to lookup */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Free document. */
UNIV_INTERN
fts_doc_free(
/*=========*/
fts_doc_t* doc) /*!< in: document */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Free fts_optimizer_word_t instanace.*/
UNIV_INTERN
fts_word_free(
/*==========*/
fts_word_t* word) /*!< in: instance to free.*/
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Read the rows from the FTS inde
@return DB_SUCCESS or error code */
const fts_string_t*
word, /*!< in: the word to fetch */
fts_fetch_t* fetch) /*!< in: fetch callback.*/
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Create a fts_optimizer_word_t instance.
@return new instance */
fts_word_t* word, /*!< in: word to initialize */
byte* utf8, /*!< in: UTF-8 string */
ulint len) /*!< in: length of string in bytes */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Compare two fts_trx_table_t instances, we actually compare the
table id's here.
/*==============*/
const void* v1, /*!< in: id1 */
const void* v2) /*!< in: id2 */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Compare a table id with a trx_table_t table id.
@return < 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2 */
/*=================*/
const void* p1, /*!< in: id1 */
const void* p2) /*!< in: id2 */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Commit a transaction.
@return DB_SUCCESS if all OK */
fts_sql_commit(
/*===========*/
trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Rollback a transaction.
@return DB_SUCCESS if all OK */
fts_sql_rollback(
/*=============*/
trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Parse an SQL string. %s is replaced with the table's id. Don't acquire
the dict mutex
fts_table_t* fts_table, /*!< in: table with FTS index */
pars_info_t* info, /*!< in: parser info */
const char* sql) /*!< in: SQL string to evaluate */
- __attribute__((nonnull(3), malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull(3), malloc, warn_unused_result));
/******************************************************************//**
Get value from config table. The caller must ensure that enough
space is allocated for value to hold the column contents
this parameter name */
fts_string_t* value) /*!< out: value read from
config table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Get value specific to an FTS index from the config table. The caller
must ensure that enough space is allocated for value to hold the
this parameter name */
fts_string_t* value) /*!< out: value read from
config table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Set the value in the config table for name.
@return DB_SUCCESS or error code */
this parameter name */
const fts_string_t*
value) /*!< in: value to update */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/****************************************************************//**
Set an ulint value in the config table.
@return DB_SUCCESS if all OK else error code */
fts_table_t* fts_table, /*!< in: the indexed FTS table */
const char* name, /*!< in: param name */
ulint int_value) /*!< in: value */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Set the value specific to an FTS index in the config table.
@return DB_SUCCESS or error code */
this parameter name */
fts_string_t* value) /*!< out: value read from
config table */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Increment the value in the config table for column name.
@return DB_SUCCESS or error code */
const char* name, /*!< in: increment config value
for this parameter name */
ulint delta) /*!< in: increment by this much */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Increment the per index value in the config table for column name.
@return DB_SUCCESS or error code */
const char* name, /*!< in: increment config value
for this parameter name */
ulint delta) /*!< in: increment by this much */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Get an ulint value from the config table.
@return DB_SUCCESS or error code */
dict_index_t* index, /*!< in: FTS index */
const char* name, /*!< in: param name */
ulint* int_value) /*!< out: value */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Set an ulint value int the config table.
@return DB_SUCCESS or error code */
dict_index_t* index, /*!< in: FTS index */
const char* name, /*!< in: param name */
ulint int_value) /*!< in: value */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Get an ulint value from the config table.
@return DB_SUCCESS or error code */
fts_table_t* fts_table, /*!< in: the indexed FTS table */
const char* name, /*!< in: param name */
ulint* int_value) /*!< out: value */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Search cache for word.
@return the word node vector if found else NULL */
index_cache, /*!< in: cache to search */
const fts_string_t*
text) /*!< in: word to search for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Check cache for deleted doc id.
@return TRUE if deleted */
const fts_cache_t*
cache, /*!< in: cache ito search */
doc_id_t doc_id) /*!< in: doc id to search for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Append deleted doc ids to vector and sort the vector. */
UNIV_INTERN
trx_t* trx, /*!< in: transaction */
dict_index_t* index, /*!< in: for this index */
ulint* total) /*!< out: total words */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif
/******************************************************************//**
Search the index specific cache for a particular FTS index.
cache, /*!< in: cache to search */
const dict_index_t*
index) /*!< in: index to search for */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Write the table id to the given buffer (including final NUL). Buffer must be
at least FTS_AUX_MIN_TABLE_ID_LENGTH bytes long.
/*================*/
ib_id_t id, /*!< in: a table/index id */
char* str, /*!< in: buffer to write the id to */
- bool hex_format __attribute__((unused)))
+ bool hex_format MY_ATTRIBUTE((unused)))
/*!< in: true for fixed hex format,
false for old ambiguous format */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Read the table id from the string generated by fts_write_object_id().
@return TRUE if parse successful */
/*===============*/
ib_id_t* id, /*!< out: a table id */
const char* str) /*!< in: buffer to read from */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Get the table id.
@return number of bytes written */
char* table_id) /*!< out: table id, must be at least
FTS_AUX_MIN_TABLE_ID_LENGTH bytes
long */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Add the table to add to the OPTIMIZER's list. */
UNIV_INTERN
fts_optimize_add_table(
/*===================*/
dict_table_t* table) /*!< in: table to add */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Optimize a table. */
UNIV_INTERN
fts_optimize_do_table(
/*==================*/
dict_table_t* table) /*!< in: table to optimize */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Construct the prefix name of an FTS table.
@return own: table name, must be freed with mem_free() */
/*======================*/
const fts_table_t*
fts_table) /*!< in: Auxiliary table type */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
/******************************************************************//**
Add node positions. */
UNIV_INTERN
fts_node_t* node, /*!< in: word node */
doc_id_t doc_id, /*!< in: doc id */
ib_vector_t* positions) /*!< in: fts_token_t::positions */
- __attribute__((nonnull(2,4)));
+ MY_ATTRIBUTE((nonnull(2,4)));
/******************************************************************//**
Create the config table name for retrieving index specific value.
/*===============================*/
const char* param, /*!< in: base name of param */
const dict_index_t* index) /*!< in: index for config */
- __attribute__((nonnull, malloc, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, malloc, warn_unused_result));
#ifndef UNIV_NONINL
#include "fts0priv.ic"
/*****************************************************************************
-Copyright (c) 2011, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
/*================*/
ib_id_t id, /* in: a table/index id */
char* str, /* in: buffer to write the id to */
- bool hex_format __attribute__((unused)))
+ bool hex_format MY_ATTRIBUTE((unused)))
/* in: true for fixed hex format,
false for old ambiguous format */
{
/* Use this to construct old(5.6.14 and 5.7.3) windows
ambiguous aux table names */
DBUG_EXECUTE_IF("innodb_test_wrong_windows_fts_aux_table_name",
- return(sprintf(str, "%016"PRIu64, id)););
+ return(sprintf(str, "%016" PRIu64, id)););
DBUG_EXECUTE_IF("innodb_test_wrong_fts_aux_table_name",
return(sprintf(str, UINT64PFx, id)););
// FIXME: Use ut_snprintf(), so does following one.
return(sprintf(str, "%016llu", id));
#else /* _WIN32 */
- return(sprintf(str, "%016"PRIu64, id));
+ return(sprintf(str, "%016" PRIu64, id));
#endif /* _WIN32 */
}
/*****************************************************************************
-Copyright (c) 2006, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
thd_requested_durability(
/*=====================*/
const THD* thd) /*!< in: thread handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Returns true if the transaction this thread is processing has edited
const unsigned char* b, /*!< in: data field */
unsigned int b_length) /*!< in: data field length,
not UNIV_SQL_NULL */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**************************************************************//**
Converts a MySQL type to an InnoDB type. Note that this function returns
the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1
and unsigned integer
types are 'unsigned types' */
const void* field) /*!< in: MySQL Field */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Get the variable length bounds of the given character set. */
/*==============*/
THD* thd, /*!< in: MySQL thread handle */
size_t* length) /*!< out: length of the SQL statement */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
This function is used to find the storage length in bytes of the first n
characters for prefix indexes using a multibyte character set. The function
innobase_index_cond(
/*================*/
void* file) /*!< in/out: pointer to ha_innobase */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Returns true if the thread supports XA,
global value of innodb_supports_xa if thd is NULL.
const char* name, /*!< in: index or table name
to format */
ibool is_index_name) /*!< in: index name */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Corresponds to Sql_condition:enum_warning_level. */
enum ib_log_level_t {
ib_uint32_t code, /*!< MySQL error code */
const char* format, /*!< printf format */
...) /*!< Args */
- __attribute__((format(printf, 4, 5)));
+ MY_ATTRIBUTE((format(printf, 4, 5)));
/******************************************************************//**
Use this when the args are passed to the format string from
ib_log_level_t level, /*!< in: warning level */
const char* format, /*!< printf format */
...) /*!< Args */
- __attribute__((format(printf, 2, 3)));
+ MY_ATTRIBUTE((format(printf, 2, 3)));
/******************************************************************//**
Returns the NUL terminated value of glob_hostname.
ulonglong step, /*!< in: AUTOINC increment step */
ulonglong offset, /*!< in: AUTOINC offset */
ulonglong max_value) /*!< in: max value for type */
- __attribute__((pure, warn_unused_result));
+ MY_ATTRIBUTE((pure, warn_unused_result));
/********************************************************************//**
Get the upper limit of the MySQL integral and floating-point type.
innobase_get_int_col_max_value(
/*===========================*/
const Field* field) /*!< in: MySQL field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************************
Check if the length of the identifier exceeds the maximum allowed.
/*****************************************************************************
-Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
const dict_index_t* index, /*!< in: index */
const ulint* offsets)/*!< in: rec_get_offsets(
rec, index, ...) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Copies an InnoDB index entry to table->record[0]. */
struct TABLE* table, /*!< in/out: MySQL table */
const dict_index_t* index, /*!< in: InnoDB index */
const dfield_t* fields) /*!< in: InnoDB index fields */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Copies an InnoDB row to table->record[0]. */
struct TABLE* table, /*!< in/out: MySQL table */
const dict_table_t* itab, /*!< in: InnoDB table */
const dtuple_t* row) /*!< in: InnoDB row */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Resets table->record[0]. */
innobase_rec_reset(
/*===============*/
struct TABLE* table) /*!< in/out: MySQL table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Generate the next autoinc based on a snapshot of the session
auto_increment_increment and auto_increment_offset variables. */
/*****************************************************************************
-Copyright (c) 1997, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
ibuf_mtr_start(
/*===========*/
mtr_t* mtr) /*!< out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Commits an insert buffer mini-transaction. */
UNIV_INLINE
ibuf_mtr_commit(
/*============*/
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Initializes an ibuf bitmap page. */
UNIV_INTERN
ibuf_inside(
/*========*/
const mtr_t* mtr) /*!< in: mini-transaction */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/***********************************************************************//**
Checks if a page address is an ibuf bitmap page (level 3 page) address.
@return TRUE if a bitmap page */
is not one of the fixed address ibuf
pages, or NULL, in which case a new
transaction is created. */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#ifdef UNIV_DEBUG
/** Checks if a page is a level 2 or 3 page in the ibuf hierarchy of
pages. Must not be called when recv_no_ibuf_operations==TRUE.
ibuf_delete_for_discarded_space(
/*============================*/
ulint space); /*!< in: space id */
-/*********************************************************************//**
-Contracts insert buffer trees by reading pages to the buffer pool.
+/** Contract the change buffer by reading pages to the buffer pool.
+@param[in] full If true, do a full contraction based
+on PCT_IO(100). If false, the size of contract batch is determined
+based on the current size of the change buffer.
@return a lower limit for the combined size in bytes of entries which
will be merged from ibuf trees to the pages read, 0 if ibuf is
empty */
UNIV_INTERN
ulint
-ibuf_contract_in_background(
-/*========================*/
- table_id_t table_id, /*!< in: if merge should be done only
- for a specific table, for all tables
- this should be 0 */
- ibool full); /*!< in: TRUE if the caller wants to
- do a full contract based on PCT_IO(100).
- If FALSE then the size of contract
- batch is determined based on the
- current size of the ibuf tree. */
+ibuf_merge_in_background(
+ bool full); /*!< in: TRUE if the caller wants to
+ do a full contract based on PCT_IO(100).
+ If FALSE then the size of contract
+ batch is determined based on the
+ current size of the ibuf tree. */
+
+/** Contracts insert buffer trees by reading pages referring to space_id
+to the buffer pool.
+@returns number of pages merged.*/
+UNIV_INTERN
+ulint
+ibuf_merge_space(
+/*=============*/
+ ulint space); /*!< in: space id */
+
#endif /* !UNIV_HOTBACKUP */
/*********************************************************************//**
Parses a redo log record of an ibuf bitmap page init.
/*========================*/
const trx_t* trx, /*!< in: transaction */
ulint space_id) /*!< in: tablespace identifier */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#define IBUF_HEADER_PAGE_NO FSP_IBUF_HEADER_PAGE_NO
#define IBUF_TREE_ROOT_PAGE_NO FSP_IBUF_TREE_ROOT_PAGE_NO
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/*========================*/
ulint space, /*!< in: space id */
ulint page_no)/*!< in: page number */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
Checks if locks of other transactions prevent an immediate insert of
a record. If they do, first tests if the query thread should anyway
inserted record maybe should inherit
LOCK_GAP type locks from the successor
record */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Checks if locks of other transactions prevent an immediate modify (update,
delete mark, or delete unmark) of a clustered index record. If they do,
dict_index_t* index, /*!< in: clustered index */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/*********************************************************************//**
Checks if locks of other transactions prevent an immediate modify
(delete mark or delete unmark) of a secondary index record.
que_thr_t* thr, /*!< in: query thread
(can be NULL if BTR_NO_LOCKING_FLAG) */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((warn_unused_result, nonnull(2,3,4,6)));
+ MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,4,6)));
/*********************************************************************//**
Like lock_clust_rec_read_check_and_lock(), but reads a
secondary index record.
ulint gap_mode,/*!< in: LOCK_ORDINARY, LOCK_GAP, or
LOCK_REC_NOT_GAP */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Checks that a record is seen in a consistent read.
@return true if sees, or false if an earlier version of the record
should be read or passed over
by a read cursor */
const read_view_t* view) /*!< in: consistent read view */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Locks the specified database table in the mode given. If the lock cannot
be granted immediately, the query thread is put to wait.
in dictionary cache */
enum lock_mode mode, /*!< in: lock mode */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Creates a table IX lock object for a resurrected transaction. */
UNIV_INTERN
/*==========*/
ulint space, /*!< in: space */
ulint page_no)/*!< in: page number */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*********************************************************************//**
Calculates the hash value of a page file address: used in inserting or
searching for a lock in the hash table.
/*====================*/
const dict_table_t* table, /*!< in: table */
const trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Checks if a lock request lock1 has to wait for request lock2.
@return TRUE if lock1 has to wait for lock2 to be removed */
dict_index_t* index, /*!< in: index */
const ulint* offsets, /*!< in: rec_get_offsets(rec, index) */
trx_id_t max_trx_id) /*!< in: trx_sys_get_max_trx_id() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Prints info of a table lock. */
UNIV_INTERN
/*====================*/
FILE* file, /*!< in: file where to print */
ibool nowait) /*!< in: whether to wait for the lock mutex */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Prints info of locks for each transaction. This function assumes that the
caller holds the lock mutex and more importantly it will release the lock
lock_number_of_rows_locked(
/*=======================*/
const trx_lock_t* trx_lock) /*!< in: transaction locks */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Gets the type of a lock. Non-inline version for using outside of the
lock_trx_handle_wait(
/*=================*/
trx_t* trx) /*!< in/out: trx lock state */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Get the number of locks on a table.
@return number of locks */
lock_table_get_n_locks(
/*===================*/
const dict_table_t* table) /*!< in: table */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
/*********************************************************************//**
Checks that a transaction id is sensible, i.e., not in the future.
const rec_t* rec, /*!< in: user record */
dict_index_t* index, /*!< in: index */
const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Check if the transaction holds any locks on the sys tables
or its records.
lock_trx_has_sys_table_locks(
/*=========================*/
const trx_t* trx) /*!< in: transaction to check */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*******************************************************************//**
Check if the transaction holds an exclusive lock on a record.
const dict_table_t* table, /*!< in: table to check */
const buf_block_t* block, /*!< in: buffer block of the record */
ulint heap_no)/*!< in: record heap number */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/** Lock modes and types */
/*****************************************************************************
-Copyright (c) 2007, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
const rec_t* rec, /*!< in: user record */
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "lock0priv.ic"
/*****************************************************************************
-Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
lsn_t* first_header_lsn)
/*!< out: lsn of of the start of the
first log file */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Scans the log segment and n_bytes_scanned is set to the length of valid
log scanned. */
/*****************************************************************************
-Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
mach_read_from_1(
/*=============*/
const byte* b) /*!< in: pointer to byte */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in two consecutive
bytes. We store the most significant byte to the lower address. */
mach_read_from_2(
/*=============*/
const byte* b) /*!< in: pointer to two bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/********************************************************//**
The following function is used to convert a 16-bit data item
mach_encode_2(
/*==========*/
ulint n) /*!< in: integer in machine-dependent format */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************//**
The following function is used to convert a 16-bit data item
from the canonical format, for fast bytewise equality test
mach_decode_2(
/*==========*/
uint16 n) /*!< in: 16-bit integer in canonical format */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*******************************************************//**
The following function is used to store data in 3 consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_3(
/*=============*/
const byte* b) /*!< in: pointer to 3 bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in four consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_4(
/*=============*/
const byte* b) /*!< in: pointer to four bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a ulint in a compressed form (1..5 bytes).
@return stored size in bytes */
mach_get_compressed_size(
/*=====================*/
ulint n) /*!< in: ulint integer to be stored */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*********************************************************//**
Reads a ulint in a compressed form.
@return read integer */
mach_read_compressed(
/*=================*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in 6 consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_6(
/*=============*/
const byte* b) /*!< in: pointer to 6 bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in 7 consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_7(
/*=============*/
const byte* b) /*!< in: pointer to 7 bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*******************************************************//**
The following function is used to store data in 8 consecutive
bytes. We store the most significant byte to the lowest address. */
mach_read_from_8(
/*=============*/
const byte* b) /*!< in: pointer to 8 bytes */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a 64-bit integer in a compressed form (5..9 bytes).
@return size in bytes */
mach_ull_read_compressed(
/*=====================*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a 64-bit integer in a compressed form (1..11 bytes).
@return size in bytes */
mach_ull_get_much_compressed_size(
/*==============================*/
ib_uint64_t n) /*!< in: 64-bit integer to be stored */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*********************************************************//**
Reads a 64-bit integer in a compressed form.
@return the value read */
mach_ull_read_much_compressed(
/*==========================*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Reads a ulint in a compressed form if the log record fully contains it.
@return pointer to end of the stored field, NULL if not complete */
mach_double_read(
/*=============*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a double. It is stored in a little-endian format. */
UNIV_INLINE
mach_float_read(
/*============*/
const byte* b) /*!< in: pointer to memory from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a float. It is stored in a little-endian format. */
UNIV_INLINE
/*===========================*/
const byte* buf, /*!< in: from where to read */
ulint buf_size) /*!< in: from how many bytes to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a ulint in the little-endian format. */
UNIV_INLINE
mach_read_from_2_little_endian(
/*===========================*/
const byte* buf) /*!< in: from where to read */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************//**
Writes a ulint in the little-endian format. */
UNIV_INLINE
/*****************************************************************************
-Copyright (c) 1994, 2010, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
/*============*/
mem_heap_t* heap, /*!< in: memory heap */
const char* format, /*!< in: format string */
- ...) __attribute__ ((format (printf, 2, 3)));
+ ...) MY_ATTRIBUTE ((format (printf, 2, 3)));
#ifdef MEM_PERIODIC_CHECK
/******************************************************************//**
/*****************************************************************************
-Copyright (c) 1994, 2010, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
mem_heap_free_func(
/*===============*/
mem_heap_t* heap, /*!< in, own: heap to be freed */
- const char* file_name __attribute__((unused)),
+ const char* file_name MY_ATTRIBUTE((unused)),
/*!< in: file name where freed */
- ulint line __attribute__((unused)))
+ ulint line MY_ATTRIBUTE((unused)))
{
mem_block_t* block;
mem_block_t* prev_block;
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, 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
mtr_start(
/*======*/
mtr_t* mtr) /*!< out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Commits a mini-transaction. */
UNIV_INTERN
mtr_commit(
/*=======*/
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************//**
Sets and returns a savepoint in mtr.
@return savepoint */
mtr_t* mtr, /*!< in/out: mini-transaction */
void* object, /*!< in: object */
ulint type) /*!< in: object type: MTR_MEMO_S_LOCK, ... */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
# ifndef UNIV_HOTBACKUP
/**********************************************************//**
mtr_t* mtr, /*!< in: mtr */
const void* object, /*!< in: object to search */
ulint type) /*!< in: type of object */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/**********************************************************//**
Checks if memo contains the given page.
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
mtr_block_dirtied(
/*==============*/
const buf_block_t* block) /*!< in: block being x-fixed */
- __attribute__((nonnull,warn_unused_result));
+ MY_ATTRIBUTE((nonnull,warn_unused_result));
/***************************************************************//**
Starts a mini-transaction. */
/***********************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc.
Portions of this file contain modifications contributed and copyrighted
OS_FILE_READ_ALLOW_DELETE; the last option is
used by a backup program reading the file */
ibool* success)/*!< out: TRUE if succeed, FALSE if error */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
Tries to disable OS caching on an opened file descriptor. */
UNIV_INTERN
function source code for the exact rules */
ulint type, /*!< in: OS_DATA_FILE or OS_LOG_FILE */
ibool* success)/*!< out: TRUE if succeed, FALSE if error */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Deletes a file. The file has to be closed before calling this.
@return TRUE if success */
ibool* success,/*!< out: TRUE if succeed, FALSE if error */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line)/*!< in: line where the func invoked */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
NOTE! Please use the corresponding macro
ibool* success,/*!< out: TRUE if succeed, FALSE if error */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line)/*!< in: line where the func invoked */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/****************************************************************//**
NOTE! Please use the corresponding macro os_file_create(), not directly
ibool* success,/*!< out: TRUE if succeed, FALSE if error */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line)/*!< in: line where the func invoked */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
NOTE! Please use the corresponding macro os_file_close(), not directly
os_file_get_size(
/*=============*/
os_file_t file) /*!< in: handle to a file */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/***********************************************************************//**
Write the specified number of zeros to a newly created file.
@return TRUE if success */
null-terminated string */
os_file_t file, /*!< in: handle to a file */
os_offset_t size) /*!< in: file size */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Truncates a file at its current position.
@return TRUE if success */
/*****************************************************************************
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
os_thread_id_t* thread_id); /*!< out: id of the created
thread, or NULL */
+/** Waits until the specified thread completes and joins it.
+Its return value is ignored.
+@param[in,out] thread thread to join */
+UNIV_INTERN
+void
+os_thread_join(
+ os_thread_t thread);
+
/*****************************************************************//**
Exits the current thread. */
UNIV_INTERN
void
os_thread_exit(
/*===========*/
- void* exit_value) /*!< in: exit value; in Windows this void*
+ void* exit_value, /*!< in: exit value; in Windows this void*
is cast as a DWORD */
- UNIV_COLD __attribute__((noreturn));
+ bool detach = true) /*!< in: if true, the thread will be detached
+ right before exiting. If false, another thread
+ is responsible for joining this thread. */
+ UNIV_COLD MY_ATTRIBUTE((noreturn));
/*****************************************************************//**
Returns the thread identifier of current thread.
@return current thread identifier */
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
mem_heap_t** heap, /*!< in/out: pointer to memory heap, or NULL */
ulint n_ext, /*!< in: number of externally stored columns */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
- __attribute__((nonnull(1,2,3,4,5), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4,5), warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Inserts a record next to page cursor. Returns pointer to inserted record if
const rec_t* rec, /*!< in: pointer to a physical record */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
- __attribute__((nonnull(1,2,3,4), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
/***********************************************************//**
Inserts a record next to page cursor on a compressed and uncompressed
page. Returns pointer to inserted record if succeed, i.e.,
const rec_t* rec, /*!< in: pointer to a physical record */
ulint* offsets,/*!< in/out: rec_get_offsets(rec, index) */
mtr_t* mtr) /*!< in: mini-transaction handle, or NULL */
- __attribute__((nonnull(1,2,3,4), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
/*************************************************************//**
Copies records from page to a newly created page, from a given record onward,
including that record. Infimum and supremum records are not copied.
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
page_align(
/*=======*/
const void* ptr) /*!< in: pointer to page frame */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
Gets the offset within a page.
@return offset from the start of the page */
page_offset(
/*========*/
const void* ptr) /*!< in: pointer to page frame */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*************************************************************//**
Returns the max trx id field value. */
UNIV_INLINE
/*=================*/
const page_t* page, /*!< in: page */
ulint field) /*!< in: PAGE_FREE, ... */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*************************************************************//**
Returns the pointer stored in the given header field, or NULL. */
/*===================*/
const page_t* page, /*!< in: page */
ulint nth) /*!< in: nth record */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/************************************************************//**
Returns the nth record of the record list.
This is the inverse function of page_rec_get_n_recs_before().
/*=============*/
page_t* page, /*< in: page */
ulint nth) /*!< in: nth record */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_HOTBACKUP
/************************************************************//**
page_get_middle_rec(
/*================*/
page_t* page) /*!< in: page */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*************************************************************//**
Compares a data tuple to a physical record. Differs from the function
cmp_dtuple_rec_with_match in the way that the record must reside on an
page_is_leaf(
/*=========*/
const page_t* page) /*!< in: page */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/************************************************************//**
Determine whether the page is empty.
@return true if the page is empty (PAGE_N_RECS = 0) */
page_is_empty(
/*==========*/
const page_t* page) /*!< in: page */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/************************************************************//**
Determine whether the page contains garbage.
@return true if the page contains garbage (PAGE_GARBAGE is not 0) */
page_has_garbage(
/*=============*/
const page_t* page) /*!< in: page */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/************************************************************//**
Gets the pointer to the next record on the page.
@return pointer to next record */
page_rec_is_user_rec_low(
/*=====================*/
ulint offset) /*!< in: record offset on page */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the supremum record on a page.
@return TRUE if the supremum record */
page_rec_is_supremum_low(
/*=====================*/
ulint offset) /*!< in: record offset on page */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the infimum record on a page.
@return TRUE if the infimum record */
page_rec_is_infimum_low(
/*====================*/
ulint offset) /*!< in: record offset on page */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is a user record on the page.
page_rec_is_user_rec(
/*=================*/
const rec_t* rec) /*!< in: record */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the supremum record on a page.
@return TRUE if the supremum record */
page_rec_is_supremum(
/*=================*/
const rec_t* rec) /*!< in: record */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/************************************************************//**
TRUE if the record is the infimum record on a page.
page_rec_is_infimum(
/*================*/
const rec_t* rec) /*!< in: record */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/***************************************************************//**
Looks for the record which owns the given record.
@return the owner record */
ulint i, /*!< in: index of the field to update */
ulint val, /*!< in: value to write */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/************************************************************//**
Returns the maximum combined size of records which can be inserted on top
page_get_free_space_of_empty(
/*=========================*/
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/**********************************************************//**
Returns the base extra size of a physical record. This is the
size of the fixed header, independent of the record size.
ulint level, /*!< in: the B-tree level of the page */
trx_id_t max_trx_id, /*!< in: PAGE_MAX_TRX_ID */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************//**
Empty a previously created B-tree index page. */
UNIV_INTERN
buf_block_t* block, /*!< in/out: B-tree block */
dict_index_t* index, /*!< in: the index of the page */
mtr_t* mtr) /*!< in/out: mini-transaction */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/*************************************************************//**
Differs from page_copy_rec_list_end, because this function does not
touch the lock table and max trx id on page or compress the page.
rec_t* rec, /*!< in: record on page */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Copies records from page to new_page, up to the given record, NOT
including that record. Infimum and supremum records are not copied.
rec_t* rec, /*!< in: record on page */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Deletes records from a page from a given record onward, including that record.
The infimum and supremum records are not deleted. */
records in the end of the chain to
delete, or ULINT_UNDEFINED if not known */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Deletes records from page, up to the given record, NOT including
that record. Infimum and supremum records are not deleted. */
buf_block_t* block, /*!< in: buffer block of the page */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Moves record list end to another page. Moved records include
split_rec.
rec_t* split_rec, /*!< in: first record to move */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull(1, 2, 4, 5)));
+ MY_ATTRIBUTE((nonnull(1, 2, 4, 5)));
/*************************************************************//**
Moves record list start to another page. Moved records do not include
split_rec.
rec_t* split_rec, /*!< in: first record not to move */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull(1, 2, 4, 5)));
+ MY_ATTRIBUTE((nonnull(1, 2, 4, 5)));
/****************************************************************//**
Splits a directory slot which owns too many records. */
UNIV_INTERN
page_zip_des_t* page_zip,/*!< in/out: compressed page whose
uncompressed part will be written, or NULL */
ulint slot_no)/*!< in: the directory slot */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*************************************************************//**
Tries to balance the given directory slot with too few records
with the upper neighbor, so that there are at least the minimum number
page_t* page, /*!< in/out: index page */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
ulint slot_no)/*!< in: the directory slot */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/**********************************************************//**
Parses a log record of a record list end or start deletion.
@return end of log record or NULL */
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record on the uncompressed page */
ulint flag) /*!< in: the deleted flag (nonzero=TRUE) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Write the "owned" flag of a record on a compressed page. The n_owned field
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record on the uncompressed page */
ulint flag) /*!< in: the owned flag (nonzero=TRUE) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Shift the dense page directory when a record is deleted. */
dict_index_t* index, /*!< in: index of rec */
const ulint* offsets,/*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of the free list */
- __attribute__((nonnull(1,2,3,4)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4)));
/**********************************************************************//**
Add a slot to the dense page directory. */
page_zip_des_t* page_zip, /*!< in/out: compressed page */
ulint is_clustered) /*!< in: nonzero for clustered index,
zero for others */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif
/*****************************************************************************
-Copyright (c) 2005, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2016, 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
page_zip_get_size(
/*==============*/
const page_zip_des_t* page_zip) /*!< in: compressed page */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/**********************************************************************//**
Set the size of a compressed page in bytes. */
UNIV_INLINE
ulint n_fields, /*!< in: number of fields in the record;
ignored if zip_size == 0 */
ulint zip_size) /*!< in: compressed page size in bytes, or 0 */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/**********************************************************************//**
Determine the guaranteed free space on an empty page.
/*================*/
ulint n_fields, /*!< in: number of columns in the index */
ulint zip_size) /*!< in: compressed page size in bytes */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
dict_index_t* index, /*!< in: index of the B-tree node */
ulint level, /*!< in: compression level */
mtr_t* mtr) /*!< in: mini-transaction, or NULL */
- __attribute__((nonnull(1,2,3)));
+ MY_ATTRIBUTE((nonnull(1,2,3)));
/**********************************************************************//**
Decompress a page. This function should tolerate errors on the compressed
FALSE=verify but do not copy some
page header fields that should not change
after page creation */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
#ifdef UNIV_DEBUG
/**********************************************************************//**
const dict_index_t* index, /*!< in: index of the page, if known */
ibool sloppy) /*!< in: FALSE=strict,
TRUE=ignore the MIN_REC_FLAG */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Check that the compressed and decompressed pages match. */
UNIV_INTERN
const page_zip_des_t* page_zip,/*!< in: compressed page */
const page_t* page, /*!< in: uncompressed page */
const dict_index_t* index) /*!< in: index of the page, if known */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
#endif /* UNIV_ZIP_DEBUG */
/**********************************************************************//**
/*==================*/
const page_zip_des_t* page_zip,/*!< in: compressed page */
ibool is_clust)/*!< in: TRUE if clustered index */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/**********************************************************************//**
Determine if enough space is available in the modification log.
ulint length, /*!< in: combined size of the record */
ulint create) /*!< in: nonzero=add the record to
the heap */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/**********************************************************************//**
Write data to the uncompressed header portion of a page. The data must
const byte* str, /*!< in: address on the uncompressed page */
ulint length, /*!< in: length of the data */
mtr_t* mtr) /*!< in: mini-transaction, or NULL */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Write an entire record on the compressed page. The data must already
dict_index_t* index, /*!< in: the index the record belongs to */
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
ulint create) /*!< in: nonzero=insert, zero=update */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Parses a log record of writing a BLOB pointer of a record.
ulint n, /*!< in: column index */
mtr_t* mtr) /*!< in: mini-transaction handle,
or NULL if no logging is needed */
- __attribute__((nonnull(1,2,3,4)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4)));
/***********************************************************//**
Parses a log record of writing the node pointer of a record.
ulint size, /*!< in: data size of rec */
ulint ptr, /*!< in: node pointer */
mtr_t* mtr) /*!< in: mini-transaction, or NULL */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Write the trx_id and roll_ptr of a record on a B-tree leaf node page. */
ulint trx_id_col,/*!< in: column number of TRX_ID in rec */
trx_id_t trx_id, /*!< in: transaction identifier */
roll_ptr_t roll_ptr)/*!< in: roll_ptr */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Write the "deleted" flag of a record on a compressed page. The flag must
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record on the uncompressed page */
ulint flag) /*!< in: the deleted flag (nonzero=TRUE) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Write the "owned" flag of a record on a compressed page. The n_owned field
page_zip_des_t* page_zip,/*!< in/out: compressed page */
const byte* rec, /*!< in: record on the uncompressed page */
ulint flag) /*!< in: the owned flag (nonzero=TRUE) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Insert a record to the dense page directory. */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */
const byte* free) /*!< in: previous start of
the free list */
- __attribute__((nonnull(1,2,3,4)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4)));
/**********************************************************************//**
Add a slot to the dense page directory. */
page_zip_des_t* page_zip, /*!< in/out: compressed page */
ulint is_clustered) /*!< in: nonzero for clustered index,
zero for others */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Parses a log record of writing to the header of a page.
const byte* str, /*!< in: address on the uncompressed page */
ulint length, /*!< in: length of the data */
mtr_t* mtr) /*!< in: mini-transaction, or NULL */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Reorganize and compress a page. This is a low-level operation for
m_start, m_end, m_nonempty */
dict_index_t* index, /*!< in: index of the B-tree node */
mtr_t* mtr) /*!< in: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/**********************************************************************//**
Copy the records of a page byte for byte. Do not copy the page header
const page_t* src, /*!< in: page */
dict_index_t* index, /*!< in: index of the B-tree */
mtr_t* mtr) /*!< in: mini-transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/**********************************************************************//**
byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< out: uncompressed page */
page_zip_des_t* page_zip)/*!< out: compressed page */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Calculate the compressed page checksum.
const void* data, /*!< in: compressed page */
ulint size, /*!< in: size of compressed page */
srv_checksum_algorithm_t algo) /*!< in: algorithm to use */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Verify a compressed page's checksum.
page_t* page, /*!< in: uncompressed page */
page_zip_des_t* page_zip, /*!< out: compressed page */
dict_index_t* index) /*!< in: index */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************************//**
Reset the counters used for filling
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
query graph, or NULL for dummy graph */
trx_t* trx, /*!< in: transaction handle */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
- __attribute__((nonnull(2,3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(2,3), warn_unused_result));
/****************************************************************//**
Create parser info struct.
pars_info_t* info, /*!< in: info struct */
const char* name, /*!< in: name */
const ib_uint64_t* val) /*!< in: value */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/****************************************************************//**
Add bound id. */
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
/*==================*/
const read_view_t* view, /*!< in: read view */
trx_id_t trx_id) /*!< in: trx id */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Prints a read view to stderr. */
UNIV_INTERN
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
bytes within the first field not completely
matched; when function returns, contains the
value for current comparison */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define cmp_dtuple_rec_with_match(tuple,rec,offsets,fields,bytes) \
cmp_dtuple_rec_with_match_low( \
tuple,rec,offsets,dtuple_get_n_fields_cmp(tuple),fields,bytes)
struct TABLE* table) /*!< in: MySQL table, for reporting
duplicate key value if applicable,
or NULL */
- __attribute__((nonnull(1,2,3,4), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4), warn_unused_result));
/*************************************************************//**
This function is used to compare two physical records. Only the common
first fields are compared, and if an externally stored field is
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
/*===================*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the pointer of the next chained record
on the same page.
/*=============*/
rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the offset of the
next chained record on the same page.
/*==============*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the next record offset field
of an old-style record. */
/*==================*/
rec_t* rec, /*!< in: old-style physical record */
ulint next) /*!< in: offset of the next record */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to set the next record offset field
of a new-style record. */
/*==================*/
rec_t* rec, /*!< in/out: new-style physical record */
ulint next) /*!< in: offset of the next record */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to get the number of fields
in an old-style record.
rec_get_n_fields_old(
/*=================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the number of fields
in a record.
/*=============*/
const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the number of records owned by the
previous directory record.
rec_get_n_owned_old(
/*================*/
const rec_t* rec) /*!< in: old-style physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the number of owned records. */
UNIV_INLINE
/*================*/
rec_t* rec, /*!< in: old-style physical record */
ulint n_owned) /*!< in: the number of owned */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to get the number of records owned by the
previous directory record.
rec_get_n_owned_new(
/*================*/
const rec_t* rec) /*!< in: new-style physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the number of owned records. */
UNIV_INLINE
rec_t* rec, /*!< in/out: new-style physical record */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
ulint n_owned)/*!< in: the number of owned */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/******************************************************//**
The following function is used to retrieve the info bits of
a record.
/*==============*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the info bits of a record. */
UNIV_INLINE
/*==================*/
rec_t* rec, /*!< in: old-style physical record */
ulint bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to set the info bits of a record. */
UNIV_INLINE
/*==================*/
rec_t* rec, /*!< in/out: new-style physical record */
ulint bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function retrieves the status bits of a new-style record.
@return status bits */
rec_get_status(
/*===========*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the status bits of a new-style record. */
/*===========*/
rec_t* rec, /*!< in/out: physical record */
ulint bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to retrieve the info and status
/*=========================*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the info and status
bits of a record. (Only compact records have status bits.) */
/*=========================*/
rec_t* rec, /*!< in/out: compact physical record */
ulint bits) /*!< in: info bits */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function tells if record is delete marked.
/*=================*/
const rec_t* rec, /*!< in: physical record */
ulint comp) /*!< in: nonzero=compact page format */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the deleted bit. */
UNIV_INLINE
/*=====================*/
rec_t* rec, /*!< in: old-style physical record */
ulint flag) /*!< in: nonzero if delete marked */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to set the deleted bit. */
UNIV_INLINE
rec_t* rec, /*!< in/out: new-style physical record */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
ulint flag) /*!< in: nonzero if delete marked */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/******************************************************//**
The following function tells if a new-style record is a node pointer.
@return TRUE if node pointer */
rec_get_node_ptr_flag(
/*==================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to get the order number
of an old-style record in the heap of the index page.
rec_get_heap_no_old(
/*================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the heap number
field in an old-style record. */
/*================*/
rec_t* rec, /*!< in: physical record */
ulint heap_no)/*!< in: the heap number */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to get the order number
of a new-style record in the heap of the index page.
rec_get_heap_no_new(
/*================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the heap number
field in a new-style record. */
/*================*/
rec_t* rec, /*!< in/out: physical record */
ulint heap_no)/*!< in: the heap number */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
The following function is used to test whether the data offsets
in the record are stored in one-byte or two-byte format.
rec_get_1byte_offs_flag(
/*====================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
The following function is used to set the 1-byte offsets flag. */
/*====================*/
rec_t* rec, /*!< in: physical record */
ibool flag) /*!< in: TRUE if 1byte form */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
Returns the offset of nth field end if the record is stored in the 1-byte
/*=====================*/
const rec_t* rec, /*!< in: record */
ulint n) /*!< in: field index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns the offset of nth field end if the record is stored in the 2-byte
/*=====================*/
const rec_t* rec, /*!< in: record */
ulint n) /*!< in: field index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns nonzero if the field is stored off-page.
/*==================*/
const rec_t* rec, /*!< in: record */
ulint n) /*!< in: field index */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Determine how many of the first n columns in a compact
const rec_t* rec, /*!< in: compact physical record */
const dict_index_t* index, /*!< in: record descriptor */
ulint n) /*!< in: number of columns to scan */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
The following function determines the offsets to each field
#endif /* UNIV_DEBUG */
mem_heap_t** heap) /*!< in/out: memory heap */
#ifdef UNIV_DEBUG
- __attribute__((nonnull(1,2,5,7),warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,5,7),warn_unused_result));
#else /* UNIV_DEBUG */
- __attribute__((nonnull(1,2,5),warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,5),warn_unused_result));
#endif /* UNIV_DEBUG */
#ifdef UNIV_DEBUG
0=leaf node */
ulint* offsets)/*!< in/out: array consisting of
offsets[0] allocated elements */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
/************************************************************//**
Validates offsets returned by rec_get_offsets().
const dict_index_t* index, /*!< in: record descriptor or NULL */
const ulint* offsets)/*!< in: array returned by
rec_get_offsets() */
- __attribute__((nonnull(3), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(3), warn_unused_result));
/************************************************************//**
Updates debug data in offsets, in order to avoid bogus
rec_offs_validate() failures. */
const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in: array returned by
rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#else
# define rec_offs_make_valid(rec, index, offsets) ((void) 0)
#endif /* UNIV_DEBUG */
ulint n, /*!< in: index of the field */
ulint* len) /*!< out: length of the field; UNIV_SQL_NULL
if SQL null */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define rec_get_nth_field_old(rec, n, len) \
((rec) + rec_get_nth_field_offs_old(rec, n, len))
/************************************************************//**
/*===================*/
const rec_t* rec, /*!< in: record */
ulint n) /*!< in: index of the field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/************************************************************//**
The following function is used to get an offset to the nth
data field in a record.
ulint n, /*!< in: index of the field */
ulint* len) /*!< out: length of the field; UNIV_SQL_NULL
if SQL null */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define rec_get_nth_field(rec, offsets, n, len) \
((rec) + rec_get_nth_field_offs(offsets, n, len))
/******************************************************//**
rec_offs_comp(
/*==========*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Determine if the offsets are for a record containing
externally stored columns.
rec_offs_any_extern(
/*================*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Determine if the offsets are for a record containing null BLOB pointers.
@return first field containing a null BLOB pointer, or NULL if none found */
/*=====================*/
const rec_t* rec, /*!< in: record */
const ulint* offsets) /*!< in: rec_get_offsets(rec) */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns nonzero if the extern bit is set in nth field of rec.
@return nonzero if externally stored */
/*================*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns nonzero if the SQL NULL bit is set in nth field of rec.
@return nonzero if SQL NULL */
/*==================*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Gets the physical size of a field.
@return length of field */
/*==============*/
const ulint* offsets,/*!< in: array returned by rec_get_offsets() */
ulint n) /*!< in: nth field */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/******************************************************//**
Returns the number of extern bits set in a record.
rec_offs_n_extern(
/*==============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/***********************************************************//**
This is used to modify the value of an already existing field in a record.
The previous value must have exactly the same size as the new value. If len
length as the previous value.
If SQL null, previous value must be
SQL null. */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/**********************************************************//**
The following function returns the data size of an old-style physical
record, that is the sum of field lengths. SQL null fields
rec_get_data_size_old(
/*==================*/
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
The following function returns the number of allocated elements
for an array of offsets.
rec_offs_get_n_alloc(
/*=================*/
const ulint* offsets)/*!< in: array for rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
The following function sets the number of allocated elements
for an array of offsets. */
ulint* offsets, /*!< out: array for rec_get_offsets(),
must be allocated */
ulint n_alloc) /*!< in: number of elements */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#define rec_offs_init(offsets) \
rec_offs_set_n_alloc(offsets, (sizeof offsets) / sizeof *offsets)
/**********************************************************//**
rec_offs_n_fields(
/*==============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
The following function returns the data size of a physical
record, that is the sum of field lengths. SQL null fields
rec_offs_data_size(
/*===============*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
Returns the total size of record minus data size of record.
The value returned by the function is the distance from record
rec_offs_extra_size(
/*================*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
Returns the total size of a physical record.
@return size */
rec_offs_size(
/*==========*/
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#ifdef UNIV_DEBUG
/**********************************************************//**
Returns a pointer to the start of the record.
/*==========*/
const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
/**********************************************************//**
Returns a pointer to the end of the record.
@return pointer to end */
/*========*/
const rec_t* rec, /*!< in: pointer to record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#else /* UNIV_DEBUG */
# define rec_get_start(rec, offsets) ((rec) - rec_offs_extra_size(offsets))
# define rec_get_end(rec, offsets) ((rec) + rec_offs_data_size(offsets))
void* buf, /*!< in: buffer */
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/**********************************************************//**
Determines the size of a data tuple prefix in a temporary file.
const dfield_t* fields, /*!< in: array of data fields */
ulint n_fields,/*!< in: number of data fields */
ulint* extra) /*!< out: extra size */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/******************************************************//**
Determine the offset to each field in temporary file.
const dict_index_t* index, /*!< in: record descriptor */
ulint* offsets)/*!< in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************//**
Builds a temporary file record out of a data tuple.
const dict_index_t* index, /*!< in: record descriptor */
const dfield_t* fields, /*!< in: array of data fields */
ulint n_fields) /*!< in: number of fields */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**************************************************************//**
Copies the first n fields of a physical record to a new physical record in
for the copied prefix,
or NULL */
ulint* buf_size) /*!< in/out: buffer size */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/************************************************************//**
Folds a prefix of a physical record to a ulint.
@return the folded value */
ulint n_bytes, /*!< in: number of bytes to fold
in an incomplete last field */
index_id_t tree_id) /*!< in: index tree id */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/*********************************************************//**
Builds a physical record out of a data tuple and
const dtuple_t* dtuple, /*!< in: data tuple */
ulint n_ext) /*!< in: number of
externally stored columns */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/**********************************************************//**
Returns the extra size of an old-style physical record if we know its
data size and number of fields.
ulint data_size, /*!< in: data size */
ulint n_fields, /*!< in: number of fields */
ulint n_ext) /*!< in: number of externally stored columns */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/**********************************************************//**
Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT.
@return total size */
const dfield_t* fields, /*!< in: array of data fields */
ulint n_fields,/*!< in: number of data fields */
ulint* extra) /*!< out: extra size */
- __attribute__((warn_unused_result, nonnull(1,2)));
+ MY_ATTRIBUTE((warn_unused_result, nonnull(1,2)));
/**********************************************************//**
Determines the size of a data tuple in ROW_FORMAT=COMPACT.
@return total size */
const dfield_t* fields, /*!< in: array of data fields */
ulint n_fields,/*!< in: number of data fields */
ulint* extra) /*!< out: extra size */
- __attribute__((nonnull(1,3)));
+ MY_ATTRIBUTE((nonnull(1,3)));
/**********************************************************//**
The following function returns the size of a data tuple when converted to
a physical record.
dict_index_t* index, /*!< in: record descriptor */
const dtuple_t* dtuple, /*!< in: data tuple */
ulint n_ext) /*!< in: number of externally stored columns */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
#ifndef UNIV_HOTBACKUP
/**************************************************************//**
Copies the first n fields of a physical record to a data tuple.
ulint n_fields, /*!< in: number of fields
to copy */
mem_heap_t* heap) /*!< in: memory heap */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/***************************************************************//**
Validates the consistency of a physical record.
/*=========*/
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Prints an old-style physical record. */
UNIV_INTERN
/*==========*/
FILE* file, /*!< in: file where to print */
const rec_t* rec) /*!< in: physical record */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_HOTBACKUP
/***************************************************************//**
Prints a physical record in ROW_FORMAT=COMPACT. Ignores the
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Prints a physical record. */
UNIV_INTERN
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
const ulint* offsets)/*!< in: array returned by rec_get_offsets() */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***************************************************************//**
Prints a physical record. */
UNIV_INTERN
FILE* file, /*!< in: file where to print */
const rec_t* rec, /*!< in: physical record */
const dict_index_t* index) /*!< in: record descriptor */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
# ifdef UNIV_DEBUG
/************************************************************//**
/*===========*/
const rec_t* rec, /*!< in: record */
const dict_index_t* index) /*!< in: clustered index */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# endif /* UNIV_DEBUG */
#endif /* UNIV_HOTBACKUP */
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ulint extra_len;
ulint data_len;
- ut_ad(rec && buf);
+ ut_ad(rec != NULL);
+ ut_ad(buf != NULL);
ut_ad(rec_offs_validate(rec, NULL, offsets));
ut_ad(rec_validate(rec, offsets));
/*****************************************************************************
-Copyright (c) 2010, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
instantiated */
fts_psort_t** merge) /*!< out: parallel merge info
to be instantiated */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Clean up and deallocate FTS parallel sort structures, and close
temparary merge sort files */
fts_psort_t* psort_info, /*!< parallel sort info */
ulint id) /* !< in: which auxiliary table's data
to insert to */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* row0ftsort_h */
/*****************************************************************************
-Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
dict_table_t* table, /*!< in/out: table */
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct
in MySQL */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Update the DICT_TF2_DISCARDED flag in SYS_TABLES.
bool dict_locked) /*!< in: Set to true if the
caller already owns the
dict_sys_t:: mutex. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Update the (space, root page) of a table's indexes from the values
bool dict_locked) /*!< in: Set to true if the
caller already owns the
dict_sys_t:: mutex. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0import.ic"
#endif
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
table, else the referenced table */
dtuple_t* entry, /*!< in: index entry for index */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Creates an insert node struct.
@return own: insert node struct */
dtuple_t* entry, /*!< in/out: index entry to insert */
ulint n_ext, /*!< in: number of externally stored columns */
que_thr_t* thr) /*!< in: query thread or NULL */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************//**
Tries to insert an entry into a secondary index. If a record with exactly the
same fields is found, the other record is necessarily marked deleted.
trx_id_t trx_id, /*!< in: PAGE_MAX_TRX_ID during
row_log_table_apply(), or 0 */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************//**
Tries to insert the externally stored fields (off-page columns)
of a clustered index entry.
const void* thd, /*!< in: connection, or NULL */
#endif /* DBUG_OFF */
ulint line) /*!< in: line number of caller */
- __attribute__((nonnull(1,2,3,4,5,6), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,4,5,6), warn_unused_result));
#ifdef DBUG_OFF
# define row_ins_index_entry_big_rec(e,big,ofs,heap,index,thd,file,line) \
row_ins_index_entry_big_rec_func(e,big,ofs,heap,index,file,line)
dtuple_t* entry, /*!< in/out: index entry to insert */
que_thr_t* thr, /*!< in: query thread */
ulint n_ext) /*!< in: number of externally stored columns */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************//**
Inserts an entry into a secondary index. Tries first optimistic,
then pessimistic descent down the tree. If the entry matches enough
dict_index_t* index, /*!< in: secondary index */
dtuple_t* entry, /*!< in/out: index entry to insert */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************//**
Inserts a row to a table. This is a high-level function used in
SQL execution graphs.
/*****************************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
const ulint* col_map,/*!< in: mapping of old column
numbers to new ones, or NULL if !table */
const char* path) /*!< in: where to create temporary file */
- __attribute__((nonnull(1), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1), warn_unused_result));
/******************************************************//**
Free the row log for an index that was being created online. */
row_log_free(
/*=========*/
row_log_t*& log) /*!< in,own: row log */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
Free the row log for an index on which online creation was aborted. */
row_log_abort_sec(
/*==============*/
dict_index_t* index) /*!< in/out: index (x-latched) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************//**
Try to log an operation to a secondary index that is
const dtuple_t* tuple, /*!< in: index tuple */
trx_id_t trx_id) /*!< in: transaction ID for insert,
or 0 for delete */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
Logs an operation to a secondary index that is (or was) being created. */
UNIV_INTERN
const dtuple_t* tuple, /*!< in: index tuple */
trx_id_t trx_id) /*!< in: transaction ID for insert,
or 0 for delete */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/******************************************************//**
Gets the error status of the online index rebuild log.
/*====================*/
const dict_index_t* index) /*!< in: clustered index of a table
that is being rebuilt online */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
Logs a delete operation to a table that is being rebuilt.
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
const byte* sys) /*!< in: DB_TRX_ID,DB_ROLL_PTR that should
be logged, or NULL to use those in rec */
- UNIV_COLD __attribute__((nonnull(1,2,3)));
+ UNIV_COLD MY_ATTRIBUTE((nonnull(1,2,3)));
/******************************************************//**
Logs an update operation to a table that is being rebuilt.
const ulint* offsets,/*!< in: rec_get_offsets(rec,index) */
const dtuple_t* old_pk) /*!< in: row_log_table_get_pk()
before the update */
- UNIV_COLD __attribute__((nonnull(1,2,3)));
+ UNIV_COLD MY_ATTRIBUTE((nonnull(1,2,3)));
/******************************************************//**
Constructs the old PRIMARY KEY and DB_TRX_ID,DB_ROLL_PTR
byte* sys, /*!< out: DB_TRX_ID,DB_ROLL_PTR for
row_log_table_delete(), or NULL */
mem_heap_t** heap) /*!< in/out: memory heap where allocated */
- UNIV_COLD __attribute__((nonnull(1,2,5), warn_unused_result));
+ UNIV_COLD MY_ATTRIBUTE((nonnull(1,2,5), warn_unused_result));
/******************************************************//**
Logs an insert to a table that is being rebuilt.
dict_index_t* index, /*!< in/out: clustered index, S-latched
or X-latched */
const ulint* offsets)/*!< in: rec_get_offsets(rec,index) */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/******************************************************//**
Notes that a BLOB is being freed during online ALTER TABLE. */
UNIV_INTERN
/*====================*/
dict_index_t* index, /*!< in/out: clustered index, X-latched */
ulint page_no)/*!< in: starting page number of the BLOB */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/******************************************************//**
Notes that a BLOB is being allocated during online ALTER TABLE. */
UNIV_INTERN
/*=====================*/
dict_index_t* index, /*!< in/out: clustered index, X-latched */
ulint page_no)/*!< in: starting page number of the BLOB */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/******************************************************//**
Apply the row_log_table log to a table upon completing rebuild.
@return DB_SUCCESS, or error code on failure */
/*!< in: old table */
struct TABLE* table) /*!< in/out: MySQL table
(for reporting duplicates) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
Get the latest transaction ID that has invoked row_log_online_op()
row_log_get_max_trx(
/*================*/
dict_index_t* index) /*!< in: index, must be locked */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************//**
Merge the row log to the index upon completing index creation.
dict_index_t* index, /*!< in/out: secondary index */
struct TABLE* table) /*!< in/out: MySQL table
(for reporting duplicates) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0log.ic"
/*****************************************************************************
-Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
/*=================*/
row_merge_dup_t* dup, /*!< in/out: for reporting duplicates */
const dfield_t* entry) /*!< in: duplicate index entry */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Sets an exclusive lock on a table, for the duration of creating indexes.
@return error code or DB_SUCCESS */
trx_t* trx, /*!< in/out: transaction */
dict_table_t* table, /*!< in: table to lock */
enum lock_mode mode) /*!< in: LOCK_X or LOCK_S */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Drop indexes that were created before an error occurred.
The data dictionary must have been locked exclusively by the caller,
/*========================*/
trx_t* trx, /*!< in/out: dictionary transaction */
table_id_t table_id)/*!< in: table identifier */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Drop those indexes which were created before an error occurred.
The data dictionary must have been locked exclusively by the caller,
dict_table_t* table, /*!< in/out: table containing the indexes */
ibool locked) /*!< in: TRUE=table locked,
FALSE=may need to do a lazy drop */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Drop all partially created indexes during crash recovery. */
UNIV_INTERN
int
row_merge_file_create_low(
const char* path)
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/*********************************************************************//**
Destroy a merge file. And de-register the file from Performance Schema
if UNIV_PFS_IO is defined. */
old_table->name */
const char* tmp_name, /*!< in: new name for old_table */
trx_t* trx) /*!< in/out: dictionary transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Rename an index in the dictionary that was created. The data
trx_t* trx, /*!< in/out: transaction */
table_id_t table_id, /*!< in: table identifier */
index_id_t index_id) /*!< in: index identifier */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Rename an index in the dictionary that is to be dropped. The data
dictionary must have been locked exclusively by the caller, because
trx_t* trx, /*!< in/out: transaction */
table_id_t table_id, /*!< in: table identifier */
index_id_t index_id) /*!< in: index identifier */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Create the index and load in to the dictionary.
@return index, or NULL on error */
/*=================*/
trx_t* trx, /*!< in: transaction */
dict_table_t* table) /*!< in: table instance to drop */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Build indexes on a table by reading a clustered index,
creating a temporary file containing index entries, merge sorting
AUTO_INCREMENT column, or
ULINT_UNDEFINED if none is added */
ib_sequence_t& sequence) /*!< in/out: autoinc sequence */
- __attribute__((nonnull(1,2,3,5,6,8), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,5,6,8), warn_unused_result));
/********************************************************************//**
Write a buffer to a block. */
UNIV_INTERN
const row_merge_buf_t* buf, /*!< in: sorted buffer */
const merge_file_t* of, /*!< in: output file */
row_merge_block_t* block) /*!< out: buffer for writing to file */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Sort a buffer. */
UNIV_INTERN
row_merge_buf_t* buf, /*!< in/out: sort buffer */
row_merge_dup_t* dup) /*!< in/out: reporter of duplicates
(NULL if non-unique index) */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/********************************************************************//**
Write a merge block to the file system.
@return TRUE if request was successful, FALSE if fail */
row_merge_buf_empty(
/*================*/
row_merge_buf_t* buf) /*!< in,own: sort buffer */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/** Create a merge file in the given location.
@param[out] merge_file merge file structure
index entries */
row_merge_block_t* block, /*!< in/out: 3 buffers */
int* tmpfd) /*!< in/out: temporary file handle */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Allocate a sort buffer.
@return own: sort buffer */
row_merge_buf_create(
/*=================*/
dict_index_t* index) /*!< in: secondary index */
- __attribute__((warn_unused_result, nonnull, malloc));
+ MY_ATTRIBUTE((warn_unused_result, nonnull, malloc));
/*********************************************************************//**
Deallocate a sort buffer. */
UNIV_INTERN
row_merge_buf_free(
/*===============*/
row_merge_buf_t* buf) /*!< in,own: sort buffer to be freed */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Destroy a merge file. */
UNIV_INTERN
row_merge_file_destroy(
/*===================*/
merge_file_t* merge_file) /*!< in/out: merge file structure */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Read a merge block from the file system.
@return TRUE if request was successful, FALSE if fail */
or NULL on end of list
(non-NULL on I/O error) */
ulint* offsets)/*!< out: offsets of mrec */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* row0merge.h */
/*****************************************************************************
-Copyright (c) 2000, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
trx_t* trx, /*!< in: transaction */
que_thr_t* thr, /*!< in: query thread, or NULL */
trx_savept_t* savept) /*!< in: savepoint, or NULL */
- __attribute__((nonnull(1,2)));
+ MY_ATTRIBUTE((nonnull(1,2)));
/********************************************************************//**
Create a prebuilt struct for a MySQL table handle.
@return own: a prebuilt struct */
/*=============================*/
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in the MySQL
table handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Sets a table lock on the table mentioned in prebuilt.
@return error code or DB_SUCCESS */
prebuilt->select_lock_type */
ulint mode) /*!< in: lock mode of table
(ignored if table==NULL) */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*********************************************************************//**
Does an insert for MySQL.
@return error code or DB_SUCCESS */
byte* mysql_rec, /*!< in: row in the MySQL format */
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL
handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Builds a dummy query graph used in selects. */
UNIV_INTERN
the MySQL format */
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL
handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
This can only be used when srv_locks_unsafe_for_binlog is TRUE or this
session is using a READ COMMITTED or READ UNCOMMITTED isolation level.
the records under pcur and
clust_pcur, and we do not need
to reposition the cursors. */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Checks if a table name contains the string "/#sql" which denotes temporary
tables in MySQL.
bool
row_is_mysql_tmp_table_name(
/*========================*/
- const char* name) __attribute__((warn_unused_result));
+ const char* name) MY_ATTRIBUTE((warn_unused_result));
/*!< in: table name in the form
'database/tablename' */
upd_node_t* node, /*!< in: update node used in the cascade
or set null operation */
dict_table_t* table) /*!< in: table where we do the operation */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Locks the data dictionary exclusively for performing a table create or other
data dictionary modification operation. */
added to the data dictionary cache) */
trx_t* trx, /*!< in/out: transaction */
bool commit) /*!< in: if true, commit the transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Does an index creation operation for MySQL. TODO: currently failure
to create an index results in dropping the whole table! This is no problem
index columns, which are
then checked for not being too
large. */
- __attribute__((nonnull(1,2), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2), warn_unused_result));
/*********************************************************************//**
Scans a table create SQL string and adds to the data dictionary
the foreign key constraints declared in the string. This function
ibool reject_fks) /*!< in: if TRUE, fail with error
code DB_CANNOT_ADD_CONSTRAINT if
any foreign keys are found. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
The master thread in srv0srv.cc calls this regularly to drop tables which
we must drop in background after queries to them have ended. Such lazy
dict_table_t* table, /*!< in: table to lock */
enum lock_mode mode, /*!< in: LOCK_X or LOCK_S */
const char* op_info) /*!< in: string for trx->op_info */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Truncates a table for MySQL.
/*=========================*/
dict_table_t* table, /*!< in: table handle */
trx_t* trx) /*!< in: transaction handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Drops a table for MySQL. If the name of the dropped table ends in
one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor",
bool nonatomic = true)
/*!< in: whether it is permitted
to release and reacquire dict_operation_lock */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Drop all temporary tables during crash recovery. */
UNIV_INTERN
/*=============================*/
const char* name, /*!< in: table name */
trx_t* trx) /*!< in: transaction handle */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Imports a tablespace. The space id in the .ibd file must match the space id
of the table in the data dictionary.
/*============================*/
dict_table_t* table, /*!< in/out: table */
row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Drops a database for MySQL.
@return error code or DB_SUCCESS */
/*========================*/
const char* name, /*!< in: database name which ends to '/' */
trx_t* trx) /*!< in: transaction handle */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Renames a table for MySQL.
@return error code or DB_SUCCESS */
const char* new_name, /*!< in: new table name */
trx_t* trx, /*!< in/out: transaction */
bool commit) /*!< in: whether to commit trx */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Checks that the index contains entries in an ascending order, unique
constraint is not broken, and calculates the number of index entries
const dict_index_t* index, /*!< in: index */
ulint* n_rows) /*!< out: number of entries
seen in the consistent read */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Determines if a table is a magic monitor table.
@return true if monitor table */
/*=======================*/
const char* table_name) /*!< in: name of the table, in the
form database/table_name */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Initialize this module */
UNIV_INTERN
dict_table_t* table, /*!< in/out: table */
trx_t* trx, /*!< in/out: transaction */
table_id_t* new_id) /*!< out: new table id */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/* A struct describing a place for an individual column in the MySQL
row format which is presented to the table handler in ha_innobase.
/*****************************************************************************
-Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
que_thr_t* parent, /*!< in: parent node, i.e., a
thr node */
mem_heap_t* heap) /*!< in: memory heap where created */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************//**
Determines if it is possible to remove a secondary index entry.
Removal is possible if the secondary index entry does not refer to any
purge_node_t* node, /*!< in/out: row purge node */
dict_index_t* index, /*!< in: secondary index */
const dtuple_t* entry) /*!< in: secondary index entry */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***************************************************************
Does the purge operation for a single undo log record. This is a high-level
function used in an SQL execution graph.
row_purge_step(
/*===========*/
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/* Purge node structure */
/*****************************************************************************
-Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
/*====================*/
dict_table_t* table, /*!< in: quiesce this table */
trx_t* trx) /*!< in/out: transaction/session */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*********************************************************************//**
Set a table's quiesce state.
dict_table_t* table, /*!< in: quiesce this table */
ib_quiesce_t state, /*!< in: quiesce state to set */
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Cleanup after table quiesce. */
/*=======================*/
dict_table_t* table, /*!< in: quiesce this table */
trx_t* trx) /*!< in/out: transaction/session */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_NONINL
#include "row0quiesce.ic"
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/*==================*/
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: record offsets */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Reads the trx id field from a clustered index record.
@return value of the field */
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Reads the roll pointer field from a clustered index record.
@return value of the field */
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: clustered index */
const ulint* offsets)/*!< in: rec_get_offsets(rec, index) */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
When an insert or purge to a table is performed, this function builds
the entry to be inserted into or purged from an index on the table.
mem_heap_t* heap) /*!< in: memory heap from which
the memory for the index entry
is allocated */
- __attribute__((warn_unused_result, nonnull(1,3,4)));
+ MY_ATTRIBUTE((warn_unused_result, nonnull(1,3,4)));
/*****************************************************************//**
When an insert or purge to a table is performed, this function builds
the entry to be inserted into or purged from an index on the table.
mem_heap_t* heap) /*!< in: memory heap from which
the memory for the index entry
is allocated */
- __attribute__((warn_unused_result, nonnull(1,3,4)));
+ MY_ATTRIBUTE((warn_unused_result, nonnull(1,3,4)));
/*******************************************************************//**
An inverse function to row_build_index_entry. Builds a row from a
record in a clustered index.
prefixes, or NULL */
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
- __attribute__((nonnull(2,3,9)));
+ MY_ATTRIBUTE((nonnull(2,3,9)));
/*******************************************************************//**
Converts an index record to a typed data tuple.
@return index entry built; does not set info_bits, and the data fields
stored columns */
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Converts an index record to a typed data tuple. NOTE that externally
stored (often big) fields are NOT copied to heap.
stored columns */
mem_heap_t* heap) /*!< in: memory heap from which
the memory needed is allocated */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Builds from a secondary index record a row reference with which we can
search the clustered index record.
as long as the row reference is used! */
mem_heap_t* heap) /*!< in: memory heap from which the memory
needed is allocated */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Builds from a secondary index record a row reference with which we can
search the clustered index record. */
ulint* offsets,/*!< in: rec_get_offsets(rec, index)
or NULL */
trx_t* trx) /*!< in: transaction or NULL */
- __attribute__((nonnull(1,2,3)));
+ MY_ATTRIBUTE((nonnull(1,2,3)));
/*******************************************************************//**
Builds from a secondary index record a row reference with which we can
search the clustered index record. */
const dict_table_t* table, /*!< in: table */
const dtuple_t* ref, /*!< in: row reference */
mtr_t* mtr) /*!< in/out: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*********************************************************************//**
Fetches the clustered index record for a secondary index record. The latches
on the secondary index record are preserved.
dict_index_t* index, /*!< in: secondary index */
dict_index_t** clust_index,/*!< out: clustered index */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** Result of row_search_index_entry */
enum row_search_result {
btr_pcur_t* pcur, /*!< in/out: persistent cursor, which must
be closed by the caller */
mtr_t* mtr) /*!< in: mtr */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#define ROW_COPY_DATA 1
#define ROW_COPY_POINTERS 2
char* buf, /*!< out: output buffer */
ulint buf_size) /*!< in: output buffer size
in bytes */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0row.ic"
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
then prebuilt must have a pcur
with stored position! In opening of a
cursor 'direction' should be 0. */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Checks if MySQL at the moment is allowed for this table to retrieve a
consistent read result, or store it to the query cache.
dict_index_t* index, /*!< in: index to search */
const char* col_name, /*!< in: autoinc column name */
ib_uint64_t* value) /*!< out: AUTOINC value read */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/** A structure for caching column values for prefetched rows */
struct sel_buf_t{
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
row_undo_ins(
/*=========*/
undo_node_t* node) /*!< in: row undo node */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0uins.ic"
#endif
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
/*=========*/
undo_node_t* node, /*!< in: row undo node */
que_thr_t* thr) /*!< in: query thread */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#ifndef UNIV_NONINL
#include "row0umod.ic"
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/*======================*/
const upd_t* update, /*!< in: update vector */
ulint no) /*!< in: field_no */
- __attribute__((nonnull, pure));
+ MY_ATTRIBUTE((nonnull, pure));
/*********************************************************************//**
Writes into the redo log the values of trx id and roll ptr and enough info
to determine their positions within a clustered index record.
row_upd_changes_disowned_external(
/*==============================*/
const upd_t* update) /*!< in: update vector */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Replaces the new column values stored in the update vector to the
const ulint* offsets,/*!< in: rec_get_offsets(rec, index) */
const dtuple_t* entry, /*!< in: entry to insert */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
- __attribute__((warn_unused_result, nonnull));
+ MY_ATTRIBUTE((warn_unused_result, nonnull));
/***************************************************************//**
Builds an update vector from those fields, excluding the roll ptr and
trx id fields, which in an index entry differ from a record that has
trx_t* trx, /*!< in: transaction (for diagnostics),
or NULL */
mem_heap_t* heap) /*!< in: memory heap from which allocated */
- __attribute__((nonnull(1,2,3,7), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2,3,7), warn_unused_result));
/***********************************************************//**
Replaces the new column values stored in the update vector to the index entry
given. */
does not work for non-clustered indexes. */
mem_heap_t* heap) /*!< in: memory heap for allocating and
copying the new values */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Replaces the new column values stored in the update vector to the index entry
given. */
an upd_field is the clustered index position */
mem_heap_t* heap) /*!< in: memory heap for allocating and
copying the new values */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Replaces the new column values stored in the update vector. */
UNIV_INTERN
compile time */
const row_ext_t*ext) /*!< NULL, or prefixes of the externally
stored columns in the old row */
- __attribute__((nonnull(1,2), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(1,2), warn_unused_result));
#ifdef UNIV_DEBUG
# define row_upd_changes_ord_field_binary(index,update,thr,row,ext) \
row_upd_changes_ord_field_binary_func(index,update,thr,row,ext)
/*===================*/
dict_table_t* table, /*!< in: table */
upd_field_t* upd_field) /*!< in: field to check */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************//**
Checks if an update vector changes an ordering field of an index record.
This function is fast if the update vector is short or the number of ordering
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
if the history is missing or the record
does not exist in the view, that is,
it was freshly inserted afterwards */
- __attribute__((nonnull(1,2,3,4,5,6,7)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4,5,6,7)));
/*****************************************************************//**
Constructs the last committed version of a clustered index record,
const rec_t** old_vers)/*!< out: rec, old version, or NULL if the
record does not exist in the view, that is,
it was freshly inserted afterwards */
- __attribute__((nonnull(1,2,3,4,5)));
+ MY_ATTRIBUTE((nonnull(1,2,3,4,5)));
#ifndef UNIV_NONINL
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, 2009, Google Inc.
Copyright (c) 2009, Percona Inc.
extern my_bool srv_stats_persistent;
extern unsigned long long srv_stats_persistent_sample_pages;
extern my_bool srv_stats_auto_recalc;
+extern my_bool srv_stats_include_delete_marked;
extern ibool srv_use_doublewrite_buf;
extern ulong srv_doublewrite_batch_size;
os_thread_ret_t
DECLARE_THREAD(srv_purge_coordinator_thread)(
/*=========================================*/
- void* arg __attribute__((unused))); /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))); /*!< in: a dummy parameter
required by os_thread_create */
/*********************************************************************//**
os_thread_ret_t
DECLARE_THREAD(srv_worker_thread)(
/*==============================*/
- void* arg __attribute__((unused))); /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))); /*!< in: a dummy parameter
required by os_thread_create */
} /* extern "C" */
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
ulint dest_len, /*!< in: max bytes to copy */
const char* basedir, /*!< in: base directory */
const char* table_name) /*!< in: source table name */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*****************************************************************//**
Get the meta-data filename from the table name. */
dict_table_t* table, /*!< in: table */
char* filename, /*!< out: filename */
ulint max_len) /*!< in: filename max length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/** Log sequence number at shutdown */
extern lsn_t srv_shutdown_lsn;
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
/*========================*/
os_thread_id_t* waiter, /*!< out: longest waiting thread */
const void** sema) /*!< out: longest-waited-for semaphore */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Validates the integrity of the wait array. Checks
that the number of reserved cells equals the count variable. */
/*****************************************************************************
-Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
rw_lock_s_lock_low(
/*===============*/
rw_lock_t* lock, /*!< in: pointer to rw-lock */
- ulint pass __attribute__((unused)),
+ ulint pass MY_ATTRIBUTE((unused)),
/*!< in: pass value; != 0, if the lock will be
passed to another thread to unlock */
const char* file_name, /*!< in: file name where lock requested */
rw_lock_t* lock, /*!< in: rw-lock */
ulint lock_type) /*!< in: lock type: RW_LOCK_SHARED,
RW_LOCK_EX */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* UNIV_SYNC_DEBUG */
/******************************************************************//**
Checks if somebody has locked the rw-lock in the specified mode. */
/*****************************************************************************
-Copyright (c) 1995, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
rw_lock_s_lock_low(
/*===============*/
rw_lock_t* lock, /*!< in: pointer to rw-lock */
- ulint pass __attribute__((unused)),
+ ulint pass MY_ATTRIBUTE((unused)),
/*!< in: pass value; != 0, if the lock will be
passed to another thread to unlock */
const char* file_name, /*!< in: file name where lock requested */
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2012, Facebook Inc.
mutex_own(
/*======*/
const ib_mutex_t* mutex) /*!< in: mutex */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* UNIV_DEBUG */
#ifdef UNIV_SYNC_DEBUG
/******************************************************************//**
ulint level, /*!< in: level in the latching order; if
SYNC_LEVEL_VARYING, nothing is done */
ibool relock) /*!< in: TRUE if re-entering an x-lock */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/******************************************************************//**
Removes a latch from the thread level array if it is found there.
@return TRUE if found in the array; it is no error if the latch is
/*============================*/
ibool dict_mutex_allowed) /*!< in: TRUE if dictionary mutex is
allowed to be owned by the thread */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/******************************************************************//**
Checks if the level array for the current thread is empty,
except for data dictionary latches. */
ibool has_search_latch)
/*!< in: TRUE if and only if the thread
is supposed to hold btr_search_latch */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
/******************************************************************//**
Gets the debug information for a reserved mutex. */
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
trx_undo_rec_get_offset(
/*====================*/
undo_no_t undo_no) /*!< in: undo no read from node */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/**********************************************************************//**
Returns the start of the undo record data area. */
externally stored fild */
undo_no_t* undo_no, /*!< out: undo log record number */
table_id_t* table_id) /*!< out: table id */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Builds a row reference from an undo log record.
@return pointer to remaining part of undo record */
only in the assertion. */
mem_heap_t* heap) /*!< in: memory heap from which the memory
needed is allocated */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************************//**
Writes information to an undo log about an insert, update, or a delete marking
of a clustered index record. This information is used in a rollback of the
inserted undo log record,
0 if BTR_NO_UNDO_LOG
flag was specified */
- __attribute__((nonnull(3,4,10), warn_unused_result));
+ MY_ATTRIBUTE((nonnull(3,4,10), warn_unused_result));
/******************************************************************//**
Copies an undo record to heap. This function can be called if we know that
the undo log record exists.
/*======================*/
roll_ptr_t roll_ptr, /*!< in: roll pointer to record */
mem_heap_t* heap) /*!< in: memory heap where copied */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Build a previous version of a clustered index record. The caller must
hold a latch on the index page of the clustered index record.
rec_t** old_vers)/*!< out, own: previous version, or NULL if
rec is the first inserted version, or if
history data has been deleted */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Parses a redo log record of adding an undo log record.
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
os_thread_ret_t
DECLARE_THREAD(trx_rollback_or_clean_all_recovered)(
/*================================================*/
- void* arg __attribute__((unused)));
+ void* arg MY_ATTRIBUTE((unused)));
/*!< in: a dummy parameter required by
os_thread_create */
/*********************************************************************//**
trx_rollback_for_mysql(
/*===================*/
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Rollback the latest SQL statement for MySQL.
@return error code or DB_SUCCESS */
trx_rollback_last_sql_stat_for_mysql(
/*=================================*/
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Rollback a transaction to a given savepoint or do a complete rollback.
@return error code or DB_SUCCESS */
trx_savept_t* savept) /*!< in: pointer to savepoint undo number, if
partial rollback requested, or NULL for
complete rollback */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/*******************************************************************//**
Rolls back a transaction back to a named savepoint. Modifications after the
savepoint are undone but InnoDB does NOT release the corresponding locks
information to remove the
binlog entries of the queries
executed after the savepoint */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Creates a named savepoint. If the transaction is not yet started, starts it.
If there is already a savepoint of the same name, this call erases that old
position corresponding to this
connection at the time of the
savepoint */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/*******************************************************************//**
Releases a named savepoint. Savepoints which
were set after this savepoint are deleted.
/*============================*/
trx_t* trx, /*!< in: transaction handle */
const char* savepoint_name) /*!< in: savepoint name */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/*******************************************************************//**
Frees savepoint structs starting from savep. */
UNIV_INTERN
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
trx_in_trx_list(
/*============*/
const trx_t* in_trx) /*!< in: transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
#if defined UNIV_DEBUG || defined UNIV_BLOB_LIGHT_DEBUG
/***********************************************************//**
trx_assert_recovered(
/*=================*/
trx_id_t trx_id) /*!< in: transaction identifier */
- __attribute__((warn_unused_result));
+ MY_ATTRIBUTE((warn_unused_result));
#endif /* UNIV_DEBUG || UNIV_BLOB_LIGHT_DEBUG */
/*****************************************************************//**
Updates the offset information about the end of the MySQL binlog entry
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
trx_free_prepared(
/*==============*/
trx_t* trx) /*!< in, own: trx object */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Frees a transaction object for MySQL. */
UNIV_INTERN
/*==================*/
trx_t* trx, /*!< in/out: transaction */
trx_dict_op_t op) /*!< in: dictionary operation type */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
#define trx_start_for_ddl(t, o) \
trx_commit(
/*=======*/
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/****************************************************************//**
Commits a transaction and a mini-transaction. */
UNIV_INTERN
trx_t* trx, /*!< in/out: transaction */
mtr_t* mtr) /*!< in/out: mini-transaction (will be committed),
or NULL if trx made no modifications */
- __attribute__((nonnull(1)));
+ MY_ATTRIBUTE((nonnull(1)));
/****************************************************************//**
Cleans up a transaction at database startup. The cleanup is needed if
the transaction already got to the middle of a commit when the database
trx_commit_complete_for_mysql(
/*==========================*/
trx_t* trx) /*!< in/out: transaction */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Marks the latest SQL statement ended. */
UNIV_INTERN
/*!< in: length of trx->lock.trx_locks */
ulint heap_size)
/*!< in: mem_heap_get_size(trx->lock.lock_heap) */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Prints info about a transaction.
const trx_t* trx, /*!< in: transaction */
ulint max_query_len) /*!< in: max query length to print,
or 0 to use the default max length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
+#ifdef WITH_WSREP
+/**********************************************************************//**
+Prints info about a transaction.
+Transaction information may be retrieved without having trx_sys->mutex acquired
+so it may not be completely accurate. The caller must own lock_sys->mutex
+and the trx must have some locks to make sure that it does not escape
+without locking lock_sys->mutex. */
+UNIV_INTERN
+void
+wsrep_trx_print_locking(
+/*==============*/
+ FILE* f, /*!< in: output stream */
+ const trx_t* trx, /*!< in: transaction */
+ ulint max_query_len) /*!< in: max query length to print,
+ or 0 to use the default max length */
+ MY_ATTRIBUTE((nonnull));
+#endif /* WITH_WSREP */
/**********************************************************************//**
Prints info about a transaction.
Acquires and releases lock_sys->mutex and trx_sys->mutex. */
const trx_t* trx, /*!< in: transaction */
ulint max_query_len) /*!< in: max query length to print,
or 0 to use the default max length */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
/**********************************************************************//**
Determine if a transaction is a dictionary operation.
trx_get_dict_operation(
/*===================*/
const trx_t* trx) /*!< in: transaction */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/**********************************************************************//**
Flag a transaction a dictionary operation. */
UNIV_INLINE
if state != TRX_STATE_NOT_STARTED
asserts that
trx->state != TRX_STATE_NOT_STARTED */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# ifdef UNIV_DEBUG
/**********************************************************************//**
Asserts that a transaction has been started.
trx_assert_started(
/*===============*/
const trx_t* trx) /*!< in: transaction */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
# endif /* UNIV_DEBUG */
/**********************************************************************//**
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
trx_undo_trx_id_is_insert(
/*======================*/
const byte* trx_id) /*!< in: DB_TRX_ID, followed by DB_ROLL_PTR */
- __attribute__((nonnull, pure, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, pure, warn_unused_result));
#endif /* !UNIV_HOTBACKUP */
/*****************************************************************//**
Writes a roll ptr to an index page. In case that the size changes in
mtr_t* mtr) /*!< in: mtr which does not have a latch to any
undo log page; the caller must have reserved
the rollback segment mutex */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/********************************************************************//**
Frees the last undo log page.
The caller must hold the rollback segment mutex. */
mtr_t* mtr) /*!< in/out: mini-transaction which does not
have a latch to any undo log page or which
has allocated the undo log page */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
# define trx_undo_free_last_page(trx,undo,mtr) \
trx_undo_free_last_page_func(trx,undo,mtr)
trx_undo_t* undo, /*!< in/out: undo log */
undo_no_t limit) /*!< in: all undo records with undo number
>= this value should be truncated */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifdef UNIV_DEBUG
# define trx_undo_truncate_end(trx,undo,limit) \
trx_undo_truncate_end_func(trx,undo,limit)
/*=================*/
trx_t* trx, /*!< in: transaction */
ulint type) /*!< in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
/******************************************************************//**
Sets the state of the undo log segment at a transaction finish.
@return undo log segment header page, x-latched */
trx_undo_free_prepared(
/*===================*/
trx_t* trx) /*!< in/out: PREPARED transaction */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
#endif /* !UNIV_HOTBACKUP */
/***********************************************************//**
Parses the redo log entry of an undo log page initialization.
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
GCC visibility directive on all Sun operating systems because there is no
easy way to get it to work. See http://bugs.mysql.com/bug.php?id=52263. */
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(sun) || defined(__INTEL_COMPILER)
-# define UNIV_INTERN __attribute__((visibility ("hidden")))
+# define UNIV_INTERN MY_ATTRIBUTE((visibility ("hidden")))
#else
# define UNIV_INTERN
#endif
program. The paths leading to call of cold functions within code are
marked as unlikely by the branch prediction mechanism. optimize a
rarely invoked function for size instead for speed. */
-# define UNIV_COLD __attribute__((cold))
+# define UNIV_COLD MY_ATTRIBUTE((cold))
#else
# define UNIV_COLD /* empty */
#endif
#if defined(__GNUC__) && (__GNUC__ > 2) && ! defined(__INTEL_COMPILER)
#define HAVE_GCC_GT_2
/* Tell the compiler that variable/function is unused. */
-# define UNIV_UNUSED __attribute__ ((unused))
+# define UNIV_UNUSED MY_ATTRIBUTE ((unused))
#else
# define UNIV_UNUSED
#endif /* CHECK FOR GCC VER_GT_2 */
/*****************************************************************************
-Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
/*==========*/
ulint high, /*!< in: high-order 32 bits */
ulint low) /*!< in: low-order 32 bits */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/********************************************************//**
Rounds a 64-bit integer downward to a multiple of a power of 2.
/*==========*/
const void* ptr, /*!< in: pointer */
ulint align_no) /*!< in: align by this number */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*********************************************************//**
The following function computes the offset of a pointer from the nearest
aligned address.
/*============*/
const void* ptr, /*!< in: pointer */
ulint align_no) /*!< in: align by this number */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*****************************************************************//**
Gets the nth bit of a ulint.
@return TRUE if nth bit is 1; 0th bit is defined to be the least significant */
/*****************************************************************************
-Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
const char* expr, /*!< in: the failed assertion */
const char* file, /*!< in: source file containing the assertion */
ulint line) /*!< in: line number of the assertion */
- UNIV_COLD __attribute__((nonnull(2)));
+ UNIV_COLD MY_ATTRIBUTE((nonnull(2)));
/** Abort the execution. */
# define UT_DBG_PANIC abort()
/*****************************************************************************
-Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ulint n, /*!< in: number of bytes to allocate */
ibool assert_on_error) /*!< in: if TRUE, we crash mysqld if
the memory cannot be allocated */
- __attribute__((malloc));
+ MY_ATTRIBUTE((malloc));
/**********************************************************************//**
Allocates memory. */
#define ut_malloc(n) ut_malloc_low(n, TRUE)
/*****************************************************************************
-Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ut_fold_ull(
/*========*/
ib_uint64_t d) /*!< in: 64-bit integer */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*************************************************************//**
Folds a character string ending in the null character.
@return folded value */
ut_fold_string(
/*===========*/
const char* str) /*!< in: null-terminated string */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
/***********************************************************//**
Looks for a prime number slightly greater than the given argument.
The prime is chosen so that it is not near any power of 2.
ut_find_prime(
/*==========*/
ulint n) /*!< in: positive number > 100 */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
#endif /* !UNIV_INNOCHECKSUM */
/*===============*/
ulint n1, /*!< in: ulint */
ulint n2) /*!< in: ulint */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/*************************************************************//**
Folds a binary string.
@return folded value */
/*===========*/
const byte* str, /*!< in: string of bytes */
ulint len) /*!< in: length */
- __attribute__((pure));
+ MY_ATTRIBUTE((pure));
#ifndef UNIV_NONINL
/*****************************************************************************
-Copyright (c) 1994, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
ut_2_power_up(
/*==========*/
ulint n) /*!< in: number != 0 */
- __attribute__((const));
+ MY_ATTRIBUTE((const));
/** Determine how many bytes (groups of 8 bits) are needed to
store the given number of bits.
ut_print_timestamp(
/*===============*/
FILE* file) /*!< in: file where to print */
- UNIV_COLD __attribute__((nonnull));
+ UNIV_COLD MY_ATTRIBUTE((nonnull));
#ifndef UNIV_INNOCHECKSUM
ulint* aux_arr, /*!< in/out: aux array to use in sort */
ulint low, /*!< in: lower bound */
ulint high) /*!< in: upper bound */
- __attribute__((nonnull));
+ MY_ATTRIBUTE((nonnull));
#ifndef UNIV_NONINL
#include "ut0ut.ic"
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
lock_rec_validate_page(
/*===================*/
const buf_block_t* block) /*!< in: buffer block */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/* The lock system */
#ifdef UNIV_DEBUG
UNIV_INTERN
#else
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
#endif
bool
lock_check_trx_id_sanity(
wsrep_kill_victim(const trx_t * const trx, const lock_t *lock) {
ut_ad(lock_mutex_own());
ut_ad(trx_mutex_own(lock->trx));
+
+ /* quit for native mysql */
+ if (!wsrep_on(trx->mysql_thd)) return;
+
my_bool bf_this = wsrep_thd_is_BF(trx->mysql_thd, FALSE);
my_bool bf_other = wsrep_thd_is_BF(lock->trx->mysql_thd, TRUE);
is in the queue*/
} else if (lock->trx != trx) {
if (wsrep_log_conflicts) {
- mutex_enter(&trx_sys->mutex);
if (bf_this)
fputs("\n*** Priority TRANSACTION:\n",
stderr);
else
fputs("\n*** Victim TRANSACTION:\n",
stderr);
- trx_print_latched(stderr, trx, 3000);
+ wsrep_trx_print_locking(stderr, trx, 3000);
if (bf_other)
fputs("\n*** Priority TRANSACTION:\n",
else
fputs("\n*** Victim TRANSACTION:\n",
stderr);
- trx_print_latched(stderr, lock->trx, 3000);
+ wsrep_trx_print_locking(stderr, lock->trx, 3000);
- mutex_exit(&trx_sys->mutex);
fputs("*** WAITING FOR THIS LOCK TO BE GRANTED:\n",
stderr);
#ifdef WITH_WSREP
if (lock_rec_has_to_wait(TRUE, trx, mode, lock, is_supremum)) {
- trx_mutex_enter(lock->trx);
- wsrep_kill_victim(trx, lock);
- trx_mutex_exit(lock->trx);
+ if (wsrep_on(trx->mysql_thd)) {
+ trx_mutex_enter(lock->trx);
+ wsrep_kill_victim(trx, lock);
+ trx_mutex_exit(lock->trx);
+ }
#else
if (lock_rec_has_to_wait(trx, mode, lock, is_supremum)) {
#endif /* WITH_WSREP */
#ifdef WITH_WSREP
- if (c_lock && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
+ if (c_lock &&
+ wsrep_on(trx->mysql_thd) &&
+ wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
lock_t *hash = (lock_t *)c_lock->hash;
lock_t *prev = NULL;
ut_ad(heap_no == ULINT_UNDEFINED);
ut_ad(lock_get_type_low(lock) == LOCK_TABLE);
- lock = UT_LIST_GET_PREV(un_member.tab_lock.locks, lock);
+ lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, lock);
}
} while (lock != NULL
&& lock->trx->lock.deadlock_mark > ctx->mark_start);
} else {
*heap_no = ULINT_UNDEFINED;
ut_ad(lock_get_type_low(lock) == LOCK_TABLE);
- lock = UT_LIST_GET_PREV(un_member.tab_lock.locks, lock);
+ dict_table_t* table = lock->un_member.tab_lock.table;
+ lock = UT_LIST_GET_FIRST(table->locks);
}
ut_a(lock != NULL);
UT_LIST_ADD_LAST(trx_locks, trx->lock.trx_locks, lock);
#ifdef WITH_WSREP
- if (c_lock && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
- UT_LIST_INSERT_AFTER(
- un_member.tab_lock.locks, table->locks, c_lock, lock);
- } else {
- UT_LIST_ADD_LAST(un_member.tab_lock.locks, table->locks, lock);
- }
+ if(wsrep_on(trx->mysql_thd)) {
+ if (c_lock && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) {
+ UT_LIST_INSERT_AFTER(
+ un_member.tab_lock.locks, table->locks, c_lock, lock);
+ } else {
+ UT_LIST_ADD_LAST(
+ un_member.tab_lock.locks, table->locks, lock);
+ }
- if (c_lock) trx_mutex_enter(c_lock->trx);
- if (c_lock && c_lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) {
+ if (c_lock) trx_mutex_enter(c_lock->trx);
+ if (c_lock && c_lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) {
- c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE;
+ c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE;
- if (wsrep_debug) wsrep_print_wait_locks(c_lock);
+ if (wsrep_debug) wsrep_print_wait_locks(c_lock);
- /* have to release trx mutex for the duration of
- victim lock release. This will eventually call
- lock_grant, which wants to grant trx mutex again
- */
- /* caller has trx_mutex, have to release for lock cancel */
- trx_mutex_exit(trx);
- lock_cancel_waiting_and_release(c_lock->trx->lock.wait_lock);
- trx_mutex_enter(trx);
+ /* have to release trx mutex for the duration of
+ victim lock release. This will eventually call
+ lock_grant, which wants to grant trx mutex again
+ */
+ /* caller has trx_mutex, have to release for lock cancel */
+ trx_mutex_exit(trx);
+ lock_cancel_waiting_and_release(
+ c_lock->trx->lock.wait_lock);
+ trx_mutex_enter(trx);
- /* trx might not wait for c_lock, but some other lock
- does not matter if wait_lock was released above
- */
- if (c_lock->trx->lock.wait_lock == c_lock) {
- lock_reset_lock_and_trx_wait(lock);
- }
+ /* trx might not wait for c_lock, but some other lock
+ does not matter if wait_lock was released above
+ */
+ if (c_lock->trx->lock.wait_lock == c_lock) {
+ lock_reset_lock_and_trx_wait(lock);
+ }
- if (wsrep_debug) {
- fprintf(stderr, "WSREP: c_lock canceled %llu\n",
- (ulonglong) c_lock->trx->id);
+ if (wsrep_debug) {
+ fprintf(stderr, "WSREP: c_lock canceled %llu\n",
+ (ulonglong) c_lock->trx->id);
+ }
}
- }
- if (c_lock) trx_mutex_exit(c_lock->trx);
-#else
+ if (c_lock) trx_mutex_exit(c_lock->trx);
+ } else {
+#endif /* WITH_WSREP */
UT_LIST_ADD_LAST(un_member.tab_lock.locks, table->locks, lock);
+#ifdef WITH_WSREP
+ }
#endif /* WITH_WSREP */
if (UNIV_UNLIKELY(type_mode & LOCK_WAIT)) {
&& (wait || !lock_get_wait(lock))) {
#ifdef WITH_WSREP
- if (wsrep_debug)
- fprintf(stderr, "WSREP: table lock abort");
- trx_mutex_enter(lock->trx);
- wsrep_kill_victim((trx_t *)trx, (lock_t *)lock);
- trx_mutex_exit(lock->trx);
+ if (wsrep_on(trx->mysql_thd)) {
+ if (wsrep_debug)
+ fprintf(stderr,
+ "WSREP: table lock abort");
+ trx_mutex_enter(lock->trx);
+ wsrep_kill_victim((trx_t *)trx, (lock_t *)lock);
+ trx_mutex_exit(lock->trx);
+ }
#endif
return(lock);
}
dberr_t err;
const lock_t* wait_for;
- ut_ad(table && thr);
+ ut_ad(table != NULL);
+ ut_ad(thr != NULL);
if (flags & BTR_NO_LOCKING_FLAG) {
/*********************************************************************//**
Validate record locks up to a limit.
@return lock at limit or NULL if no more locks in the hash bucket */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const lock_t*
lock_rec_validate(
/*==============*/
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
os_thread_ret_t
DECLARE_THREAD(lock_wait_timeout_thread)(
/*=====================================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/* in: a dummy parameter required by
os_thread_create */
{
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
ulint space_id, /*!< in: space id of the file space
which contains the log files of this
group */
- ulint archive_space_id __attribute__((unused)))
+ ulint archive_space_id MY_ATTRIBUTE((unused)))
/*!< in: space id of the file space
which contains some archived log
files for this group; currently, only
log_archived_file_name_gen(
/*=======================*/
char* buf, /*!< in: buffer where to write */
- ulint id __attribute__((unused)),
+ ulint id MY_ATTRIBUTE((unused)),
/*!< in: group id;
currently we only archive the first group */
ulint file_no)/*!< in: file number */
/*****************************************************************************
-Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2016, 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
os_thread_ret_t
DECLARE_THREAD(recv_writer_thread)(
/*===============================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
/********************************************************//**
Looks for the maximum consistent checkpoint from the log groups.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
recv_find_max_checkpoint(
/*=====================*/
/*****************************************************************************
-Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
if (flag < 0x80UL) {
*val = flag;
return(ptr + 1);
+ }
+
+ /* Workaround GCC bug
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77673:
+ the compiler moves mach_read_from_4 right to the beginning of the
+ function, causing and out-of-bounds read if we are reading a short
+ integer close to the end of buffer. */
+#if defined(__GNUC__) && (__GNUC__ >= 5) && !defined(__clang__)
+#define DEPLOY_FENCE
+#endif
+
+#ifdef DEPLOY_FENCE
+ __atomic_thread_fence(__ATOMIC_ACQUIRE);
+#endif
- } else if (flag < 0xC0UL) {
+ if (flag < 0xC0UL) {
if (end_ptr < ptr + 2) {
return(NULL);
}
*val = mach_read_from_2(ptr) & 0x7FFFUL;
return(ptr + 2);
+ }
+
+#ifdef DEPLOY_FENCE
+ __atomic_thread_fence(__ATOMIC_ACQUIRE);
+#endif
- } else if (flag < 0xE0UL) {
+ if (flag < 0xE0UL) {
if (end_ptr < ptr + 3) {
return(NULL);
}
*val = mach_read_from_3(ptr) & 0x3FFFFFUL;
return(ptr + 3);
- } else if (flag < 0xF0UL) {
+ }
+
+#ifdef DEPLOY_FENCE
+ __atomic_thread_fence(__ATOMIC_ACQUIRE);
+#endif
+
+ if (flag < 0xF0UL) {
if (end_ptr < ptr + 4) {
return(NULL);
}
*val = mach_read_from_4(ptr) & 0x1FFFFFFFUL;
return(ptr + 4);
- } else {
- ut_ad(flag == 0xF0UL);
+ }
- if (end_ptr < ptr + 5) {
- return(NULL);
- }
+#ifdef DEPLOY_FENCE
+ __atomic_thread_fence(__ATOMIC_ACQUIRE);
+#endif
+
+#undef DEPLOY_FENCE
+
+ ut_ad(flag == 0xF0UL);
- *val = mach_read_from_4(ptr + 1);
- return(ptr + 5);
+ if (end_ptr < ptr + 5) {
+ return(NULL);
}
+
+ *val = mach_read_from_4(ptr + 1);
+ return(ptr + 5);
}
/*****************************************************************************
-Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
mem_field_erase(
/*============*/
byte* buf, /*!< in: memory field */
- ulint n __attribute__((unused)))
+ ulint n MY_ATTRIBUTE((unused)))
/*!< in: how many bytes the user requested */
{
byte* usr_buf;
mem_heap_validate_or_print(
/*=======================*/
mem_heap_t* heap, /*!< in: memory heap */
- byte* top __attribute__((unused)),
+ byte* top MY_ATTRIBUTE((unused)),
/*!< in: calculate and validate only until
this top pointer in the heap is reached,
if this pointer is NULL, ignored */
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
/*****************************************************************//**
Releases the item in the slot given. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
mtr_memo_slot_release_func(
/*=======================*/
Releases the mlocks and other objects stored in an mtr memo.
They are released in the order opposite to which they were pushed
to the memo. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
mtr_memo_pop_all(
/*=============*/
/*===========*/
const byte* ptr, /*!< in: pointer from where to read */
ulint type, /*!< in: MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES */
- mtr_t* mtr __attribute__((unused)))
+ mtr_t* mtr MY_ATTRIBUTE((unused)))
/*!< in: mini-transaction handle */
{
ut_ad(mtr->state == MTR_ACTIVE);
/***********************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Percona Inc.
Portions of this file contain modifications contributed and copyrighted
os_file_set_nocache(
/*================*/
int fd /*!< in: file descriptor to alter */
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const char* file_name /*!< in: used in the diagnostic
message */
- __attribute__((unused)),
- const char* operation_name __attribute__((unused)))
+ MY_ATTRIBUTE((unused)),
+ const char* operation_name MY_ATTRIBUTE((unused)))
/*!< in: "open" or "create"; used
in the diagnostic message */
{
/*******************************************************************//**
Does a synchronous read operation in Posix.
@return number of bytes read, -1 if error */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ssize_t
os_file_pread(
/*==========*/
/*******************************************************************//**
Does a synchronous write operation in Posix.
@return number of bytes written, -1 if error */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ssize_t
os_file_pwrite(
/*===========*/
/*****************************************************************************
-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
#endif
}
+/** Waits until the specified thread completes and joins it.
+Its return value is ignored.
+@param[in,out] thread thread to join */
+UNIV_INTERN
+void
+os_thread_join(
+ os_thread_t thread)
+{
+#ifdef __WIN__
+ /* Do nothing. */
+#else
+#ifdef UNIV_DEBUG
+ const int ret =
+#endif /* UNIV_DEBUG */
+ pthread_join(thread, NULL);
+
+ /* Waiting on already-quit threads is allowed. */
+ ut_ad(ret == 0 || ret == ESRCH);
+#endif /* __WIN__ */
+}
+
/*****************************************************************//**
Exits the current thread. */
UNIV_INTERN
void
os_thread_exit(
/*===========*/
- void* exit_value) /*!< in: exit value; in Windows this void*
+ void* exit_value, /*!< in: exit value; in Windows this void*
is cast as a DWORD */
+ bool detach) /*!< in: if true, the thread will be detached
+ right before exiting. If false, another thread
+ is responsible for joining this thread. */
{
#ifdef UNIV_DEBUG_THREAD_CREATION
fprintf(stderr, "Thread exits, id %lu\n",
#ifdef __WIN__
ExitThread((DWORD) exit_value);
#else
- pthread_detach(pthread_self());
+ if (detach) {
+ pthread_detach(pthread_self());
+ }
pthread_exit(exit_value);
#endif
}
/*****************************************************************************
-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 2016, 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
page_parse_create(
/*==============*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
ulint comp, /*!< in: nonzero=compact page format */
buf_block_t* block, /*!< in: block or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
/*****************************************************************************
-Copyright (c) 2005, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2005, 2016, 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
independently of any UNIV_ debugging conditions. */
#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
# include <stdarg.h>
-__attribute__((format (printf, 1, 2)))
+MY_ATTRIBUTE((format (printf, 1, 2)))
/**********************************************************************//**
Report a failure to decompress or compress.
@return number of characters printed */
void
page_zip_free(
/*==========*/
- void* opaque __attribute__((unused)), /*!< in: memory heap */
- void* address __attribute__((unused)))/*!< in: object to free */
+ void* opaque MY_ATTRIBUTE((unused)), /*!< in: memory heap */
+ void* address MY_ATTRIBUTE((unused)))/*!< in: object to free */
{
}
ulint size;
ulint trailer_size;
- ut_ad(ptr && end_ptr);
+ ut_ad(ptr != NULL);
+ ut_ad(end_ptr != NULL);
ut_ad(!page == !page_zip);
if (UNIV_UNLIKELY(ptr + (2 + 2) > end_ptr)) {
static int yy_did_buffer_switch_on_eof;
void yyrestart (FILE *input_file );
-__attribute__((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
static YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
void yy_delete_buffer (YY_BUFFER_STATE b );
void yy_flush_buffer (YY_BUFFER_STATE b );
#line 1 "pars0lex.l"
/*****************************************************************************
-Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-__attribute__((unused)) static int yylex_destroy (void );
+MY_ATTRIBUTE((unused)) static int yylex_destroy (void );
int yyget_debug (void );
* @param new_buffer The new input buffer.
*
*/
- __attribute__((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+ MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
/* TODO. We should be able to replace this entire function body
}
/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-__attribute__((unused)) static int yylex_destroy (void)
+MY_ATTRIBUTE((unused)) static int yylex_destroy (void)
{
/* Pop the buffer stack, destroying each element. */
#!/bin/bash
#
-# Copyright (c) 1994, 2011, Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 1994, 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
s/'"$TMPFILE"'/'"$OUTFILE"'/;
s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/;
s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/;
-s/\(void yy_switch_to_buffer\)/__attribute__((unused)) static \1/;
-s/\(void yy\(push\|pop\)_buffer_state\)/__attribute__((unused)) static \1/;
+s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/;
+s/\(void yy\(push\|pop\)_buffer_state\)/MY_ATTRIBUTE((unused)) static \1/;
s/\(YY_BUFFER_STATE yy_create_buffer\)/static \1/;
-s/\(\(int\|void\) yy[gs]et_\)/__attribute__((unused)) static \1/;
+s/\(\(int\|void\) yy[gs]et_\)/MY_ATTRIBUTE((unused)) static \1/;
s/\(void \*\?yy\(\(re\)\?alloc\|free\)\)/static \1/;
s/\(extern \)\?\(int yy\(leng\|lineno\|_flex_debug\)\)/static \2/;
-s/\(int yylex_destroy\)/__attribute__((unused)) static \1/;
+s/\(int yylex_destroy\)/MY_ATTRIBUTE((unused)) static \1/;
s/\(extern \)\?\(int yylex \)/UNIV_INTERN \2/;
-s/^\(\(FILE\|char\) *\* *yyget\)/__attribute__((unused)) static \1/;
+s/^\(\(FILE\|char\) *\* *yyget\)/MY_ATTRIBUTE((unused)) static \1/;
s/^\(extern \)\?\(\(FILE\|char\) *\* *yy\)/static \2/;
' < $TMPFILE >> $OUTFILE
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
sym_node_t* column_defs, /*!< in: list of column names */
sym_node_t* compact, /* in: non-NULL if COMPACT table. */
sym_node_t* block_size, /* in: block size (can be NULL) */
- void* not_fit_in_memory __attribute__((unused)))
+ void* not_fit_in_memory MY_ATTRIBUTE((unused)))
/*!< in: a non-NULL pointer means that
this is a table which in simulations
should be simulated as not fitting
que_fork_t*
pars_stored_procedure_call(
/*=======================*/
- sym_node_t* sym_node __attribute__((unused)))
+ sym_node_t* sym_node MY_ATTRIBUTE((unused)))
/*!< in: stored procedure name */
{
ut_error;
void
yyerror(
/*====*/
- const char* s __attribute__((unused)))
+ const char* s MY_ATTRIBUTE((unused)))
/*!< in: error message string */
{
ut_ad(s);
/*****************************************************************************
-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
completely matched fields; when function
returns, contains the value for current
comparison */
- __attribute__((nonnull, warn_unused_result));
+ MY_ATTRIBUTE((nonnull, warn_unused_result));
#endif /* UNIV_DEBUG */
/*************************************************************//**
This function is used to compare two data fields for which the data type
in current field */
int ret; /* return value */
- ut_ad(dtuple && rec && matched_fields && matched_bytes);
+ ut_ad(dtuple != NULL);
+ ut_ad(rec != NULL);
+ ut_ad(matched_fields != NULL);
+ ut_ad(matched_bytes != NULL);
ut_ad(dtuple_check_typed(dtuple));
ut_ad(rec_offs_validate(rec, NULL, offsets));
@retval 1 if rec1 field is greater than rec2
@retval -1 if rec1 field is less than rec2
@retval 0 if rec1 field equals to rec2 */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
int
cmp_rec_rec_simple_field(
/*=====================*/
int ret = 0; /* return value */
ulint comp;
- ut_ad(rec1 && rec2 && index);
+ ut_ad(rec1 != NULL);
+ ut_ad(rec2 != NULL);
+ ut_ad(index != NULL);
ut_ad(rec_offs_validate(rec1, index, offsets1));
ut_ad(rec_offs_validate(rec2, index, offsets2));
ut_ad(rec_offs_comp(offsets1) == rec_offs_comp(offsets2));
int ret; /* return value */
ulint cur_field; /* current field number */
- ut_ad(dtuple && rec && matched_fields);
+ ut_ad(dtuple != NULL);
+ ut_ad(rec != NULL);
+ ut_ad(matched_fields != NULL);
ut_ad(dtuple_check_typed(dtuple));
ut_ad(rec_offs_validate(rec, NULL, offsets));
/*****************************************************************************
-Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1994, 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
Determine the offset to each field in a leaf-page record
in ROW_FORMAT=COMPACT. This is a special case of
rec_init_offsets() and rec_get_offsets_func(). */
-UNIV_INLINE __attribute__((nonnull))
+UNIV_INLINE MY_ATTRIBUTE((nonnull))
void
rec_init_offsets_comp_ordinary(
/*===========================*/
/**********************************************************//**
Determines the size of a data tuple prefix in ROW_FORMAT=COMPACT.
@return total size */
-UNIV_INLINE __attribute__((warn_unused_result, nonnull(1,2)))
+UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(1,2)))
ulint
rec_get_converted_size_comp_prefix_low(
/*===================================*/
/*********************************************************//**
Builds a ROW_FORMAT=COMPACT record out of a data tuple. */
-UNIV_INLINE __attribute__((nonnull))
+UNIV_INLINE MY_ATTRIBUTE((nonnull))
void
rec_convert_dtuple_to_rec_comp(
/*===========================*/
{
rec_t* rec;
- ut_ad(buf && index && dtuple);
+ ut_ad(buf != NULL);
+ ut_ad(index != NULL);
+ ut_ad(dtuple != NULL);
ut_ad(dtuple_validate(dtuple));
ut_ad(dtuple_check_typed(dtuple));
/*****************************************************************************
-Copyright (c) 2010, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
dfield_dup(field, buf->heap);
/* One variable length column, word with its lenght less than
- fts_max_token_size, add one extra size and one extra byte */
- cur_len += 2;
+ fts_max_token_size, add one extra size and one extra byte.
+
+ Since the max length for FTS token now is larger than 255,
+ so we will need to signify length byte itself, so only 1 to 128
+ bytes can be used for 1 bytes, larger than that 2 bytes. */
+ if (t_str.f_len < 128) {
+ /* Extra size is one byte. */
+ cur_len += 2;
+ } else {
+ /* Extra size is two bytes. */
+ cur_len += 3;
+ }
/* Reserve one byte for the end marker of row_merge_block_t. */
if (buf->total_size + data_size[idx] + cur_len
CloseHandle(psort_info->thread_hdl);
#endif /*__WIN__ */
- os_thread_exit(NULL);
+ os_thread_exit(NULL, false);
OS_THREAD_DUMMY_RETURN;
}
/********************************************************************//**
Insert processed FTS data to auxillary index tables.
@return DB_SUCCESS if insertion runs fine */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
row_merge_write_fts_word(
/*=====================*/
/*****************************************************************************
-Copyright (c) 2012, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
Clean up after import tablespace failure, this function will acquire
the dictionary latches on behalf of the transaction if the transaction
hasn't already acquired them. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_import_discard_changes(
/*=======================*/
/*****************************************************************//**
Clean up after import tablespace. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_cleanup(
/*===============*/
/*****************************************************************//**
Report error during tablespace import. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_error(
/*=============*/
Adjust the root page index node and leaf node segment headers, update
with the new space id. For all the table's secondary indexes.
@return error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_adjust_root_pages_of_secondary_indexes(
/*==============================================*/
/*****************************************************************//**
Ensure that dict_sys->row_id exceeds SELECT MAX(DB_ROW_ID).
@return error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_set_sys_max_row_id(
/*==========================*/
/*********************************************************************//**
Write the meta data (index user fields) config file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_cfg_read_index_fields(
/*=============================*/
Read the index names and root page numbers of the indexes and set the values.
Row format [root_page_no, len of str, str ... ]
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_index_data(
/*=======================*/
/*********************************************************************//**
Read the meta data (table columns) config file. Deserialise the contents of
dict_col_t structure, along with the column name. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_columns(
/*====================*/
/*****************************************************************//**
Read the contents of the <tablespace>.cfg file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_v1(
/*===============*/
/**
Read the contents of the <tablespace>.cfg file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_meta_data(
/*======================*/
/**
Read the contents of the <tablename>.cfg file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_import_read_cfg(
/*================*/
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
in the index. This situation can occur if the delete-marked record is
kept in the index for consistent reads.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_sec_index_entry_by_modify(
/*==============================*/
existing record in the index. This situation can occur if the delete marked
record is kept in the index for consistent reads.
@return DB_SUCCESS, DB_FAIL, or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_clust_index_entry_by_modify(
/*================================*/
Returns the number of ancestor UPDATE or DELETE nodes of a
cascaded update/delete node.
@return number of ancestors */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulint
row_ins_cascade_n_ancestors(
/*========================*/
can also be 0 if no foreign key fields changed; the returned value is
ULINT_UNDEFINED if the column type in the child table is too short to
fit the new value in the parent table: that means the update fails */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ulint
row_ins_cascade_calc_update_vec(
/*============================*/
and the constraint had an ON DELETE or ON UPDATE condition which was not
RESTRICT.
@return DB_SUCCESS, DB_LOCK_WAIT, or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_foreign_check_on_constraint(
/*================================*/
sets shared locks which lock either the success or the failure of
a constraint.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_check_foreign_constraints(
/*==============================*/
whether a uniqueness violation has occurred for the key value of the entry.
Set shared locks on possible duplicate records.
@return DB_SUCCESS, DB_DUPLICATE_KEY, or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_scan_sec_index_for_duplicate(
/*=================================*/
@retval DB_SUCCESS_LOCKED_REC when rec is an exact match of entry or
a newer version of entry (the entry should not be inserted)
@retval DB_DUPLICATE_KEY when entry is a duplicate of rec */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_duplicate_online(
/*=====================*/
@retval DB_SUCCESS_LOCKED_REC when rec is an exact match of entry or
a newer version of entry (the entry should not be inserted)
@retval DB_DUPLICATE_KEY when entry is a duplicate of rec */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_duplicate_error_in_clust_online(
/*====================================*/
record
@retval DB_SUCCESS_LOCKED_REC if an exact match of the record was found
in online table rebuild (flags & (BTR_KEEP_SYS_FLAG | BTR_NO_LOCKING_FLAG)) */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_duplicate_error_in_clust(
/*=============================*/
/***************************************************************//**
Starts a mini-transaction and checks if the index will be dropped.
@return true if the index is to be dropped */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_ins_sec_mtr_start_and_check_if_aborted(
/*=======================================*/
/***********************************************************//**
Sets the values of the dtuple fields in entry from the values of appropriate
columns in row. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_ins_index_entry_set_vals(
/*=========================*/
Inserts a single index entry to the table.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins_index_entry_step(
/*=====================*/
Inserts a row to a table.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_ins(
/*====*/
/*****************************************************************************
-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
/** Create the file or online log if it does not exist.
@param[in,out] log online rebuild log
@return file descriptor. */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
int
row_log_tmpfile(
row_log_t* log)
/** Allocate the memory for the log buffer.
@param[in,out] log_buf Buffer used for log operation
@return TRUE if success, false if not */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
bool
row_log_block_allocate(
row_log_buf_t& log_buf)
/******************************************************//**
Starts logging an operation to a table that is being rebuilt.
@return pointer to log, or NULL if no logging is necessary */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
byte*
row_log_table_open(
/*===============*/
/******************************************************//**
Stops logging an operation to a table that is being rebuilt. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_log_table_close_func(
/*=====================*/
&old_pk_extra_size);
ut_ad(old_pk_extra_size < 0x100);
- mrec_size = 4 + old_pk_size;
+ mrec_size = 6 + old_pk_size;
/* Log enough prefix of the BLOB unless both the
old and new table are in COMPACT or REDUNDANT format,
*b++ = static_cast<byte>(old_pk_extra_size);
/* Log the size of external prefix we saved */
- mach_write_to_2(b, ext_size);
- b += 2;
+ mach_write_to_4(b, ext_size);
+ b += 4;
rec_convert_dtuple_to_temp(
b + old_pk_extra_size, new_index,
/******************************************************//**
Logs an insert or update to a table that is being rebuilt. */
-static __attribute__((nonnull(1,2,3)))
+static MY_ATTRIBUTE((nonnull(1,2,3)))
void
row_log_table_low(
/*==============*/
/******************************************************//**
Converts a log record to a table row.
@return converted row, or NULL if the conversion fails */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const dtuple_t*
row_log_table_apply_convert_mrec(
/*=============================*/
/******************************************************//**
Replays an insert operation on a table that was rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_log_table_apply_insert_low(
/*===========================*/
/******************************************************//**
Replays an insert operation on a table that was rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_log_table_apply_insert(
/*=======================*/
/******************************************************//**
Deletes a record from a table that is being rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull(1, 2, 4, 5), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1, 2, 4, 5), warn_unused_result))
dberr_t
row_log_table_apply_delete_low(
/*===========================*/
/******************************************************//**
Replays a delete operation on a table that was rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull(1, 3, 4, 5, 6, 7), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1, 3, 4, 5, 6, 7), warn_unused_result))
dberr_t
row_log_table_apply_delete(
/*=======================*/
/******************************************************//**
Replays an update operation on a table that was rebuilt.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_log_table_apply_update(
/*=======================*/
Applies an operation to a table that was rebuilt.
@return NULL on failure (mrec corruption) or when out of data;
pointer to next record on success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const mrec_t*
row_log_table_apply_op(
/*===================*/
break;
case ROW_T_DELETE:
- /* 1 (extra_size) + 2 (ext_size) + at least 1 (payload) */
- if (mrec + 4 >= mrec_end) {
+ /* 1 (extra_size) + 4 (ext_size) + at least 1 (payload) */
+ if (mrec + 6 >= mrec_end) {
return(NULL);
}
extra_size = *mrec++;
- ext_size = mach_read_from_2(mrec);
- mrec += 2;
+ ext_size = mach_read_from_4(mrec);
+ mrec += 4;
ut_ad(mrec < mrec_end);
/* We assume extra_size < 0x100 for the PRIMARY KEY prefix.
/******************************************************//**
Applies operations to a table was rebuilt.
@return DB_SUCCESS, or error code on failure */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_log_table_apply_ops(
/*====================*/
/******************************************************//**
Applies an operation to a secondary index that was being created. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_log_apply_op_low(
/*=================*/
Applies an operation to a secondary index that was being created.
@return NULL on failure (mrec corruption) or when out of data;
pointer to next record on success */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
const mrec_t*
row_log_apply_op(
/*=============*/
/******************************************************//**
Applies operations to a secondary index that was being created.
@return DB_SUCCESS, or error code on failure */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
row_log_apply_ops(
/*==============*/
#ifdef UNIV_DEBUG
/******************************************************//**
Display a merge tuple. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_merge_tuple_print(
/*==================*/
/******************************************************//**
Encode an index record. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_merge_buf_encode(
/*=================*/
/******************************************************//**
Allocate a sort buffer.
@return own: sort buffer */
-static __attribute__((malloc, nonnull))
+static MY_ATTRIBUTE((malloc, nonnull))
row_merge_buf_t*
row_merge_buf_create_low(
/*=====================*/
/*************************************************************//**
Compare two tuples.
@return 1, 0, -1 if a is greater, equal, less, respectively, than b */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
int
row_merge_tuple_cmp(
/*================*/
/**********************************************************************//**
Merge sort the tuple buffer in main memory. */
-static __attribute__((nonnull(4,5)))
+static MY_ATTRIBUTE((nonnull(4,5)))
void
row_merge_tuple_sort(
/*=================*/
@param[in,out] tmpfd temporary file handle
@param[in] path path to create temporary file
@return file descriptor, or -1 on failure */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
int
row_merge_tmpfile_if_needed(
int* tmpfd,
@param[in] nrec number of records in the file
@param[in] path path to create temporary files
@return file descriptor, or -1 on failure */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
int
row_merge_file_create_if_needed(
merge_file_t* file,
@param[in,out] block file buffer
@param[in,out] tmpfd temporary file handle
return DB_SUCCESS or error */
-static __attribute__((nonnull(1,2,3,4,6,9,10,16), warn_unused_result))
+static MY_ATTRIBUTE((nonnull(1,2,3,4,6,9,10,16), warn_unused_result))
dberr_t
row_merge_read_clustered_index(
trx_t* trx,
/* Sync fts cache for other fts indexes to keep all
fts indexes consistent in sync_doc_id. */
err = fts_sync_table(const_cast<dict_table_t*>(new_table),
- false, true);
+ false, true, false);
if (err == DB_SUCCESS) {
fts_update_next_doc_id(
/*************************************************************//**
Merge two blocks of records on disk and write a bigger block.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_merge_blocks(
/*=============*/
/*************************************************************//**
Copy a block of index entries.
@return TRUE on success, FALSE on failure */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ibool
row_merge_blocks_copy(
/*==================*/
/*************************************************************//**
Merge disk files.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
dberr_t
row_merge(
/*======*/
/*************************************************************//**
Copy externally stored columns to the data tuple. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_merge_copy_blobs(
/*=================*/
Read sorted file containing index data tuples and insert these data
tuples to the index
@return DB_SUCCESS or error number */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_merge_insert_index_tuples(
/*==========================*/
/*********************************************************************//**
Create and execute a query graph for creating an index.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_merge_create_index_graph(
/*=========================*/
" exited when creating FTS"
" index '%s'",
indexes[i]->name);
+ } else {
+ for (j = 0; j < FTS_NUM_AUX_INDEX;
+ j++) {
+
+ os_thread_join(merge_info[j]
+ .thread_hdl);
+ }
}
} else {
/* This cannot report duplicates; an
/*****************************************************************************
-Copyright (c) 2000, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
row_ins_step(thr);
+ DEBUG_SYNC_C("ib_after_row_insert_step");
+
err = trx->error_state;
if (err != DB_SUCCESS) {
}
/* Difference between Doc IDs are restricted within
- 4 bytes integer. See fts_get_encoded_len() */
+ 4 bytes integer. See fts_get_encoded_len(). Consecutive
+ doc_ids difference should not exceed
+ FTS_DOC_ID_MAX_STEP value. */
- if (doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) {
+ if (next_doc_id > 1
+ && doc_id - next_doc_id >= FTS_DOC_ID_MAX_STEP) {
fprintf(stderr,
"InnoDB: Doc ID " UINT64PF " is too"
" big. Its difference with largest"
trx_t* trx = prebuilt->trx;
ulint fk_depth = 0;
- ut_ad(prebuilt && trx);
+ ut_ad(prebuilt != NULL);
+ ut_ad(trx != NULL);
UT_NOT_USED(mysql_rec);
if (prebuilt->table->ibd_file_missing) {
btr_pcur_t* clust_pcur = &prebuilt->clust_pcur;
trx_t* trx = prebuilt->trx;
- ut_ad(prebuilt && trx);
+ ut_ad(prebuilt != NULL);
+ ut_ad(trx != NULL);
if (UNIV_UNLIKELY
(!srv_locks_unsafe_for_binlog
return(n_tables + n_tables_dropped);
}
+ DBUG_EXECUTE_IF("row_drop_tables_in_background_sleep",
+ os_thread_sleep(5000000);
+ );
+
table = dict_table_open_on_name(drop->table_name, FALSE, FALSE,
DICT_ERR_IGNORE_NONE);
goto already_dropped;
}
+ if (!table->to_be_dropped) {
+ /* There is a scenario: the old table is dropped
+ just after it's added into drop list, and new
+ table with the same name is created, then we try
+ to drop the new table in background. */
+ dict_table_close(table, FALSE, FALSE);
+
+ goto already_dropped;
+ }
+
ut_a(!table->can_be_evicted);
dict_table_close(table, FALSE, FALSE);
}
}
+
+ DBUG_EXECUTE_IF("row_drop_table_add_to_background",
+ row_add_table_to_background_drop_list(table->name);
+ err = DB_SUCCESS;
+ goto funct_exit;
+ );
+
/* TODO: could we replace the counter n_foreign_key_checks_running
with lock checks on the table? Acquire here an exclusive lock on the
table, and rewrite lock0lock.cc and the lock wait in srv0srv.cc so that
Drop all foreign keys in a database, see Bug#18942.
Called at the end of row_drop_database_for_mysql().
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
drop_all_foreign_keys_in_db(
/*========================*/
row_mysql_lock_data_dictionary(trx);
while ((table_name = dict_get_first_table_name_in_db(name))) {
+ /* Drop parent table if it is a fts aux table, to
+ avoid accessing dropped fts aux tables in information
+ scheam when parent table still exists.
+ Note: Drop parent table will drop fts aux tables. */
+ char* parent_table_name;
+ parent_table_name = fts_get_parent_table_name(
+ table_name, strlen(table_name));
+
+ if (parent_table_name != NULL) {
+ mem_free(table_name);
+ table_name = parent_table_name;
+ }
+
ut_a(memcmp(table_name, name, namelen) == 0);
table = dict_table_open_on_name(
Checks if a table name contains the string "/#sql" which denotes temporary
tables in MySQL.
@return true if temporary table */
-UNIV_INTERN __attribute__((warn_unused_result))
+UNIV_INTERN MY_ATTRIBUTE((warn_unused_result))
bool
row_is_mysql_tmp_table_name(
/*========================*/
/****************************************************************//**
Delete a single constraint.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_delete_constraint_low(
/*======================*/
/****************************************************************//**
Delete a single constraint.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_delete_constraint(
/*==================*/
/*****************************************************************************
-Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
{
purge_node_t* node;
- ut_ad(parent && heap);
+ ut_ad(parent != NULL);
+ ut_ad(heap != NULL);
node = static_cast<purge_node_t*>(
mem_heap_zalloc(heap, sizeof(*node)));
Removes a delete marked clustered index record if possible.
@retval true if the row was not found, or it was successfully removed
@retval false if the row was modified after the delete marking */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_remove_clust_if_poss_low(
/*===============================*/
@retval true if the row was not found, or it was successfully removed
@retval false the purge needs to be suspended because of running out
of file space. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_remove_clust_if_poss(
/*===========================*/
Removes a secondary index entry if possible, by modifying the
index tree. Does not try to buffer the delete.
@return TRUE if success or if not found */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
ibool
row_purge_remove_sec_if_poss_tree(
/*==============================*/
if possible.
@retval true if success or if not found
@retval false if row_purge_remove_sec_if_poss_tree() should be invoked */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_remove_sec_if_poss_leaf(
/*==============================*/
/***********************************************************//**
Removes a secondary index entry if possible. */
-UNIV_INLINE __attribute__((nonnull(1,2)))
+UNIV_INLINE MY_ATTRIBUTE((nonnull(1,2)))
void
row_purge_remove_sec_if_poss(
/*=========================*/
@retval true if the row was not found, or it was successfully removed
@retval false the purge needs to be suspended because of
running out of file space */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_del_mark(
/*===============*/
ulint info_bits;
ulint type;
- ut_ad(node && thr);
+ ut_ad(node != NULL);
+ ut_ad(thr != NULL);
ptr = trx_undo_rec_get_pars(
undo_rec, &type, &node->cmpl_info,
/***********************************************************//**
Purges the parsed record.
@return true if purged, false if skipped */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
row_purge_record_func(
/*==================*/
Fetches an undo log record and does the purge for the recorded operation.
If none left, or the current purge completed, returns the control to the
parent node, which is always a query thread node. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_purge(
/*======*/
/*****************************************************************************
-Copyright (c) 2012, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2012, 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
/*********************************************************************//**
Write the meta data (index user fields) config file.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_index_fields(
/*===========================*/
/*********************************************************************//**
Write the meta data config file index information.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_indexes(
/*======================*/
dict_col_t structure, along with the column name. All fields are serialized
as ib_uint32_t.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_table(
/*====================*/
/*********************************************************************//**
Write the meta data config file header.
@return DB_SUCCESS or error code. */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_header(
/*=====================*/
/*********************************************************************//**
Write the table meta data after quiesce.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_quiesce_write_cfg(
/*==================*/
trx_purge_stop();
}
- ut_a(table->id > 0);
-
for (ulint count = 0;
- ibuf_contract_in_background(table->id, TRUE) != 0
+ ibuf_merge_space(table->space) != 0
&& !trx_is_interrupted(trx);
++count) {
if (!(count % 20)) {
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
ulint offsets_[REC_OFFS_NORMAL_SIZE];
rec_offs_init(offsets_);
- ut_ad(index && rec && heap);
+ ut_ad(index != NULL);
+ ut_ad(rec != NULL);
+ ut_ad(heap != NULL);
ut_ad(dict_index_is_clust(index));
ut_ad(!mutex_own(&trx_sys->mutex));
ut_ad(!col_map || col_table);
ulint len;
ulint rec_len;
- ut_ad(rec && heap && index);
+ ut_ad(rec != NULL);
+ ut_ad(heap != NULL);
+ ut_ad(index != NULL);
/* Because this function may be invoked by row0merge.cc
on a record whose header is in different format, the check
rec_offs_validate(rec, index, offsets) must be avoided here. */
byte* buf;
const rec_t* copy_rec;
- ut_ad(rec && heap && index);
+ ut_ad(rec != NULL);
+ ut_ad(heap != NULL);
+ ut_ad(index != NULL);
ut_ad(rec_offs_validate(rec, index, offsets));
/* Take a copy of rec to heap */
ulint* offsets = offsets_;
rec_offs_init(offsets_);
- ut_ad(index && rec && heap);
+ ut_ad(index != NULL);
+ ut_ad(rec != NULL);
+ ut_ad(heap != NULL);
ut_ad(!dict_index_is_clust(index));
offsets = rec_get_offsets(rec, index, offsets,
/*****************************************************************************
-Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
/*********************************************************************//**
Builds a previous version of a clustered index record for a consistent read
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel_build_prev_vers(
/*====================*/
/*********************************************************************//**
Builds the last committed version of a clustered index record for a
semi-consistent read. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_sel_build_committed_vers_for_mysql(
/*===================================*/
Retrieves the clustered index record corresponding to a record in a
non-clustered index. Does the necessary locking.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel_get_clust_rec(
/*==================*/
/*********************************************************************//**
Performs a select step.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel(
/*====*/
/**************************************************************//**
Stores a non-SQL-NULL field in the MySQL format. The counterpart of this
function is row_mysql_store_col_in_innobase_format() in row0mysql.cc. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_sel_field_store_in_mysql_format_func(
/*=====================================*/
#endif /* UNIV_DEBUG */
/**************************************************************//**
Convert a field in the Innobase format to a field in the MySQL format. */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
ibool
row_sel_store_mysql_field_func(
/*===========================*/
columns to mysql_rec, other columns are left blank. All columns may not
be needed in the query.
@return TRUE on success, FALSE if not all columns could be retrieved */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
ibool
row_sel_store_mysql_rec(
/*====================*/
/*********************************************************************//**
Builds a previous version of a clustered index record for a consistent read
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel_build_prev_vers_for_mysql(
/*==============================*/
non-clustered index. Does the necessary locking. Used in the MySQL
interface.
@return DB_SUCCESS, DB_SUCCESS_LOCKED_REC, or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_sel_get_clust_rec_for_mysql(
/*============================*/
/*****************************************************************************
-Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
Removes a clustered index record. The pcur in node was positioned on the
record, now it is detached.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_ins_remove_clust_rec(
/*==========================*/
/***************************************************************//**
Removes a secondary index entry if found.
@return DB_SUCCESS, DB_FAIL, or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_ins_remove_sec_low(
/*========================*/
Removes a secondary index entry from the index if found. Tries first
optimistic, then pessimistic descent down the tree.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_ins_remove_sec(
/*====================*/
/***************************************************************//**
Removes secondary index records.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_ins_remove_sec_rec(
/*========================*/
/*****************************************************************************
-Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
/***********************************************************//**
Undoes a modify in a clustered index record.
@return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_clust_low(
/*===================*/
delete-marked record and there no longer exist transactions
that would see the delete-marked record.
@return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_remove_clust_low(
/*==========================*/
Undoes a modify in a clustered index record. Sets also the node state for the
next round of undo.
@return DB_SUCCESS or error code: we may run out of file space */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_clust(
/*===============*/
/***********************************************************//**
Delete marks or removes a secondary index entry if found.
@return DB_SUCCESS, DB_FAIL, or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_del_mark_or_remove_sec_low(
/*====================================*/
clustered index record or an earlier version of it, if the secondary index
record through which we do the search is delete-marked.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_del_mark_or_remove_sec(
/*================================*/
@retval DB_OUT_OF_FILE_SPACE when running out of tablespace
@retval DB_DUPLICATE_KEY if the value was missing
and an insert would lead to a duplicate exists */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_del_unmark_sec_and_undo_update(
/*========================================*/
/***********************************************************//**
Flags a secondary index corrupted. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_undo_mod_sec_flag_corrupted(
/*============================*/
/***********************************************************//**
Undoes a modify in secondary indexes when undo record type is UPD_DEL.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_upd_del_sec(
/*=====================*/
/***********************************************************//**
Undoes a modify in secondary indexes when undo record type is DEL_MARK.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_del_mark_sec(
/*======================*/
/***********************************************************//**
Undoes a modify in secondary indexes when undo record type is UPD_EXIST.
@return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo_mod_upd_exist_sec(
/*=======================*/
/***********************************************************//**
Parses the row reference and other info in a modify undo log record. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
row_undo_mod_parse_undo_rec(
/*========================*/
dberr_t err;
ibool dict_locked;
- ut_ad(node && thr);
+ ut_ad(node != NULL);
+ ut_ad(thr != NULL);
ut_ad(node->state == UNDO_NODE_MODIFY);
dict_locked = thr_get_trx(thr)->dict_operation_lock_mode == RW_X_LATCH;
/*****************************************************************************
-Copyright (c) 1997, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 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
If none left, or a partial rollback completed, returns control to the
parent node, which is always a query thread node.
@return DB_SUCCESS if operation successfully completed, else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_undo(
/*=====*/
roll_ptr_t roll_ptr;
ibool locked_data_dict;
- ut_ad(node && thr);
+ ut_ad(node != NULL);
+ ut_ad(thr != NULL);
trx = node->trx;
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
pcur position!
@return DB_SUCCESS or an error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_check_references_constraints(
/*=================================*/
dict_table_open_on_name(
foreign->referenced_table_name_lookup,
FALSE, FALSE, DICT_ERR_IGNORE_NONE);
- opened = TRUE;
+ opened = (foreign->referenced_table) ? TRUE : FALSE;
}
if (foreign->referenced_table) {
->n_foreign_key_checks_running);
if (opened == TRUE) {
- dict_table_close(foreign->referenced_table, TRUE, FALSE);
+ dict_table_close(foreign->referenced_table, FALSE, FALSE);
opened = FALSE;
}
}
roll_ptr_t roll_ptr,/*!< in: roll ptr of the undo log record */
byte* log_ptr,/*!< pointer to a buffer of size > 20 opened
in mlog */
- mtr_t* mtr __attribute__((unused))) /*!< in: mtr */
+ mtr_t* mtr MY_ATTRIBUTE((unused))) /*!< in: mtr */
{
ut_ad(dict_index_is_clust(index));
ut_ad(mtr);
Updates a secondary index entry of a row.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_sec_index_entry(
/*====================*/
deletes it if this is a delete.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_sec_step(
/*=============*/
freed in a rollback. A limited version of this function used to be
called btr_cur_mark_dtuple_inherited_extern().
@return TRUE if any columns were inherited */
-static __attribute__((warn_unused_result))
+static MY_ATTRIBUTE((warn_unused_result))
ibool
row_upd_clust_rec_by_insert_inherit_func(
/*=====================================*/
database applications.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_clust_rec_by_insert(
/*========================*/
not change.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_clust_rec(
/*==============*/
/***********************************************************//**
Delete marks a clustered index record.
@return DB_SUCCESS if operation successfully completed, else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_del_mark_clust_rec(
/*=======================*/
Updates the clustered index record.
@return DB_SUCCESS if operation successfully completed, DB_LOCK_WAIT
in case of a lock wait, else error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd_clust_step(
/*===============*/
record, and the position of the cursor is stored in the cursor.
@return DB_SUCCESS if operation successfully completed, else error
code or DB_LOCK_WAIT */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
row_upd(
/*====*/
{
dberr_t err = DB_SUCCESS;
- ut_ad(node && thr);
+ ut_ad(node != NULL);
+ ut_ad(thr != NULL);
if (UNIV_LIKELY(node->in_mysql_interface)) {
/*****************************************************************************
-Copyright (c) 2010, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2010, 2016, 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
module */
set_current_module = FALSE;
} else if (module_id == MONITOR_ALL_COUNTER) {
- continue;
+ if (!(innodb_counter_info[ix].monitor_type
+ & MONITOR_GROUP_MODULE)) {
+ continue;
+ }
} else {
/* Hitting the next module, stop */
break;
table/index are not found in the innodb database */
UNIV_INTERN unsigned long long srv_stats_transient_sample_pages = 8;
UNIV_INTERN my_bool srv_stats_persistent = TRUE;
+UNIV_INTERN my_bool srv_stats_include_delete_marked = FALSE;
UNIV_INTERN unsigned long long srv_stats_persistent_sample_pages = 20;
UNIV_INTERN my_bool srv_stats_auto_recalc = TRUE;
os_thread_ret_t
DECLARE_THREAD(srv_monitor_thread)(
/*===============================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
os_thread_ret_t
DECLARE_THREAD(srv_error_monitor_thread)(
/*=====================================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
/* Do an ibuf merge */
srv_main_thread_op_info = "doing insert buffer merge";
counter_time = ut_time_us(NULL);
- ibuf_contract_in_background(0, FALSE);
+ ibuf_merge_in_background(false);
MONITOR_INC_TIME_IN_MICRO_SECS(
MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time);
/* Do an ibuf merge */
counter_time = ut_time_us(NULL);
srv_main_thread_op_info = "doing insert buffer merge";
- ibuf_contract_in_background(0, TRUE);
+ ibuf_merge_in_background(true);
MONITOR_INC_TIME_IN_MICRO_SECS(
MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time);
/* Do an ibuf merge */
srv_main_thread_op_info = "doing insert buffer merge";
- n_bytes_merged = ibuf_contract_in_background(0, TRUE);
+ n_bytes_merged = ibuf_merge_in_background(true);
/* Flush logs if needed */
srv_sync_log_buffer_in_background();
os_thread_ret_t
DECLARE_THREAD(srv_master_thread)(
/*==============================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
os_thread_ret_t
DECLARE_THREAD(srv_worker_thread)(
/*==============================*/
- void* arg __attribute__((unused))) /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
srv_slot_t* slot;
os_thread_ret_t
DECLARE_THREAD(srv_purge_coordinator_thread)(
/*=========================================*/
- void* arg __attribute__((unused))) /*!< in: a dummy parameter
+ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
required by os_thread_create */
{
srv_slot_t* slot;
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2009, Percona Inc.
void
srv_normalize_path_for_win(
/*=======================*/
- char* str __attribute__((unused))) /*!< in/out: null-terminated
+ char* str MY_ATTRIBUTE((unused))) /*!< in/out: null-terminated
character string */
{
#ifdef __WIN__
/*********************************************************************//**
Creates a log file.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
create_log_file(
/*============*/
/*********************************************************************//**
Opens a log file.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
open_log_file(
/*==========*/
/*********************************************************************//**
Creates or opens database data files and closes them.
@return DB_SUCCESS or error code */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
open_or_create_data_files(
/*======================*/
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Portions of this file contain modifications contributed and copyrighted by
mutex_enter_nowait_func(
/*====================*/
ib_mutex_t* mutex, /*!< in: pointer to mutex */
- const char* file_name __attribute__((unused)),
+ const char* file_name MY_ATTRIBUTE((unused)),
/*!< in: file name where mutex
requested */
- ulint line __attribute__((unused)))
+ ulint line MY_ATTRIBUTE((unused)))
/*!< in: line where requested */
{
ut_ad(mutex_validate(mutex));
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
released with the corresponding release function.
@return copy of an undo log record or pointer to trx_purge_dummy_rec,
if the whole undo log can skipped in purge; NULL if none left */
-static __attribute__((warn_unused_result, nonnull))
+static MY_ATTRIBUTE((warn_unused_result, nonnull))
trx_undo_rec_t*
trx_purge_fetch_next_rec(
/*=====================*/
/*****************************************************************************
-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/***********************************************************************//**
Erases the unused undo log page end.
@return TRUE if the page contained something, FALSE if it was empty */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
ibool
trx_undo_erase_page_end(
/*====================*/
trx_undo_parse_erase_page_end(
/*==========================*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
{
@retval true if the undo log has been
truncated and we cannot fetch the old version
@retval false if the undo log record is available */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
bool
trx_undo_get_undo_rec(
/*==================*/
#ifdef UNIV_DEBUG
#define ATTRIB_USED_ONLY_IN_DEBUG
#else /* UNIV_DEBUG */
-#define ATTRIB_USED_ONLY_IN_DEBUG __attribute__((unused))
+#define ATTRIB_USED_ONLY_IN_DEBUG MY_ATTRIBUTE((unused))
#endif /* UNIV_DEBUG */
/*******************************************************************//**
/*****************************************************************************
-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
were set after this savepoint are deleted.
@return if no savepoint of the name found then DB_NO_SAVEPOINT,
otherwise DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
trx_rollback_to_savepoint_for_mysql_low(
/*====================================*/
os_thread_ret_t
DECLARE_THREAD(trx_rollback_or_clean_all_recovered)(
/*================================================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
/*****************************************************************************
-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
/****************************************************************//**
Assign the transaction its history serialisation number and write the
update UNDO log record to the assigned rollback segment. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_write_serialisation_history(
/*============================*/
/********************************************************************
Finalize a transaction containing updates for a FTS table. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_finalize_for_fts_table(
/*=======================*/
/******************************************************************//**
Finalize a transaction containing updates to FTS tables. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_finalize_for_fts(
/*=================*/
/**********************************************************************//**
If required, flushes the log to disk based on the value of
innodb_flush_log_at_trx_commit. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_flush_log_if_needed(
/*====================*/
/****************************************************************//**
Commits a transaction in memory. */
-static __attribute__((nonnull))
+static MY_ATTRIBUTE((nonnull))
void
trx_commit_in_memory(
/*=================*/
mem_heap_get_size(trx->lock.lock_heap));
}
+#ifdef WITH_WSREP
+/**********************************************************************//**
+Prints info about a transaction.
+Transaction information may be retrieved without having trx_sys->mutex acquired
+so it may not be completely accurate. The caller must own lock_sys->mutex
+and the trx must have some locks to make sure that it does not escape
+without locking lock_sys->mutex. */
+UNIV_INTERN
+void
+wsrep_trx_print_locking(
+/*==========*/
+ FILE* f,
+ /*!< in: output stream */
+ const trx_t* trx,
+ /*!< in: transaction */
+ ulint max_query_len)
+ /*!< in: max query length to print,
+ or 0 to use the default max length */
+{
+ ibool newline;
+ const char* op_info;
+
+ ut_ad(lock_mutex_own());
+ ut_ad(trx->lock.trx_locks.count > 0);
+
+ fprintf(f, "TRANSACTION " TRX_ID_FMT, trx->id);
+
+ /* trx->state may change since trx_sys->mutex is not required */
+ switch (trx->state) {
+ case TRX_STATE_NOT_STARTED:
+ fputs(", not started", f);
+ goto state_ok;
+ case TRX_STATE_ACTIVE:
+ fprintf(f, ", ACTIVE %lu sec",
+ (ulong) difftime(time(NULL), trx->start_time));
+ goto state_ok;
+ case TRX_STATE_PREPARED:
+ fprintf(f, ", ACTIVE (PREPARED) %lu sec",
+ (ulong) difftime(time(NULL), trx->start_time));
+ goto state_ok;
+ case TRX_STATE_COMMITTED_IN_MEMORY:
+ fputs(", COMMITTED IN MEMORY", f);
+ goto state_ok;
+ }
+ fprintf(f, ", state %lu", (ulong) trx->state);
+ ut_ad(0);
+state_ok:
+
+ /* prevent a race condition */
+ op_info = trx->op_info;
+
+ if (*op_info) {
+ putc(' ', f);
+ fputs(op_info, f);
+ }
+
+ if (trx->is_recovered) {
+ fputs(" recovered trx", f);
+ }
+
+ if (trx->declared_to_be_inside_innodb) {
+ fprintf(f, ", thread declared inside InnoDB %lu",
+ (ulong) trx->n_tickets_to_enter_innodb);
+ }
+
+ putc('\n', f);
+
+ if (trx->n_mysql_tables_in_use > 0 || trx->mysql_n_tables_locked > 0) {
+ fprintf(f, "mysql tables in use %lu, locked %lu\n",
+ (ulong) trx->n_mysql_tables_in_use,
+ (ulong) trx->mysql_n_tables_locked);
+ }
+
+ newline = TRUE;
+
+ /* trx->lock.que_state of an ACTIVE transaction may change
+ while we are not holding trx->mutex. We perform a dirty read
+ for performance reasons. */
+
+ switch (trx->lock.que_state) {
+ case TRX_QUE_RUNNING:
+ newline = FALSE; break;
+ case TRX_QUE_LOCK_WAIT:
+ fputs("LOCK WAIT ", f); break;
+ case TRX_QUE_ROLLING_BACK:
+ fputs("ROLLING BACK ", f); break;
+ case TRX_QUE_COMMITTING:
+ fputs("COMMITTING ", f); break;
+ default:
+ fprintf(f, "que state %lu ", (ulong) trx->lock.que_state);
+ }
+
+ if (trx->has_search_latch) {
+ newline = TRUE;
+ fputs(", holds adaptive hash latch", f);
+ }
+
+ if (trx->undo_no != 0) {
+ newline = TRUE;
+ fprintf(f, ", undo log entries " TRX_ID_FMT, trx->undo_no);
+ }
+
+ if (newline) {
+ putc('\n', f);
+ }
+
+ if (trx->mysql_thd != NULL) {
+ innobase_mysql_print_thd(
+ f, trx->mysql_thd, static_cast<uint>(max_query_len));
+ }
+}
+#endif /* WITH_WSREP */
/**********************************************************************//**
Prints info about a transaction.
Acquires and releases lock_sys->mutex and trx_sys->mutex. */
@return trx on match, the trx->xid will be invalidated;
note that the trx may have been committed, unless the caller is
holding lock_sys->mutex */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
trx_t*
trx_get_trx_by_xid_low(
/*===================*/
/*****************************************************************************
-Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 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
Creates a new undo log segment in file.
@return DB_SUCCESS if page creation OK possible error codes are:
DB_TOO_MANY_CONCURRENT_TRXS DB_OUT_OF_FILE_SPACE */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
trx_undo_seg_create(
/*================*/
- trx_rseg_t* rseg __attribute__((unused)),/*!< in: rollback segment */
+ trx_rseg_t* rseg MY_ATTRIBUTE((unused)),/*!< in: rollback segment */
trx_rsegf_t* rseg_hdr,/*!< in: rollback segment header, page
x-latched */
ulint type, /*!< in: type of the segment: TRX_UNDO_INSERT or
ibool success;
dberr_t err = DB_SUCCESS;
- ut_ad(mtr && id && rseg_hdr);
+ ut_ad(mtr != NULL);
+ ut_ad(id != NULL);
+ ut_ad(rseg_hdr != NULL);
ut_ad(mutex_own(&(rseg->mutex)));
/* fputs(type == TRX_UNDO_INSERT
trx_undo_parse_discard_latest(
/*==========================*/
byte* ptr, /*!< in: buffer */
- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
+ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
{
@return DB_SUCCESS if successful in creating the new undo lob object,
possible error codes are: DB_TOO_MANY_CONCURRENT_TRXS
DB_OUT_OF_FILE_SPACE DB_OUT_OF_MEMORY */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
trx_undo_create(
/*============*/
}
-static int _ftb_no_dupes_cmp(const void* not_used __attribute__((unused)),
+static int _ftb_no_dupes_cmp(const void* not_used MY_ATTRIBUTE((unused)),
const void *a,const void *b)
{
return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b)));
static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param,
char *word, int word_len,
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info MY_ATTRIBUTE((unused)))
{
MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam;
FT_WORD *w= (FT_WORD *)phrase_param->document->data;
static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param,
char *word, int len,
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info MY_ATTRIBUTE((unused)))
{
MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam;
FT_INFO *ftb= ftb_param->ftb;
-/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
double tmp_weight;
} FT_SUPERDOC;
-static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)),
+static int FT_SUPERDOC_cmp(void* cmp_arg MY_ATTRIBUTE((unused)),
FT_SUPERDOC *p1, FT_SUPERDOC *p2)
{
if (p1->doc.dpos < p2->doc.dpos)
static int walk_and_copy(FT_SUPERDOC *from,
- uint32 count __attribute__((unused)), FT_DOC **to)
+ uint32 count MY_ATTRIBUTE((unused)), FT_DOC **to)
{
DBUG_ENTER("walk_and_copy");
from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
}
static int walk_and_push(FT_SUPERDOC *from,
- uint32 count __attribute__((unused)), QUEUE *best)
+ uint32 count MY_ATTRIBUTE((unused)), QUEUE *best)
{
DBUG_ENTER("walk_and_copy");
from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
}
-static int FT_DOC_cmp(void *unused __attribute__((unused)),
+static int FT_DOC_cmp(void *unused MY_ATTRIBUTE((unused)),
FT_DOC *a, FT_DOC *b)
{
double c= b->weight - a->weight;
float ft_nlq_find_relevance(FT_INFO *handler,
- uchar *record __attribute__((unused)),
- uint length __attribute__((unused)))
+ uchar *record MY_ATTRIBUTE((unused)),
+ uint length MY_ATTRIBUTE((unused)))
{
int a,b,c;
FT_DOC *docs=handler->doc;
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or modify
static int ft_add_word(MYSQL_FTPARSER_PARAM *param,
char *word, int word_len,
- MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused)))
+ MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info MY_ATTRIBUTE((unused)))
{
TREE *wtree;
FT_WORD w;
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static TREE *stopwords3=NULL;
-static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)),
+static int FT_STOPWORD_cmp(void* cmp_arg MY_ATTRIBUTE((unused)),
FT_STOPWORD *w1, FT_STOPWORD *w2)
{
return ha_compare_text(ft_stopword_cs,
}
static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
- void *arg __attribute__((unused)))
+ void *arg MY_ATTRIBUTE((unused)))
{
if (action == free_free)
my_free((void*)w->pos);
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* TODO: respect myisam_repair_threads variable */
my_snprintf(buf, 40, "Repair with %d threads", my_count_bits(key_map));
thd_proc_info(thd, buf);
+ /*
+ The new file is created with the right stats, so we can skip
+ copying file stats from old to new.
+ */
error = mi_repair_parallel(¶m, file, fixed_name,
- param.testflag & T_QUICK);
+ param.testflag & T_QUICK, TRUE);
thd_proc_info(thd, "Repair done"); // to reset proc_info, as
// it was pointing to local buffer
}
else
{
thd_proc_info(thd, "Repair by sorting");
+ /*
+ The new file is created with the right stats, so we can skip
+ copying file stats from old to new.
+ */
error = mi_repair_by_sort(¶m, file, fixed_name,
- param.testflag & T_QUICK);
+ param.testflag & T_QUICK, TRUE);
}
}
else
{
thd_proc_info(thd, "Repair with keycache");
param.testflag &= ~T_REP_BY_SORT;
+ /*
+ The new file is created with the right stats, so we can skip
+ copying file stats from old to new.
+ */
error= mi_repair(¶m, file, fixed_name,
- param.testflag & T_QUICK);
+ param.testflag & T_QUICK, TRUE);
}
#ifdef HAVE_MMAP
if (remap)
{
optimize_done=1;
thd_proc_info(thd, "Sorting index");
- error=mi_sort_index(¶m,file,fixed_name);
+ /*
+ The new file is created with the right stats, so we can skip
+ copying file stats from old to new.
+ */
+ error=mi_sort_index(¶m,file,fixed_name, TRUE);
}
if (!statistics_done && (local_testflag & T_STATISTICS))
{
}
int ha_myisam::index_next_same(uchar *buf,
- const uchar *key __attribute__((unused)),
- uint length __attribute__((unused)))
+ const uchar *key MY_ATTRIBUTE((unused)),
+ uint length MY_ATTRIBUTE((unused)))
{
int error;
DBUG_ASSERT(inited==INDEX);
/*
- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Save new datafile-name in temp_filename */
int mi_repair(MI_CHECK *param, register MI_INFO *info,
- char * name, int rep_quick)
+ char * name, int rep_quick, my_bool no_copy_stat)
{
int error,got_error;
ha_rows start_records,new_header_length;
/* Replace the actual file with the temporary file */
if (new_file >= 0)
{
+ myf flags= 0;
+ if (param->testflag & T_BACKUP_DATA)
+ flags |= MY_REDEL_MAKE_BACKUP;
+ if (no_copy_stat)
+ flags |= MY_REDEL_NO_COPY_STAT;
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
/*
info->s->file_map= NULL;
}
if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
- (param->testflag & T_BACKUP_DATA ?
- MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
+ flags) ||
mi_open_datafile(info,share,name,-1))
got_error=1;
/* Tell system that we want all memory for our cache */
-void lock_memory(MI_CHECK *param __attribute__((unused)))
+void lock_memory(MI_CHECK *param MY_ATTRIBUTE((unused)))
{
#ifdef SUN_OS /* Key-cacheing thrases on sun 4.1 */
if (param->opt_lock_memory)
/* Sort index for more efficent reads */
-int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name)
+int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name,
+ my_bool no_copy_stat)
{
reg2 uint key;
reg1 MI_KEYDEF *keyinfo;
share->kfile = -1;
(void) mysql_file_close(new_file, MYF(MY_WME));
if (change_to_newfile(share->index_file_name, MI_NAME_IEXT, INDEX_TMP_EXT,
- MYF(0)) ||
+ no_copy_stat ? MYF(MY_REDEL_NO_COPY_STAT) : MYF(0)) ||
mi_open_keyfile(share))
goto err2;
info->lock_type= F_UNLCK; /* Force mi_readinfo to lock */
info MyISAM handler to repair
name Name of table (for warnings)
rep_quick set to <> 0 if we should not change data file
+ no_copy_stat Don't copy file stats from old to new file,
+ assume that new file was created with correct stats
RESULT
0 ok
*/
int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
- const char * name, int rep_quick)
+ const char * name, int rep_quick, my_bool no_copy_stat)
{
int got_error;
uint i;
/* Replace the actual file with the temporary file */
if (new_file >= 0)
{
+ myf flags= 0;
+ if (param->testflag & T_BACKUP_DATA)
+ flags |= MY_REDEL_MAKE_BACKUP;
+ if (no_copy_stat)
+ flags |= MY_REDEL_NO_COPY_STAT;
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name,MI_NAME_DEXT, DATA_TMP_EXT,
- (param->testflag & T_BACKUP_DATA ?
- MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
+ flags) ||
mi_open_datafile(info,share,name,-1))
got_error=1;
}
info MyISAM handler to repair
name Name of table (for warnings)
rep_quick set to <> 0 if we should not change data file
+ no_copy_stat Don't copy file stats from old to new file,
+ assume that new file was created with correct stats
DESCRIPTION
Same as mi_repair_by_sort but do it multithreaded
*/
int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
- const char * name, int rep_quick)
+ const char * name, int rep_quick, my_bool no_copy_stat)
{
int got_error;
uint i,key, total_key_length, istep;
/* Replace the actual file with the temporary file */
if (new_file >= 0)
{
+ myf flags= 0;
+ if (param->testflag & T_BACKUP_DATA)
+ flags |= MY_REDEL_MAKE_BACKUP;
+ if (no_copy_stat)
+ flags |= MY_REDEL_NO_COPY_STAT;
mysql_file_close(new_file, MYF(0));
info->dfile=new_file= -1;
if (change_to_newfile(share->data_file_name, MI_NAME_DEXT, DATA_TMP_EXT,
- (param->testflag & T_BACKUP_DATA ?
- MYF(MY_REDEL_MAKE_BACKUP): MYF(0))) ||
+ flags) ||
mi_open_datafile(info,share,name,-1))
got_error=1;
}
-/* Copyright (c) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-void _mi_report_crashed(MI_INFO *file __attribute__((unused)),
- const char *message __attribute__((unused)),
- const char *sfile __attribute__((unused)),
- uint sline __attribute__((unused)))
+void _mi_report_crashed(MI_INFO *file MY_ATTRIBUTE((unused)),
+ const char *message MY_ATTRIBUTE((unused)),
+ const char *sfile MY_ATTRIBUTE((unused)),
+ uint sline MY_ATTRIBUTE((unused)))
{
}
-/* Copyright (c) 2003-2008 MySQL AB, 2009 Sun Microsystems, Inc.
- Use is subject to license terms.
+/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
int mi_assign_to_key_cache(MI_INFO *info,
- ulonglong key_map __attribute__((unused)),
+ ulonglong key_map MY_ATTRIBUTE((unused)),
KEY_CACHE *key_cache)
{
int error= 0;
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*************************************************************************/
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, const char *org_name,
- File file_to_dup __attribute__((unused)))
+ File file_to_dup MY_ATTRIBUTE((unused)))
{
char *data_name= share->data_file_name;
char real_data_name[FN_REFLEN];
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
static void uf_constant(MI_COLUMNDEF *rec,
- MI_BIT_BUFF *bit_buff __attribute__((unused)),
+ MI_BIT_BUFF *bit_buff MY_ATTRIBUTE((unused)),
uchar *to,
uchar *end)
{
/*ARGSUSED*/
-static void uf_zero(MI_COLUMNDEF *rec __attribute__((unused)),
- MI_BIT_BUFF *bit_buff __attribute__((unused)),
+static void uf_zero(MI_COLUMNDEF *rec MY_ATTRIBUTE((unused)),
+ MI_BIT_BUFF *bit_buff MY_ATTRIBUTE((unused)),
uchar *to, uchar *end)
{
memset(to, 0, (end-to));
static void uf_varchar1(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
- uchar *to, uchar *end __attribute__((unused)))
+ uchar *to, uchar *end MY_ATTRIBUTE((unused)))
{
if (get_bit(bit_buff))
to[0]= 0; /* Zero lengths */
static void uf_varchar2(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
- uchar *to, uchar *end __attribute__((unused)))
+ uchar *to, uchar *end MY_ATTRIBUTE((unused)))
{
if (get_bit(bit_buff))
to[0]=to[1]=0; /* Zero lengths */
static int _mi_read_rnd_mempack_record(MI_INFO *info, uchar *buf,
register my_off_t filepos,
my_bool skip_deleted_blocks
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
MI_BLOCK_INFO block_info;
MYISAM_SHARE *share=info->s;
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
uchar *key, uint key_len, uint comp_flag, uchar **ret_pos,
- uchar *buff __attribute__((unused)), my_bool *last_key)
+ uchar *buff MY_ATTRIBUTE((unused)), my_bool *last_key)
{
reg4 int start,mid,end,save_end;
int flag;
int
_mi_calc_static_key_length(MI_KEYDEF *keyinfo,uint nod_flag,
- uchar *next_pos __attribute__((unused)),
- uchar *org_key __attribute__((unused)),
- uchar *prev_key __attribute__((unused)),
+ uchar *next_pos MY_ATTRIBUTE((unused)),
+ uchar *org_key MY_ATTRIBUTE((unused)),
+ uchar *prev_key MY_ATTRIBUTE((unused)),
uchar *key, MI_KEY_PARAM *s_temp)
{
s_temp->key=key;
int
_mi_calc_var_key_length(MI_KEYDEF *keyinfo,uint nod_flag,
- uchar *next_pos __attribute__((unused)),
- uchar *org_key __attribute__((unused)),
- uchar *prev_key __attribute__((unused)),
+ uchar *next_pos MY_ATTRIBUTE((unused)),
+ uchar *org_key MY_ATTRIBUTE((unused)),
+ uchar *prev_key MY_ATTRIBUTE((unused)),
uchar *key, MI_KEY_PARAM *s_temp)
{
s_temp->key=key;
/* store key without compression */
-void _mi_store_static_key(MI_KEYDEF *keyinfo __attribute__((unused)),
+void _mi_store_static_key(MI_KEYDEF *keyinfo MY_ATTRIBUTE((unused)),
register uchar *key_pos,
register MI_KEY_PARAM *s_temp)
{
{ *((pos)++) = (uchar) ((length) >> 8); *((pos)++) = (uchar) (length); } }
-void _mi_store_var_pack_key(MI_KEYDEF *keyinfo __attribute__((unused)),
+void _mi_store_var_pack_key(MI_KEYDEF *keyinfo MY_ATTRIBUTE((unused)),
register uchar *key_pos,
register MI_KEY_PARAM *s_temp)
{
/* variable length key with prefix compression */
-void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo __attribute__((unused)),
+void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo MY_ATTRIBUTE((unused)),
register uchar *key_pos,
register MI_KEY_PARAM *s_temp)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
ulong myisam_data_pointer_size=4;
ulonglong myisam_mmap_size= SIZE_T_MAX, myisam_mmap_used= 0;
-static int always_valid(const char *filename __attribute__((unused)))
+static int always_valid(const char *filename MY_ATTRIBUTE((unused)))
{
return 0;
}
/*
- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch(optid) {
case 'a':
-/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch(optid) {
case 'd':
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static my_bool
get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
info->s->state.key_map,
param->force_sort))
{
+ /*
+ The new file might not be created with the right stats depending
+ on how myisamchk is run, so we must copy file stats from old to new.
+ */
if (param->testflag & T_REP_BY_SORT)
- error=mi_repair_by_sort(param,info,filename,rep_quick);
+ error= mi_repair_by_sort(param, info, filename, rep_quick, FALSE);
else
- error=mi_repair_parallel(param,info,filename,rep_quick);
+ error= mi_repair_parallel(param, info, filename, rep_quick, FALSE);
state_updated=1;
}
else if (param->testflag & T_REP_ANY)
- error=mi_repair(param, info,filename,rep_quick);
+ error= mi_repair(param, info, filename, rep_quick, FALSE);
}
if (!error && param->testflag & T_SORT_RECORDS)
{
{
if (param->verbose)
puts("Table had a compressed index; We must now recreate the index");
- error=mi_repair_by_sort(param,info,filename,1);
+ error= mi_repair_by_sort(param, info, filename, 1, FALSE);
}
}
}
if (!error && param->testflag & T_SORT_INDEX)
- error=mi_sort_index(param,info,filename);
+ error= mi_sort_index(param, info, filename, FALSE);
if (!error)
share->state.changed&= ~(STATE_CHANGED | STATE_CRASHED |
STATE_CRASHED_ON_REPAIR);
static int not_killed= 0;
-volatile int *killed_ptr(MI_CHECK *param __attribute__((unused)))
+volatile int *killed_ptr(MI_CHECK *param MY_ATTRIBUTE((unused)))
{
return ¬_killed; /* always NULL */
}
/* print warnings and errors */
/* VARARGS */
-void mi_check_print_info(MI_CHECK *param __attribute__((unused)),
+void mi_check_print_info(MI_CHECK *param MY_ATTRIBUTE((unused)),
const char *fmt,...)
{
va_list args;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
} /* read_string */
-static int file_info_compare(void* cmp_arg __attribute__((unused)),
+static int file_info_compare(void* cmp_arg MY_ATTRIBUTE((unused)),
void *a, void *b)
{
long lint;
/* ARGSUSED */
static int test_if_open (struct file_info *key,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
struct test_if_open_param *param)
{
if (!strcmp(key->name,param->name) && key->id > param->max_id)
/* ARGSUSED */
static int test_when_accessed (struct file_info *key,
- element_count count __attribute__((unused)),
+ element_count count MY_ATTRIBUTE((unused)),
struct st_access_param *access_param)
{
if (key->accessed < access_param->min_accessed && ! key->closed)
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#endif
#include <my_getopt.h>
#include <assert.h>
+#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
#if SIZEOF_LONG_LONG > 4
#define BITS_SAVED 64
uint trees,
HUFF_COUNTS *huff_counts,
uint fields);
-static int compare_tree(void* cmp_arg __attribute__((unused)),
+static int compare_tree(void* cmp_arg MY_ATTRIBUTE((unused)),
const uchar *s,const uchar *t);
static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts);
static void check_counts(HUFF_COUNTS *huff_counts,uint trees,
static void usage(void)
{
print_version();
- puts("Copyright 2002-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
- puts("and you are welcome to modify and redistribute it under the GPL license\n");
+ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2002"));
puts("Pack a MyISAM-table to take much less space.");
puts("Keys are not updated, you must run myisamchk -rq on the datafile");
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
uint length;
DBUG_RETURN(error != HA_ERR_END_OF_FILE);
}
-static int compare_huff_elements(void *not_used __attribute__((unused)),
+static int compare_huff_elements(void *not_used MY_ATTRIBUTE((unused)),
uchar *a, uchar *b)
{
return *((my_off_t*) a) < *((my_off_t*) b) ? -1 :
return 0;
}
-static int compare_tree(void* cmp_arg __attribute__((unused)),
+static int compare_tree(void* cmp_arg MY_ATTRIBUTE((unused)),
register const uchar *s, register const uchar *t)
{
uint length;
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-1
};
-int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char *argv[] MY_ATTRIBUTE((unused)))
{
MY_INIT(argv[0]);
exit(run_test("rt_test"));
static void print_record(uchar * record,
- my_off_t offs __attribute__((unused)),
+ my_off_t offs MY_ATTRIBUTE((unused)),
const char * tail)
{
int i;
}
#else
-int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char *argv[] MY_ATTRIBUTE((unused)))
{
exit(0);
}
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
-static int write_merge_key(MI_SORT_PARAM *info __attribute__((unused)),
+static int write_merge_key(MI_SORT_PARAM *info MY_ATTRIBUTE((unused)),
IO_CACHE *to_file, uchar *key,
uint sort_length, uint count)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
- uchar byte_order __attribute__((unused)),
+ uchar byte_order MY_ATTRIBUTE((unused)),
double *mbr)
{
double ord;
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static char blob_key[MAX_REC_LENGTH];
-int main(int argc __attribute__((unused)),char *argv[])
+int main(int argc MY_ATTRIBUTE((unused)),char *argv[])
{
MY_INIT(argv[0]);
exit(run_test("sp_test"));
}
#else
-int main(int argc __attribute__((unused)),char *argv[] __attribute__((unused)))
+int main(int argc MY_ATTRIBUTE((unused)),char *argv[] MY_ATTRIBUTE((unused)))
{
exit(0);
}
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
and adds a child list of TABLE_LIST to the parent handler.
*/
-int ha_myisammrg::open(const char *name, int mode __attribute__((unused)),
+int ha_myisammrg::open(const char *name, int mode MY_ATTRIBUTE((unused)),
uint test_if_locked_arg)
{
DBUG_ENTER("ha_myisammrg::open");
}
int ha_myisammrg::index_next_same(uchar * buf,
- const uchar *key __attribute__((unused)),
- uint length __attribute__((unused)))
+ const uchar *key MY_ATTRIBUTE((unused)),
+ uint length MY_ATTRIBUTE((unused)))
{
int error;
DBUG_ASSERT(this->file->children_attached);
/*
- Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#endif
/**
- * __attribute__((noreturn)) was introduce in gcc 2.5
+ * MY_ATTRIBUTE((noreturn)) was introduce in gcc 2.5
*/
#if (GCC_VERSION >= 2005)
-#define ATTRIBUTE_NORETURN __attribute__((noreturn))
+#define ATTRIBUTE_NORETURN MY_ATTRIBUTE((noreturn))
#else
#define ATTRIBUTE_NORETURN
#endif
/**
- * __attribute__((noinline)) was introduce in gcc 3.1
+ * MY_ATTRIBUTE((noinline)) was introduce in gcc 3.1
*/
#if (GCC_VERSION >= 3001)
-#define ATTRIBUTE_NOINLINE __attribute__((noinline))
+#define ATTRIBUTE_NOINLINE MY_ATTRIBUTE((noinline))
#else
#define ATTRIBUTE_NOINLINE
#endif
/*
- Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
void (*usage)(void));
my_bool
ndb_std_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument);
void ndb_usage(void (*usagefunc)(void), const char *load_default_groups[],
/*
- Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
my_bool
ndb_std_get_one_option(int optid,
- const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
+ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument MY_ATTRIBUTE((unused)))
{
switch (optid) {
#ifndef DBUG_OFF
/*
- Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
};
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
return 0;
/*
- Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
#ifndef DBUG_OFF
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if (! pfs_table->m_io_enabled)
return NULL;
- PFS_thread *pfs_thread= pfs_table->m_thread_owner;
-
- DBUG_ASSERT(pfs_thread ==
- my_pthread_getspecific_ptr(PFS_thread*, THR_PFS));
+ PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
register uint flags;
ulonglong timer_start= 0;
if (! pfs_table->m_lock_enabled)
return NULL;
- PFS_thread *pfs_thread= pfs_table->m_thread_owner;
+ PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
PFS_TL_LOCK_TYPE lock_type;
if (flag_thread_instrumentation)
{
- PFS_thread *pfs_thread= pfs_socket->m_thread_owner;
+ /*
+ Do not use pfs_socket->m_thread_owner here,
+ as different threads may use concurrently the same socket,
+ for example during a KILL.
+ */
+ PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
if (unlikely(pfs_thread == NULL))
return NULL;
if (flag_events_waits_history_long)
insert_events_waits_history_long(wait);
thread->m_events_waits_current--;
+
+ DBUG_ASSERT(wait == thread->m_events_waits_current);
}
}
if (flag_events_waits_history_long)
insert_events_waits_history_long(wait);
thread->m_events_waits_current--;
+
+ DBUG_ASSERT(wait == thread->m_events_waits_current);
}
}
}
if (flag_events_waits_history_long)
insert_events_waits_history_long(wait);
thread->m_events_waits_current--;
+
+ DBUG_ASSERT(wait == thread->m_events_waits_current);
}
}
}
if (flag_events_waits_history_long)
insert_events_waits_history_long(wait);
thread->m_events_waits_current--;
+
+ DBUG_ASSERT(wait == thread->m_events_waits_current);
}
}
}
if (flag_events_waits_history_long)
insert_events_waits_history_long(wait);
thread->m_events_waits_current--;
+
+ DBUG_ASSERT(wait == thread->m_events_waits_current);
}
}
}
if (flag_events_waits_history_long)
insert_events_waits_history_long(wait);
thread->m_events_waits_current--;
+
+ DBUG_ASSERT(wait == thread->m_events_waits_current);
}
}
if (flag_events_waits_history_long)
insert_events_waits_history_long(wait);
thread->m_events_waits_current--;
+
+ DBUG_ASSERT(wait == thread->m_events_waits_current);
}
}
if (flag_events_waits_history_long)
insert_events_waits_history_long(wait);
thread->m_events_waits_current--;
+
+ DBUG_ASSERT(wait == thread->m_events_waits_current);
}
}
}
if (flag_events_waits_history_long)
insert_events_waits_history_long(wait);
thread->m_events_waits_current--;
+
+ DBUG_ASSERT(wait == thread->m_events_waits_current);
}
}
-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Current index in Stat array where new record is to be inserted.
index 0 is reserved for "all else" case when entire array is full.
*/
-volatile uint32 digest_index;
+volatile uint32 PFS_ALIGNED digest_monotonic_index;
bool digest_full= false;
LF_HASH digest_hash;
*/
digest_max= param->m_digest_sizing;
digest_lost= 0;
- digest_index= 1;
+ PFS_atomic::store_u32(& digest_monotonic_index, 1);
digest_full= false;
if (digest_max == 0)
+ index * pfs_max_digest_length, pfs_max_digest_length);
}
+ /* Set record[0] as allocated. */
+ statements_digest_stat_array[0].m_lock.set_allocated();
+
return 0;
}
memcpy(hash_key.m_schema_name, schema_name, schema_name_length);
int res;
- ulong safe_index;
uint retry_count= 0;
const uint retry_max= 3;
+ size_t safe_index;
+ size_t attempts= 0;
PFS_statements_digest_stat **entry;
PFS_statements_digest_stat *pfs= NULL;
return & pfs->m_stat;
}
- safe_index= PFS_atomic::add_u32(& digest_index, 1);
- if (safe_index >= digest_max)
+ while (++attempts <= digest_max)
{
- /* The digest array is now full. */
- digest_full= true;
- pfs= &statements_digest_stat_array[0];
-
- if (pfs->m_first_seen == 0)
- pfs->m_first_seen= now;
- pfs->m_last_seen= now;
- return & pfs->m_stat;
- }
-
- /* Add a new record in digest stat array. */
- pfs= &statements_digest_stat_array[safe_index];
-
- /* Copy digest hash/LF Hash search key. */
- memcpy(& pfs->m_digest_key, &hash_key, sizeof(PFS_digest_key));
-
- /*
- Copy digest storage to statement_digest_stat_array so that it could be
- used later to generate digest text.
- */
- pfs->m_digest_storage.copy(digest_storage);
-
- pfs->m_first_seen= now;
- pfs->m_last_seen= now;
+ safe_index= PFS_atomic::add_u32(& digest_monotonic_index, 1) % digest_max;
+ if (safe_index == 0)
+ {
+ /* Record [0] is reserved. */
+ safe_index= 1;
+ }
- res= lf_hash_insert(&digest_hash, pins, &pfs);
- if (likely(res == 0))
- {
- return & pfs->m_stat;
- }
+ /* Add a new record in digest stat array. */
+ pfs= &statements_digest_stat_array[safe_index];
- if (res > 0)
- {
- /* Duplicate insert by another thread */
- if (++retry_count > retry_max)
+ if (pfs->m_lock.is_free())
{
- /* Avoid infinite loops */
- digest_lost++;
- return NULL;
+ if (pfs->m_lock.free_to_dirty())
+ {
+ /* Copy digest hash/LF Hash search key. */
+ memcpy(& pfs->m_digest_key, &hash_key, sizeof(PFS_digest_key));
+
+ /*
+ Copy digest storage to statement_digest_stat_array so that it could be
+ used later to generate digest text.
+ */
+ pfs->m_digest_storage.copy(digest_storage);
+
+ pfs->m_first_seen= now;
+ pfs->m_last_seen= now;
+
+ res= lf_hash_insert(&digest_hash, pins, &pfs);
+ if (likely(res == 0))
+ {
+ pfs->m_lock.dirty_to_allocated();
+ return & pfs->m_stat;
+ }
+
+ pfs->m_lock.dirty_to_free();
+
+ if (res > 0)
+ {
+ /* Duplicate insert by another thread */
+ if (++retry_count > retry_max)
+ {
+ /* Avoid infinite loops */
+ digest_lost++;
+ return NULL;
+ }
+ goto search;
+ }
+
+ /* OOM in lf_hash_insert */
+ digest_lost++;
+ return NULL;
+ }
}
- goto search;
}
- /* OOM in lf_hash_insert */
- digest_lost++;
- return NULL;
+ /* The digest array is now full. */
+ digest_full= true;
+ pfs= &statements_digest_stat_array[0];
+
+ if (pfs->m_first_seen == 0)
+ pfs->m_first_seen= now;
+ pfs->m_last_seen= now;
+ return & pfs->m_stat;
}
void purge_digest(PFS_thread* thread, PFS_digest_key *hash_key)
void PFS_statements_digest_stat::reset_data(unsigned char *token_array, uint length)
{
+ m_lock.set_dirty();
m_digest_storage.reset(token_array, length);
m_stat.reset();
m_first_seen= 0;
m_last_seen= 0;
+ m_lock.dirty_to_free();
}
void PFS_statements_digest_stat::reset_index(PFS_thread *thread)
statements_digest_stat_array[index].reset_data(statements_digest_token_array + index * pfs_max_digest_length, pfs_max_digest_length);
}
+ /* Mark record[0] as allocated again. */
+ statements_digest_stat_array[0].m_lock.set_allocated();
+
/*
Reset index which indicates where the next calculated digest information
to be inserted in statements_digest_stat_array.
*/
- digest_index= 1;
+ PFS_atomic::store_u32(& digest_monotonic_index, 1);
digest_full= false;
}
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/** A statement digest stat record. */
struct PFS_ALIGNED PFS_statements_digest_stat
{
+ /** Internal lock. */
+ pfs_lock m_lock;
+
/** Digest Schema + MD5 Hash. */
PFS_digest_key m_digest_key;
-/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
PFS_atomic::store_u32(&m_version_state, new_val);
}
+ /**
+ Initialize a lock to dirty.
+ */
+ void set_dirty(void)
+ {
+ /* Do not set the version to 0, read the previous value. */
+ uint32 copy= PFS_atomic::load_u32(&m_version_state);
+ /* Increment the version, set the DIRTY state */
+ uint32 new_val= (copy & VERSION_MASK) + VERSION_INC + PFS_LOCK_DIRTY;
+ PFS_atomic::store_u32(&m_version_state, new_val);
+ }
+
/**
Execute a dirty to free transition.
This transition should be executed by the writer that owns the record.
-/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
m_pos.next())
{
digest_stat= &statements_digest_stat_array[m_pos.m_index];
- if (digest_stat->m_first_seen != 0)
+ if (digest_stat->m_lock.is_populated())
{
- make_row(digest_stat);
- m_next_pos.set_after(&m_pos);
- return 0;
+ if (digest_stat->m_first_seen != 0)
+ {
+ make_row(digest_stat);
+ m_next_pos.set_after(&m_pos);
+ return 0;
+ }
}
}
set_position(pos);
digest_stat= &statements_digest_stat_array[m_pos.m_index];
- if (digest_stat->m_first_seen != 0)
+ if (digest_stat->m_lock.is_populated())
{
- make_row(digest_stat);
- return 0;
+ if (digest_stat->m_first_seen != 0)
+ {
+ make_row(digest_stat);
+ return 0;
+ }
}
return HA_ERR_RECORD_DELETED;
-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
CHARSET_INFO *cs= get_charset(statement->m_sqltext_cs_number, MYF(0));
size_t valid_length= statement->m_sqltext_length;
- if (cs->mbmaxlen > 1)
+ if (cs != NULL)
{
- int well_formed_error;
- valid_length= cs->cset->well_formed_len(cs, statement->m_sqltext, statement->m_sqltext + valid_length,
- valid_length, &well_formed_error);
+ if (cs->mbmaxlen > 1)
+ {
+ int well_formed_error;
+ valid_length= cs->cset->well_formed_len(cs,
+ statement->m_sqltext,
+ statement->m_sqltext + valid_length,
+ valid_length,
+ &well_formed_error);
+ }
}
m_row.m_sqltext.set_charset(cs);
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static void
-default_reporter(enum loglevel level __attribute__ ((unused)),
- const char *format __attribute__ ((unused)),
+default_reporter(enum loglevel level MY_ATTRIBUTE ((unused)),
+ const char *format MY_ATTRIBUTE ((unused)),
...)
{
}
fprint_copyright(FILE *file)
{
fprintf(file,
-"/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.\n"
+"/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.\n"
"\n"
" This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n"
int
-main(int argc, char **argv __attribute__((unused)))
+main(int argc, char **argv MY_ATTRIBUTE((unused)))
{
CHARSET_INFO ncs;
CHARSET_INFO *cs;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* Compare strings */
-static int my_strnncoll_big5(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
/* compare strings, ignore end space */
-static int my_strnncollsp_big5(const CHARSET_INFO* cs __attribute__((unused)),
+static int my_strnncollsp_big5(const CHARSET_INFO* cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
}
-static uint ismbchar_big5(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (isbig5head(*(p)) && (e)-(p)>1 && isbig5tail(*((p)+1))? 2: 0);
}
-static uint mbcharlen_big5(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (isbig5head(c)? 2 : 1);
static int
-my_wc_mb_big5(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
static int
-my_mb_wc_big5(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc,const uchar *s,const uchar *e)
{
CP950 and HKSCS additional characters are also accepted.
*/
static
-size_t my_well_formed_len_big5(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_big5(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
/* Copyright (c) 2002 MySQL AB & tommy@valley.ne.jp
- Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
static my_bool
my_coll_init_8bit_bin(CHARSET_INFO *cs,
- MY_CHARSET_LOADER *loader __attribute__((unused)))
+ MY_CHARSET_LOADER *loader MY_ATTRIBUTE((unused)))
{
cs->max_sort_char=255;
return FALSE;
}
-static int my_strnncoll_binary(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_binary(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool t_is_prefix)
}
-size_t my_lengthsp_binary(const CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr __attribute__((unused)),
+size_t my_lengthsp_binary(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *ptr MY_ATTRIBUTE((unused)),
size_t length)
{
return length;
*/
static int my_strnncollsp_binary(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
return my_strnncoll_binary(cs,s,slen,t,tlen,0);
}
static int my_strnncoll_8bit_bin(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool t_is_prefix)
*/
static int my_strnncollsp_8bit_bin(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
/* This function is used for all conversion functions */
-static size_t my_case_str_bin(const CHARSET_INFO *cs __attribute__((unused)),
- char *str __attribute__((unused)))
+static size_t my_case_str_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ char *str MY_ATTRIBUTE((unused)))
{
return 0;
}
-static size_t my_case_bin(const CHARSET_INFO *cs __attribute__((unused)),
- char *src __attribute__((unused)),
+static size_t my_case_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ char *src MY_ATTRIBUTE((unused)),
size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
return srclen;
}
-static int my_strcasecmp_bin(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strcasecmp_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *s, const char *t)
{
return strcmp(s,t);
}
-uint my_mbcharlen_8bit(const CHARSET_INFO *cs __attribute__((unused)),
- uint c __attribute__((unused)))
+uint my_mbcharlen_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ uint c MY_ATTRIBUTE((unused)))
{
return 1;
}
-static int my_mb_wc_bin(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_mb_wc_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *wc,
const uchar *str,
- const uchar *end __attribute__((unused)))
+ const uchar *end MY_ATTRIBUTE((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
}
-static int my_wc_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_wc_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc,
uchar *s,
- uchar *e __attribute__((unused)))
+ uchar *e MY_ATTRIBUTE((unused)))
{
if (s >= e)
return MY_CS_TOOSMALL;
}
-void my_hash_sort_8bit_bin(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_8bit_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,
ulong *nr1, ulong *nr2)
{
}
-void my_hash_sort_bin(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2)
{
const uchar *pos = key;
static
-uint my_instr_bin(const CHARSET_INFO *cs __attribute__((unused)),
+uint my_instr_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, size_t b_length,
const char *s, size_t s_length,
my_match_t *match, uint nmatch)
-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
(0x80<=(c) && (c)<=0xfc))
-static uint ismbchar_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (iscp932head((uchar) *p) && (e-p)>1 && iscp932tail((uchar)p[1]) ? 2: 0);
}
-static uint mbcharlen_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (iscp932head((uchar) c) ? 2 : 1);
}
-static int my_strnncoll_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
static int my_strnncollsp_cp932(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
const uchar *a_end= a + a_length;
const uchar *b_end= b + b_length;
*/
static int
-my_mb_wc_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi;
@retval MY_CS_ILUNI If the Unicode character does not exist in CP932
*/
static int
-my_wc_mb_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static
-size_t my_numcells_cp932(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_cp932(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, const char *str_end)
{
size_t clen= 0;
static
size_t my_well_formed_len_cp932(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the length of the strings being specified
*/
-static int my_strnncoll_czech(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_czech(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s1, size_t len1,
const uchar *s2, size_t len2,
my_bool s2_is_prefix)
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
for ( ; slen && s[slen-1] == ' ' ; slen--);
for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
*/
static size_t
my_strnxfrmlen_czech(const CHARSET_INFO *cs
- __attribute__((unused)), size_t len)
+ MY_ATTRIBUTE((unused)), size_t len)
{
return len * 4 + 4;
}
*/
static size_t
-my_strnxfrm_czech(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnxfrm_czech(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uchar *dest, size_t len,
- uint nweights_arg __attribute__((unused)),
+ uint nweights_arg MY_ATTRIBUTE((unused)),
const uchar *src, size_t srclen, uint flags)
{
int value;
static my_bool my_like_range_czech(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const char *ptr,size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
size_t res_length, char *min_str,
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
iseuc_kr_tail3(c))
-static uint ismbchar_euc_kr(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_euc_kr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
0);
}
-static uint mbcharlen_euc_kr(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_euc_kr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (iseuc_kr_head(c) ? 2 : 1);
static int
-my_wc_mb_euc_kr(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_euc_kr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static int
-my_mb_wc_euc_kr(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_euc_kr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
Returns well formed length of a EUC-KR string.
*/
static size_t
-my_well_formed_len_euckr(const CHARSET_INFO *cs __attribute__((unused)),
+my_well_formed_len_euckr(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
/* Copyright (c) 2002 MySQL AB & tommy@valley.ne.jp
- Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
#define iseucjpms_ss3(c) (((c)&0xff) == 0x8f)
-static uint ismbchar_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
0);
}
-static uint mbcharlen_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (iseucjpms(c)? 2: iseucjpms_ss2(c)? 2: iseucjpms_ss3(c)? 3: 1);
@retval MY_CS_ILSEQ If a wrong byte sequence was found
*/
static int
-my_mb_wc_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
int hi;
@retval MY_CS_ILUNI If the Unicode character does not exist in EUCJPMS
*/
static int
-my_wc_mb_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int jp;
static
size_t my_well_formed_len_eucjpms(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const char *beg, const char *end, size_t pos,
int *error)
{
static
-size_t my_numcells_eucjpms(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_eucjpms(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, const char *str_end)
{
size_t clen;
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define isgb2312tail(c) (0xa1<=(uchar)(c) && (uchar)(c)<=0xfe)
-static uint ismbchar_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (isgb2312head(*(p)) && (e)-(p)>1 && isgb2312tail(*((p)+1))? 2: 0);
}
-static uint mbcharlen_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (isgb2312head(c)? 2 : 1);
static int
-my_wc_mb_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static int
-my_mb_wc_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi;
Returns well formed length of a EUC-KR string.
*/
static size_t
-my_well_formed_len_gb2312(const CHARSET_INFO *cs __attribute__((unused)),
+my_well_formed_len_gb2312(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-int my_strnncoll_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+int my_strnncoll_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
}
-static int my_strnncollsp_gbk(const CHARSET_INFO * cs __attribute__((unused)),
+static int my_strnncollsp_gbk(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
}
-static uint ismbchar_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (isgbkhead(*(p)) && (e)-(p)>1 && isgbktail(*((p)+1))? 2: 0);
}
-static uint mbcharlen_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (isgbkhead(c)? 2 : 1);
}
static int
-my_wc_mb_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
}
static int
-my_mb_wc_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
int hi;
Returns well formed length of a GBK string.
*/
static
-size_t my_well_formed_len_gbk(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_gbk(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
};
static
-int my_mb_wc_latin1(const CHARSET_INFO *cs __attribute__((unused)),
+int my_mb_wc_latin1(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *wc,
const uchar *str,
- const uchar *end __attribute__((unused)))
+ const uchar *end MY_ATTRIBUTE((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
}
static
-int my_wc_mb_latin1(const CHARSET_INFO *cs __attribute__((unused)),
+int my_wc_mb_latin1(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc,
uchar *str,
- uchar *end __attribute__((unused)))
+ uchar *end MY_ATTRIBUTE((unused)))
{
uchar *pl;
static int my_strnncoll_latin1_de(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
static int my_strnncollsp_latin1_de(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
}
-void my_hash_sort_latin1_de(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_latin1_de(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,
ulong *nr1, ulong *nr2)
{
-/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
For character sets which don't change octet length in case conversion.
*/
size_t my_caseup_mb(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
register uint32 l;
register char *srcend= src + srclen;
size_t my_casedn_mb(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
register uint32 l;
register char *srcend= src + srclen;
static size_t
my_casefold_mb_varlen(const CHARSET_INFO *cs,
char *src, size_t srclen,
- char *dst, size_t dstlen __attribute__((unused)),
+ char *dst, size_t dstlen MY_ATTRIBUTE((unused)),
uchar *map,
size_t is_upper)
{
}
-size_t my_numchars_mb(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numchars_mb(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *pos, const char *end)
{
register size_t count= 0;
}
-size_t my_charpos_mb(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_charpos_mb(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *pos, const char *end, size_t length)
{
const char *start= pos;
/* BINARY collations handlers for MB charsets */
int
-my_strnncoll_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnncoll_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool t_is_prefix)
*/
int
-my_strnncollsp_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnncollsp_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
int
-my_strcasecmp_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_strcasecmp_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *s, const char *t)
{
return strcmp(s,t);
void
-my_hash_sort_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2)
{
const uchar *pos = key;
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
size_t my_caseup_8bit(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
char *end= src + srclen;
register uchar *map= cs->to_upper;
size_t my_casedn_8bit(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
char *end= src + srclen;
register uchar *map=cs->to_lower;
int my_mb_wc_8bit(const CHARSET_INFO *cs,my_wc_t *wc,
const uchar *str,
- const uchar *end __attribute__((unused)))
+ const uchar *end MY_ATTRIBUTE((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
end buffer must be checked.
*/
-size_t my_snprintf_8bit(const CHARSET_INFO *cs __attribute__((unused)),
- char* to, size_t n __attribute__((unused)),
+size_t my_snprintf_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ char* to, size_t n MY_ATTRIBUTE((unused)),
const char* fmt, ...)
{
va_list args;
}
-longlong my_strntoll_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+longlong my_strntoll_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *nptr, size_t l, int base,
char **endptr,int *err)
{
*/
-double my_strntod_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+double my_strntod_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char *str, size_t length,
char **end, int *err)
{
Assume len >= 1
*/
-size_t my_long10_to_str_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_long10_to_str_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char *dst, size_t len, int radix, long int val)
{
char buffer[66];
size_t my_longlong10_to_str_8bit(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
char *dst, size_t len, int radix,
longlong val)
{
}
-void my_fill_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+void my_fill_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char *s, size_t l, int fill)
{
memset(s, fill, l);
}
-size_t my_numchars_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numchars_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e)
{
return (size_t) (e - b);
}
-size_t my_numcells_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e)
{
return (size_t) (e - b);
}
-size_t my_charpos_8bit(const CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)),
+size_t my_charpos_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *b MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)),
size_t pos)
{
return pos;
}
-size_t my_well_formed_len_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *start, const char *end,
size_t nchars, int *error)
{
}
-size_t my_lengthsp_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_lengthsp_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t length)
{
const char *end;
static my_bool
my_coll_init_simple(CHARSET_INFO *cs,
- MY_CHARSET_LOADER *loader __attribute__((unused)))
+ MY_CHARSET_LOADER *loader MY_ATTRIBUTE((unused)))
{
set_max_sort_char(cs);
return FALSE;
}
-longlong my_strtoll10_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+longlong my_strtoll10_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *nptr, char **endptr, int *error)
{
return my_strtoll10(nptr, endptr, error);
*/
ulonglong
-my_strntoull10rnd_8bit(const CHARSET_INFO *cs __attribute__((unused)),
+my_strntoull10rnd_8bit(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, size_t length, int unsigned_flag,
char **endptr, int *error)
{
-my_bool my_propagate_simple(const CHARSET_INFO *cs __attribute__((unused)),
- const uchar *str __attribute__((unused)),
- size_t length __attribute__((unused)))
+my_bool my_propagate_simple(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const uchar *str MY_ATTRIBUTE((unused)),
+ size_t length MY_ATTRIBUTE((unused)))
{
return 1;
}
-my_bool my_propagate_complex(const CHARSET_INFO *cs __attribute__((unused)),
- const uchar *str __attribute__((unused)),
- size_t length __attribute__((unused)))
+my_bool my_propagate_complex(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const uchar *str MY_ATTRIBUTE((unused)),
+ size_t length MY_ATTRIBUTE((unused)))
{
return 0;
}
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
(0x80<=(c) && (c)<=0xfc))
-static uint ismbchar_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return (issjishead((uchar) *p) && (e-p)>1 && issjistail((uchar)p[1]) ? 2: 0);
}
-static uint mbcharlen_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (issjishead((uchar) c) ? 2 : 1);
}
-static int my_strnncoll_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncoll_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool b_is_prefix)
}
-static int my_strnncollsp_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncollsp_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *a, size_t a_length,
const uchar *b, size_t b_length,
my_bool diff_if_only_endspace_difference)
@retval MY_CS_ILSEQ If a wrong byte sequence was found
*/
static int
-my_mb_wc_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e){
int hi;
@retval MY_CS_ILUNI If the Unicode character does not exist in SJIS
*/
static int
-my_wc_mb_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static
-size_t my_numcells_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, const char *str_end)
{
size_t clen;
CP932 additional characters are also accepted.
*/
static
-size_t my_well_formed_len_sjis(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_sjis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t pos, int *error)
{
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
static
-int my_strnncoll_tis620(const CHARSET_INFO *cs __attribute__((unused)),
+int my_strnncoll_tis620(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s1, size_t len1,
const uchar *s2, size_t len2,
my_bool s2_is_prefix)
static
-int my_strnncollsp_tis620(const CHARSET_INFO * cs __attribute__((unused)),
+int my_strnncollsp_tis620(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
const uchar *a0, size_t a_length,
const uchar *b0, size_t b_length,
my_bool diff_if_only_endspace_difference)
static
-int my_mb_wc_tis620(const CHARSET_INFO *cs __attribute__((unused)),
+int my_mb_wc_tis620(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *wc,
const uchar *str,
- const uchar *end __attribute__((unused)))
+ const uchar *end MY_ATTRIBUTE((unused)))
{
if (str >= end)
return MY_CS_TOOSMALL;
}
static
-int my_wc_mb_tis620(const CHARSET_INFO *cs __attribute__((unused)),
+int my_wc_mb_tis620(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc,
uchar *str,
- uchar *end __attribute__((unused)))
+ uchar *end MY_ATTRIBUTE((unused)))
{
uchar *pl;
-/* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
static size_t
-my_caseup_str_mb2_or_mb4(const CHARSET_INFO * cs __attribute__((unused)),
- char * s __attribute__((unused)))
+my_caseup_str_mb2_or_mb4(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
+ char * s MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(0);
return 0;
static size_t
-my_casedn_str_mb2_or_mb4(const CHARSET_INFO *cs __attribute__((unused)),
- char * s __attribute__((unused)))
+my_casedn_str_mb2_or_mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ char * s MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(0);
return 0;
static int
-my_strcasecmp_mb2_or_mb4(const CHARSET_INFO *cs __attribute__((unused)),
- const char *s __attribute__((unused)),
- const char *t __attribute__((unused)))
+my_strcasecmp_mb2_or_mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *s MY_ATTRIBUTE((unused)),
+ const char *t MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(0);
return 0;
static size_t
-my_snprintf_mb2(const CHARSET_INFO *cs __attribute__((unused)),
+my_snprintf_mb2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char* to, size_t n, const char* fmt, ...)
{
size_t retval;
static size_t
-my_lengthsp_mb2(const CHARSET_INFO *cs __attribute__((unused)),
+my_lengthsp_mb2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t length)
{
const char *end= ptr + length;
((c & 3) << 8) + d + 0x10000)
static int
-my_utf16_uni(const CHARSET_INFO *cs __attribute__((unused)),
+my_utf16_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
if (s + 2 > e)
static int
-my_uni_utf16(const CHARSET_INFO *cs __attribute__((unused)),
+my_uni_utf16(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
if (wc <= 0xFFFF)
static size_t
my_caseup_utf16(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static size_t
my_casedn_utf16(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static uint
-my_mbcharlen_utf16(const CHARSET_INFO *cs __attribute__((unused)),
- uint c __attribute__((unused)))
+my_mbcharlen_utf16(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ uint c MY_ATTRIBUTE((unused)))
{
DBUG_ASSERT(0);
return MY_UTF16_HIGH_HEAD(c) ? 4 : 2;
static int
-my_utf16le_uni(const CHARSET_INFO *cs __attribute__((unused)),
+my_utf16le_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
my_wc_t lo;
static int
-my_uni_utf16le(const CHARSET_INFO *cs __attribute__((unused)),
+my_uni_utf16le(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
if (wc < MY_UTF16_SURROGATE_HIGH_FIRST ||
static size_t
-my_lengthsp_utf16le(const CHARSET_INFO *cs __attribute__((unused)),
+my_lengthsp_utf16le(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t length)
{
const char *end= ptr + length;
#ifdef HAVE_CHARSET_utf32
static int
-my_utf32_uni(const CHARSET_INFO *cs __attribute__((unused)),
+my_utf32_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
if (s + 4 > e)
static int
-my_uni_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_uni_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
if (s + 4 > e)
static size_t
my_caseup_utf32(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static size_t
my_casedn_utf32(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static size_t
-my_strnxfrmlen_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnxfrmlen_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
size_t len)
{
return len / 2;
static uint
-my_ismbchar_utf32(const CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)))
+my_ismbchar_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *b MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)))
{
return 4;
}
static uint
-my_mbcharlen_utf32(const CHARSET_INFO *cs __attribute__((unused)) ,
- uint c __attribute__((unused)))
+my_mbcharlen_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)) ,
+ uint c MY_ATTRIBUTE((unused)))
{
return 4;
}
static size_t
-my_snprintf_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_snprintf_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char* to, size_t n, const char* fmt, ...)
{
size_t retval;
static longlong
-my_strtoll10_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_strtoll10_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *nptr, char **endptr, int *error)
{
const char *s, *end, *start, *n_end, *true_end;
static size_t
-my_numchars_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_numchars_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e)
{
return (size_t) (e - b) / 4;
static size_t
-my_charpos_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_charpos_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e, size_t pos)
{
size_t string_length= (size_t) (e - b);
static size_t
-my_well_formed_len_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_well_formed_len_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t nchars, int *error)
{
static size_t
-my_lengthsp_utf32(const CHARSET_INFO *cs __attribute__((unused)),
+my_lengthsp_utf32(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t length)
{
const char *end= ptr + length;
static int
-my_strnncollsp_utf32_bin(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnncollsp_utf32_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
const uchar *se, *te;
size_t minlen;
};
-static int my_ucs2_uni(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_ucs2_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t * pwc, const uchar *s, const uchar *e)
{
if (s+2 > e) /* Need 2 characters */
return 2;
}
-static int my_uni_ucs2(const CHARSET_INFO *cs __attribute__((unused)) ,
+static int my_uni_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)) ,
my_wc_t wc, uchar *r, uchar *e)
{
if ( r+2 > e )
static size_t my_caseup_ucs2(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static size_t my_casedn_ucs2(const CHARSET_INFO *cs, char *src, size_t srclen,
- char *dst __attribute__((unused)),
- size_t dstlen __attribute__((unused)))
+ char *dst MY_ATTRIBUTE((unused)),
+ size_t dstlen MY_ATTRIBUTE((unused)))
{
my_wc_t wc;
int res;
static void
-my_fill_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
+my_fill_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
char *s, size_t l, int fill)
{
DBUG_ASSERT(fill <= 0xFFFF);
> 0 a > b
*/
-static int my_strnncollsp_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_strnncollsp_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
const uchar *se, *te;
size_t minlen;
}
-static uint my_ismbchar_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)))
+static uint my_ismbchar_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *b MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)))
{
return 2;
}
-static uint my_mbcharlen_ucs2(const CHARSET_INFO *cs __attribute__((unused)) ,
- uint c __attribute__((unused)))
+static uint my_mbcharlen_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)) ,
+ uint c MY_ATTRIBUTE((unused)))
{
return 2;
}
static
-size_t my_numchars_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numchars_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e)
{
return (size_t) (e-b)/2;
static
-size_t my_charpos_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
- const char *b __attribute__((unused)),
- const char *e __attribute__((unused)),
+size_t my_charpos_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const char *b MY_ATTRIBUTE((unused)),
+ const char *e MY_ATTRIBUTE((unused)),
size_t pos)
{
size_t string_length= (size_t) (e - b);
static
-size_t my_well_formed_len_ucs2(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_ucs2(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *b, const char *e,
size_t nchars, int *error)
{
}
static int my_strnncollsp_ucs2_bin(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
const uchar *se, *te;
size_t minlen;
static
-void my_hash_sort_ucs2_bin(const CHARSET_INFO *cs __attribute__((unused)),
+void my_hash_sort_ucs2_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2)
{
const uchar *pos = key;
/* Copyright (c) 2002 MySQL AB & tommy@valley.ne.jp
- Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
#define isujis_ss3(c) (((c)&0xff) == 0x8f)
-static uint ismbchar_ujis(const CHARSET_INFO *cs __attribute__((unused)),
+static uint ismbchar_ujis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char* p, const char *e)
{
return ((*(uchar*)(p)<0x80)? 0:\
0);
}
-static uint mbcharlen_ujis(const CHARSET_INFO *cs __attribute__((unused)),
+static uint mbcharlen_ujis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
return (isujis(c)? 2: isujis_ss2(c)? 2: isujis_ss3(c)? 3: 1);
*/
static
-size_t my_well_formed_len_ujis(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_well_formed_len_ujis(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *beg, const char *end,
size_t pos, int *error)
{
static
-size_t my_numcells_eucjp(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_numcells_eucjp(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *str, const char *str_end)
{
size_t clen;
@retval MY_CS_ILSEQ If a wrong byte sequence was found
*/
static int
-my_mb_wc_euc_jp(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_euc_jp(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
int hi;
@retval MY_CS_ILUNI If the Unicode character does not exist in UJIS
*/
static int
-my_wc_mb_euc_jp(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_euc_jp(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int jp;
static size_t
my_casefold_ujis(const CHARSET_INFO *cs,
char *src, size_t srclen,
- char *dst, size_t dstlen __attribute__((unused)),
+ char *dst, size_t dstlen MY_ATTRIBUTE((unused)),
uchar *map,
size_t is_upper)
{
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
}
-static int my_utf8_uni(const CHARSET_INFO *cs __attribute__((unused)),
+static int my_utf8_uni(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t * pwc, const uchar *s, const uchar *e)
{
uchar c;
for example, for a null-terminated string
*/
static int my_utf8_uni_no_range(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
my_wc_t * pwc, const uchar *s)
{
uchar c;
}
-static int my_uni_utf8 (const CHARSET_INFO *cs __attribute__((unused)),
+static int my_uni_utf8 (const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *r, uchar *e)
{
int count;
The same as above, but without range check.
*/
static int my_uni_utf8_no_range(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *r)
{
int count;
static
-size_t my_strnxfrmlen_utf8(const CHARSET_INFO *cs __attribute__((unused)),
+size_t my_strnxfrmlen_utf8(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
size_t len)
{
return (len * 2 + 2) / 3;
static
-int my_valid_mbcharlen_utf8(const CHARSET_INFO *cs __attribute__((unused)),
+int my_valid_mbcharlen_utf8(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, const uchar *e)
{
uchar c;
return (res>1) ? res : 0;
}
-static uint my_mbcharlen_utf8(const CHARSET_INFO *cs __attribute__((unused)),
+static uint my_mbcharlen_utf8(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uint c)
{
if (c < 0x80)
#define MY_FILENAME_ESCAPE '@'
static int
-my_mb_wc_filename(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_filename(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s, const uchar *e)
{
int byte1, byte2;
static int
-my_wc_mb_filename(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_filename(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *s, uchar *e)
{
int code;
static int
-my_mb_wc_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t * pwc, const uchar *s, const uchar *e)
{
uchar c;
for example, for a null-terminated string
*/
static int
-my_mb_wc_utf8mb4_no_range(const CHARSET_INFO *cs __attribute__((unused)),
+my_mb_wc_utf8mb4_no_range(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t *pwc, const uchar *s)
{
uchar c;
static int
-my_wc_mb_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *r, uchar *e)
{
int count;
The same as above, but without range check.
*/
static int
-my_wc_mb_utf8mb4_no_range(const CHARSET_INFO *cs __attribute__((unused)),
+my_wc_mb_utf8mb4_no_range(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
my_wc_t wc, uchar *r)
{
int count;
static size_t
-my_strnxfrmlen_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnxfrmlen_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
size_t len)
{
/* TODO: fix when working on WL "Unicode new version" */
static int
-my_valid_mbcharlen_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)),
+my_valid_mbcharlen_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const uchar *s, const uchar *e)
{
uchar c;
static uint
-my_mbcharlen_utf8mb4(const CHARSET_INFO *cs __attribute__((unused)), uint c)
+my_mbcharlen_utf8mb4(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)), uint c)
{
if (c < 0x80)
return 1;
-/* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#define IS_END(p, src, len) (((char *)p - (char *)src) >= (len))
static int my_strnncoll_win1250ch(const CHARSET_INFO *cs
- __attribute__((unused)),
+ MY_ATTRIBUTE((unused)),
const uchar *s1, size_t len1,
const uchar *s2, size_t len2,
my_bool s2_is_prefix)
const uchar *s, size_t slen,
const uchar *t, size_t tlen,
my_bool diff_if_only_endspace_difference
- __attribute__((unused)))
+ MY_ATTRIBUTE((unused)))
{
for ( ; slen && s[slen-1] == ' ' ; slen--);
for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
static size_t
-my_strnxfrm_win1250ch(const CHARSET_INFO *cs __attribute__((unused)),
+my_strnxfrm_win1250ch(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
uchar *dest, size_t len,
- uint nweights_arg __attribute__((unused)),
+ uint nweights_arg MY_ATTRIBUTE((unused)),
const uchar *src, size_t srclen, uint flags)
{
int value;
*/
static my_bool
-my_like_range_win1250ch(const CHARSET_INFO *cs __attribute__((unused)),
+my_like_range_win1250ch(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
const char *ptr, size_t ptr_length,
pbool escape, pbool w_one, pbool w_many,
size_t res_length,
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
- $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
+ $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null &
wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$?
# Make lock for RedHat / SuSE
-# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
%global compatch mysql-5173-charset-dir.patch
%endif
-# mysql-wsrep-5.5 has libmysqlclient.so.18, as have 5.6 and 5.7;
+# mysql-wsrep-5.5 has libmysqlclient.so.18, as has 5.6;
# same as preinstalled mariadb-libs, so we currently need no libs-compat on RHEL 7.
-# This becomes relevant with a MySQL 5.8 (or higher) that has a libmysqlclient.so.19 or higher.
+# This becomes relevant with a MySQL 5.7 (or higher) that has a libmysqlclient.so.20 or higher.
#
# %%if 0%%{?rhel} == 7
# %%global compatver 5.5.45
Obsoletes: MySQL-server-advanced
%endif
Obsoletes: mysql-server < %{version}-%{release}
-Obsoletes: mysql-server-advanced
+Obsoletes: mysql-server-advanced mysql-community-server
Obsoletes: MySQL-server-classic MySQL-server-community MySQL-server-enterprise
Obsoletes: MySQL-server-advanced-gpl MySQL-server-enterprise-gpl
%if 0%{?rhel}
# RedHat has /usr/share/mysql/* in a separate package
-Obsoletes: mysql-common
+Obsoletes: mysql-common mysql-community-common
%endif
Provides: mysql-server = %{version}-%{release}
Provides: mysql-server%{?_isa} = %{version}-%{release}
%endif
Obsoletes: mysql < %{version}-%{release}
Obsoletes: mysql-advanced < %{version}-%{release}
+Obsoletes: mysql-community-client
Obsoletes: MySQL-client-classic MySQL-client-community MySQL-client-enterprise
Obsoletes: MySQL-client-advanced-gpl MySQL-client-enterprise-gpl
Provides: mysql = %{version}-%{release}
Obsoletes: MySQL-test-advanced
%endif
Obsoletes: mysql-test < %{version}-%{release}
-Obsoletes: mysql-test-advanced
+Obsoletes: mysql-test-advanced mysql-community-test
Obsoletes: MySQL-test-classic MySQL-test-community MySQL-test-enterprise
Obsoletes: MySQL-test-advanced-gpl MySQL-test-enterprise-gpl
-Obsoletes: mysql-bench
+Obsoletes: mysql-bench mysql-community-bench
Obsoletes: MySQL-bench
Provides: mysql-test = %{version}-%{release}
Provides: mysql-test%{?_isa} = %{version}-%{release}
%endif
Obsoletes: mysql-devel < %{version}-%{release}
Obsoletes: mysql-embedded-devel mysql-devel-advanced mysql-embedded-devel-advanced
+Obsoletes: mysql-community-devel
Obsoletes: MySQL-devel-classic MySQL-devel-community MySQL-devel-enterprise
Obsoletes: MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl
Provides: mysql-devel = %{version}-%{release}
Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise
Obsoletes: MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl
# RHEL uses other names:
-Obsoletes: mysql-libs
+Obsoletes: mysql-libs mysql-community-libs
# Necessary on RHEL 7, no harm on other platforms:
Obsoletes: mariadb-libs
Provides: mysql-libs-compat = %{version}
Provides: mysql-libs-compat%{?_isa} = %{version}
Obsoletes: mysql-libs-compat < %{version}
+Obsoletes: mysql-community-libs-compat
Provides: MySQL-shared-compat%{?_isa} = %{version}
Obsoletes: MySQL-shared-compat < %{version}
# Directly, we replace "libs" only; but RedHat "client" and "server" need files from "libs"
Provides: mysql-libs = %{compatver}
Obsoletes: mysql-libs < %{version}
+Obsoletes: mysql-community-libs
%if 0%{?rhel} > 6
# Dealing with RHEL 7 and upwards (and compatible ...)
Obsoletes: MySQL-embedded-advanced
%endif
Obsoletes: mysql-embedded < %{version}-%{release}
-Obsoletes: mysql-embedded-advanced
+Obsoletes: mysql-embedded-advanced mysql-community-embedded
Obsoletes: MySQL-embedded-pro
Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise
Obsoletes: MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl
install -d $RBR%{_libdir}
install -d $RBR%{_mandir}
install -d $RBR%{_sbindir}
+install -d $RBR/var/lib/mysql-files
mkdir -p $RBR%{_sysconfdir}/my.cnf.d
%attr(755, root, root) %{_sysconfdir}/init.d/mysql
# %%attr(755, root, root) %%{_datadir}/mysql/ ## Contained in "plugins.files", see "%%install" code
%dir %attr(755, mysql, mysql) /var/lib/mysql
+%dir %attr(750, mysql, mysql) /var/lib/mysql-files
# ----------------------------------------------------------------------------
%files -n mysql-wsrep-client%{product_suffix}
# merging BK trees)
##############################################################################
%changelog
+* Fri Jun 10 2016 Joerg Bruehe <joerg.bruehe@fromdual.com>
+- Add missing "obsoletes" directives to handle Oracle's yum repository.
+- Fix comment about SO version of libmysqlclient.so.
+- Modify some changelog dates to match Oracle's (reduce differences).
+
* Fri Oct 30 2015 Joerg Bruehe <joerg.bruehe@fromdual.com>
- Combine "plugins.files" and "datadir.files" into one, it seems rpmbuild 4.4
(used on SLES 11) cannot handle two "-f" directives for one "%%files" section.
not in an RPM upgrade.
This affects both the "mkdir" and the call of "mysql_install_db".
-* Thu Feb 10 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
+* Wed Feb 09 2011 Joerg Bruehe <joerg.bruehe@oracle.com>
- Fix bug#56581: If an installation deviates from the default file locations
("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade)
- Fix some problems with the directives around "tcmalloc" (experimental),
remove erroneous traces of the InnoDB plugin (that is 5.1 only).
-* Fri Oct 09 2009 Magnus Blaudd <mvensson@mysql.com>
+* Tue Oct 06 2009 Magnus Blaudd <mvensson@mysql.com>
- Removed mysql_fix_privilege_tables
- Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS
-* Wed Mar 08 2006 Kent Boortz <kent@mysql.com>
+* Tue Mar 07 2006 Kent Boortz <kent@mysql.com>
- Changed product name from "Community Edition" to "Community Server"
- marked /etc/logrotate.d/mysql as a config file (BUG 2156)
-* Fri Dec 12 2003 Lenz Grimmer <lenz@mysql.com>
+* Sat Dec 13 2003 Lenz Grimmer <lenz@mysql.com>
- fixed file permissions (BUG 1672)
- Added separate libmysql_r directory; now both a threaded
and non-threaded library is shipped.
-* Wed Sep 29 1999 David Axmark <davida@mysql.com>
+* Tue Sep 28 1999 David Axmark <davida@mysql.com>
- Added the support-files/my-example.cnf to the docs directory.
-/* Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights
+/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights
* reserved.
This program is free software; you can redistribute it and/or modify
static struct my_tests_st *my_testlist= 0;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
}
+/*
+ Bug#22559575: "the statement (1) has no open cursor" pops
+ sometimes with prepared+query_cache
+*/
+
+static void bug22559575_base(unsigned long type)
+{
+ MYSQL_STMT *stmt;
+ int rc;
+ const char stmt_text[] ="SELECT a FROM t22559575";
+ MYSQL_RES *prepare_meta = NULL;
+ MYSQL_BIND bind[1];
+ short data;
+ unsigned long length;
+
+ stmt = mysql_stmt_init(mysql);
+ check_stmt(stmt);
+ if (type == CURSOR_TYPE_READ_ONLY)
+ {
+ rc = mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void*)&type);
+ check_execute(stmt, rc);
+ }
+ rc = mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ check_execute(stmt, rc);
+ prepare_meta = mysql_stmt_result_metadata(stmt);
+ DIE_UNLESS(prepare_meta != NULL);
+ rc= mysql_stmt_execute(stmt);
+ check_execute(stmt, rc);
+
+ memset(bind, 0, sizeof(bind));
+ bind[0].buffer_type= MYSQL_TYPE_SHORT;
+ bind[0].buffer= (void *)&data;
+ bind[0].length= &length;
+ rc= mysql_stmt_bind_result(stmt, bind);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_store_result(stmt);
+ check_execute(stmt, rc);
+
+ rc= mysql_stmt_fetch(stmt);
+ check_execute(stmt, rc);
+ DIE_UNLESS(data == 1);
+
+ mysql_free_result(prepare_meta);
+ rc= mysql_stmt_close(stmt);
+ check_execute(stmt, rc);
+}
+
+static void test_bug22559575()
+{
+ int rc;
+
+ rc= mysql_query(mysql, "CREATE TABLE t22559575(a SMALLINT)");
+ myquery(rc);
+ rc= mysql_query(mysql, "INSERT INTO t22559575 VALUES (1)");
+ myquery(rc);
+
+ /* Should not cache */
+ bug22559575_base(CURSOR_TYPE_READ_ONLY);
+ bug22559575_base(CURSOR_TYPE_READ_ONLY);
+ /* Should save to cache */
+ bug22559575_base(CURSOR_TYPE_NO_CURSOR);
+ /* Should use cache */
+ bug22559575_base(CURSOR_TYPE_NO_CURSOR);
+ /* should not use cache */
+ bug22559575_base(CURSOR_TYPE_READ_ONLY);
+
+ rc= mysql_query(mysql, "DROP TABLE t22559575");
+ myquery(rc);
+}
+
static struct my_tests_st my_tests[]= {
{ "disable_query_logs", disable_query_logs },
{ "test_view_sp_list_fields", test_view_sp_list_fields },
{ "test_bug17512527", test_bug17512527},
{ "test_bug20810928", test_bug20810928 },
{ "test_bug17883203", test_bug17883203 },
+ { "test_bug22559575", test_bug22559575 },
{ 0, 0 }
};
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
uint tcp_port;
#ifndef __WIN__
-void *test_thread(void *arg __attribute__((unused)))
+void *test_thread(void *arg MY_ATTRIBUTE((unused)))
#else
-unsigned __stdcall test_thread(void *arg __attribute__((unused)))
+unsigned __stdcall test_thread(void *arg MY_ATTRIBUTE((unused)))
#endif
{
MYSQL *mysql;
static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
switch (optid) {
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ADD_SUBDIRECTORY(gunit)
+
ADD_CUSTOM_TARGET(
test-unit
- COMMAND perl ${CMAKE_CURRENT_SOURCE_DIR}/unit.pl run .
+ COMMAND ctest
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
-# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-# We want gmock-1.6.0.zip in order to build these unit tests.
+# We want release-1.8.0.zip in order to build these unit tests.
# If you have already downloaded it,
-# invoke cmake with -DWITH_GMOCK=/path/to/gmock-1.6.0.zip
+# invoke cmake with -DWITH_GMOCK=/path/to/release-1.8.0.zip
# or -DWITH_GMOCK=/path/to
#
# Alternatively, set an environment variable
-# export WITH_GMOCK=/path/to/gmock-1.6.0.zip
+# export WITH_GMOCK=/path/to/release-1.8.0.zip
#
# You can also do cmake -DENABLE_DOWNLOADS=1
-# and we will download it from http://googlemock.googlecode.com
+# and we will download it from https://github.com/google/googletest/archive/
#
# Either way: we will unpack the zip, compile gmock-all.cc and gtest-all.cc
# and link them into the executables.
-# Where to download and build gmock/gtest.
+# Disable googletest for Solaris Studio < 12.4 since it doesn't compile.
+IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
+ IF(${CC_MINOR_VERSION} LESS 13)
+ MESSAGE(WARNING "Googletest requires Solaris Studio 12.4 or newer.")
+ UNSET(GMOCK_FOUND)
+ UNSET(GMOCK_FOUND CACHE)
+ RETURN()
+ ENDIF()
+ENDIF()
+
+# Default location for where to download and build gmock/gtest.
IF(NOT DOWNLOAD_ROOT)
SET(DOWNLOAD_ROOT ${CMAKE_SOURCE_DIR}/source_downloads)
ENDIF()
-IF(NOT EXISTS DOWNLOAD_ROOT)
- MAKE_DIRECTORY(${DOWNLOAD_ROOT})
-ENDIF()
-# We want googlemock version 1.6, which also contains googletest.
-SET(GMOCK_PACKAGE_NAME "gmock-1.6.0")
-SET(GMOCK_SOURCE_DIR ${DOWNLOAD_ROOT}/${GMOCK_PACKAGE_NAME})
-SET(GTEST_SOURCE_DIR ${DOWNLOAD_ROOT}/${GMOCK_PACKAGE_NAME}/gtest)
+# We want googletest version 1.8, which also contains googlemock.
+SET(GMOCK_PACKAGE_NAME "release-1.8.0")
IF (DEFINED ENV{WITH_GMOCK} AND NOT DEFINED WITH_GMOCK)
- SET(WITH_GMOCK "$ENV{WITH_GMOCK}")
+ FILE(TO_CMAKE_PATH "$ENV{WITH_GMOCK}" WITH_GMOCK)
+ENDIF()
+
+IF(LOCAL_GMOCK_ZIP
+ AND NOT ${LOCAL_GMOCK_ZIP} MATCHES ".*${GMOCK_PACKAGE_NAME}\\.zip")
+ SET(LOCAL_GMOCK_ZIP 0)
ENDIF()
IF (WITH_GMOCK)
PATHS ${GMOCK_DIR}
NO_DEFAULT_PATH
)
+ ELSE()
+ ## Did we get a path name to the directory of the .zip file?
+ ## Check for both release-x.y.z.zip and googletest-release-x.y.z.zip
+ FIND_FILE(LOCAL_GMOCK_ZIP
+ NAMES "${GMOCK_PACKAGE_NAME}.zip" "googletest-${GMOCK_PACKAGE_NAME}.zip"
+ PATHS ${WITH_GMOCK}
+ NO_DEFAULT_PATH
+ )
+ ## If WITH_GMOCK is a directory, use it for download.
+ SET(DOWNLOAD_ROOT ${WITH_GMOCK})
ENDIF()
- ## Did we get a path name to the directory of the .zip file?
- FIND_FILE(LOCAL_GMOCK_ZIP
- NAMES "${GMOCK_PACKAGE_NAME}.zip"
- PATHS ${WITH_GMOCK}
- NO_DEFAULT_PATH
- )
MESSAGE(STATUS "Local gmock zip ${LOCAL_GMOCK_ZIP}")
ENDIF()
+IF(NOT EXISTS DOWNLOAD_ROOT)
+ MAKE_DIRECTORY(${DOWNLOAD_ROOT})
+ENDIF()
+SET(GMOCK_SOURCE_DIR ${DOWNLOAD_ROOT}/googletest-${GMOCK_PACKAGE_NAME}/googlemock)
+SET(GTEST_SOURCE_DIR ${DOWNLOAD_ROOT}/googletest-${GMOCK_PACKAGE_NAME}/googletest)
+
# We may have downloaded gmock/gtest already, building in a different directory.
-IF(EXISTS ${GMOCK_SOURCE_DIR})
+IF(EXISTS ${GMOCK_SOURCE_DIR} OR EXISTS ${LOCAL_GMOCK_ZIP})
MESSAGE(STATUS "GMOCK_SOURCE_DIR:${GMOCK_SOURCE_DIR}")
SET(GMOCK_DOWNLOADED 1 CACHE INTERNAL "")
SET(GMOCK_FOUND 1 CACHE INTERNAL "")
+# If source dir does not exist, reset dependent variables (might be set from before).
+ELSE()
+ SET(LOCAL_GMOCK_ZIP 0 CACHE INTERNAL "")
+ SET(GMOCK_DOWNLOADED 0 CACHE INTERNAL "")
+ SET(GMOCK_FOUND 0 CACHE INTERNAL "")
+ SET(GMOCK_INCLUDE_DIRS 0 CACHE INTERNAL "")
ENDIF()
OPTION(ENABLE_DOWNLOADS
- "Download and build 3rd party source code components, e.g. google mock"
+ "Download and build 3rd party source code components, e.g. googletest"
OFF)
# While experimenting, use local URL rather than google.
-SET(GMOCK_TARBALL "${GMOCK_PACKAGE_NAME}.zip")
+SET(GMOCK_TARBALL "googletest-${GMOCK_PACKAGE_NAME}.zip")
SET(GMOCK_DOWNLOAD_URL
- "http://googlemock.googlecode.com/files/${GMOCK_TARBALL}"
+ "https://github.com/google/googletest/archive/${GMOCK_PACKAGE_NAME}.zip"
)
MACRO(HTTP_PROXY_HINT)
MESSAGE(STATUS
- "If you are inside a firewall, you may need to use an http proxy: "
- "export http_proxy=http://example.com:80")
+ "If you are inside a firewall, you may need to use an https proxy: "
+ "export https_proxy=http://example.com:80")
ENDMACRO()
IF(NOT GMOCK_FOUND)
IF(NOT ENABLE_DOWNLOADS)
- # Give one-time warning
- IF(NOT ONETIME_GTEST_WARNING)
- MESSAGE(STATUS
- "Googlemock was not found. gtest-based unit tests will be disabled. "
- "You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download "
- "and build required components from source.")
- HTTP_PROXY_HINT()
- SET(ONETIME_GTEST_WARNING 1 CACHE INTERNAL "")
- ENDIF()
+ # Give warning
+ MESSAGE(STATUS
+ "Googletest was not found. gtest-based unit tests will be disabled. "
+ "You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download "
+ "and build required components from source.")
+ HTTP_PROXY_HINT()
RETURN()
ENDIF()
- # Download gmock source
+ # Download googletest source
IF(NOT EXISTS ${GMOCK_SOURCE_DIR})
IF(NOT EXISTS ${DOWNLOAD_ROOT}/${GMOCK_TARBALL})
# Download the tarball
"Successfully downloaded ${GMOCK_DOWNLOAD_URL} to ${DOWNLOAD_ROOT}")
ELSE()
MESSAGE(STATUS
- "To enable google test, please download ${GMOCK_DOWNLOAD_URL} "
+ "To enable googletest, please download ${GMOCK_DOWNLOAD_URL} "
"to the directory ${DOWNLOAD_ROOT}")
HTTP_PROXY_HINT()
RETURN()
-/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
push_errtext(); \
for (int method_i= 0, combination_i= 0; method_i < MAX_METHOD; method_i++) { \
for (int sid_map_i= 0; sid_map_i < MAX_SID_MAP; sid_map_i++, combination_i++) { \
- Gtid_set >id_set __attribute__((unused))= \
+ Gtid_set >id_set MY_ATTRIBUTE((unused))= \
containers[combination_i]->gtid_set; \
- Sid_map *&sid_map __attribute__((unused))= \
+ Sid_map *&sid_map MY_ATTRIBUTE((unused))= \
sid_maps[sid_map_i]; \
append_errtext(__LINE__, \
"sid_map_i=%d method_i=%d combination_i=%d", \
for (int end_i= 0; end_i < MAX_END; end_i++) { \
for (int empty_i= 0; empty_i < MAX_EMPTY; empty_i++) { \
for (int anon_i= 0; anon_i < MAX_ANON; anon_i++, combination_i++) { \
- Gtid_set >id_set __attribute__((unused))= \
+ Gtid_set >id_set MY_ATTRIBUTE((unused))= \
containers[combination_i]->gtid_set; \
- Group_cache &stmt_cache __attribute__((unused))= \
+ Group_cache &stmt_cache MY_ATTRIBUTE((unused))= \
containers[combination_i]->stmt_cache; \
- Group_cache &trx_cache __attribute__((unused))= \
+ Group_cache &trx_cache MY_ATTRIBUTE((unused))= \
containers[combination_i]->trx_cache; \
- Group_log_state &group_log_state __attribute__((unused))= \
+ Group_log_state &group_log_state MY_ATTRIBUTE((unused))= \
containers[combination_i]->group_log_state; \
append_errtext(__LINE__, \
"type_i=%d end_i=%d empty_i=%d " \
-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
const_cast<char*>("--log_syslog=0"),
const_cast<char*>("--explicit_defaults_for_timestamp"),
const_cast<char*>("--datadir=" DATA_DIR),
+ const_cast<char*>("--secure-file-priv=NULL"),
const_cast<char*>("--lc-messages-dir=" ERRMSG_DIR), 0 };
- set_remaining_args(5, argv);
+ set_remaining_args(6, argv);
mysql_mutex_init(key_LOCK_error_log, &LOCK_error_log, MY_MUTEX_INIT_FAST);
system_charset_info= &my_charset_utf8_general_ci;
sys_var_init();
-# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 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
ADD_EXECUTABLE(yassl-t yassl-t.cc)
TARGET_LINK_LIBRARIES(yassl-t gunit_small sqlgunitlib strings dbug regex)
TARGET_LINK_LIBRARIES(yassl-t ${LIBSOCKET})
+ADD_TEST(yassl yassl-t)
-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
void ok(int const pass, char const *fmt, ...)
- __attribute__((format(printf,2,3)));
+ MY_ATTRIBUTE((format(printf,2,3)));
/**
*/
void skip(int how_many, char const *reason, ...)
- __attribute__((format(printf,2,3)));
+ MY_ATTRIBUTE((format(printf,2,3)));
/**
*/
void diag(char const *fmt, ...)
- __attribute__((format(printf,1,2)));
+ MY_ATTRIBUTE((format(printf,1,2)));
/**
*/
void BAIL_OUT(char const *fmt, ...)
- __attribute__((noreturn, format(printf,1,2)));
+ MY_ATTRIBUTE((noreturn, format(printf,1,2)));
/**
*/
void skip_all(char const *reason, ...)
- __attribute__((noreturn, format(printf, 1, 2)));
+ MY_ATTRIBUTE((noreturn, format(printf, 1, 2)));
/**
*/
void todo_start(char const *message, ...)
- __attribute__((format(printf, 1, 2)));
+ MY_ATTRIBUTE((format(printf, 1, 2)));
/**
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
int
-main( int argc __attribute__((unused)),
+main( int argc MY_ATTRIBUTE((unused)),
char** argv)
{
char client_key[] = "../SSL/client-key.pem", client_cert[] = "../SSL/client-cert.pem";
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
int
-main(int argc __attribute__((unused)), char** argv)
+main(int argc MY_ATTRIBUTE((unused)), char** argv)
{
char server_key[] = "../SSL/server-key.pem",
server_cert[] = "../SSL/server-cert.pem";
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@retval 1 The requested I/O event has occurred.
*/
-static int no_io_wait(Vio *vio __attribute__((unused)),
- enum enum_vio_io_event event __attribute__((unused)),
- int timeout __attribute__((unused)))
+static int no_io_wait(Vio *vio MY_ATTRIBUTE((unused)),
+ enum enum_vio_io_event event MY_ATTRIBUTE((unused)),
+ int timeout MY_ATTRIBUTE((unused)))
{
return 1;
}
#endif
-static my_bool has_no_data(Vio *vio __attribute__((unused)))
+static my_bool has_no_data(Vio *vio MY_ATTRIBUTE((unused)))
{
return FALSE;
}
*/
my_bool vio_reset(Vio* vio, enum enum_vio_type type,
- my_socket sd, void *ssl __attribute__((unused)), uint flags)
+ my_socket sd, void *ssl MY_ATTRIBUTE((unused)), uint flags)
{
int ret= FALSE;
Vio new_vio;
/*
- Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
# include <sys/filio.h>
#endif
-int vio_errno(Vio *vio __attribute__((unused)))
+int vio_errno(Vio *vio MY_ATTRIBUTE((unused)))
{
/* These transport types are not Winsock based. */
#ifdef _WIN32
int vio_socket_timeout(Vio *vio,
- uint which __attribute__((unused)),
- my_bool old_mode __attribute__((unused)))
+ uint which MY_ATTRIBUTE((unused)),
+ my_bool old_mode MY_ATTRIBUTE((unused)))
{
int ret= 0;
DBUG_ENTER("vio_socket_timeout");
}
-int vio_fastsend(Vio * vio __attribute__((unused)))
+int vio_fastsend(Vio * vio MY_ATTRIBUTE((unused)))
{
int r=0;
DBUG_ENTER("vio_fastsend");
int vio_io_wait(Vio *vio, enum enum_vio_io_event event, int timeout)
{
int ret;
- short revents __attribute__((unused)) = 0;
+ short revents MY_ATTRIBUTE((unused)) = 0;
struct pollfd pfd;
my_socket sd= mysql_socket_getfd(vio->mysql_socket);
MYSQL_SOCKET_WAIT_VARIABLES(locker, state) /* no ';' */
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
/* Load certs from the trusted ca */
- if (SSL_CTX_load_verify_locations(ssl_fd->ssl_context, ca_file, ca_path) == 0)
+ if (SSL_CTX_load_verify_locations(ssl_fd->ssl_context, ca_file, ca_path) <= 0)
{
DBUG_PRINT("warning", ("SSL_CTX_load_verify_locations failed"));
if (ca_file || ca_path)
static char* dummy_options_get (wsrep_t* w)
{
WSREP_DBUG_ENTER(w);
- return WSREP_DUMMY(w)->options;
+ return strdup(WSREP_DUMMY(w)->options);
}
static wsrep_status_t dummy_connect(
* Library loader
**************************************************************************/
+static int wsrep_check_iface_version(const char* found, const char* iface_ver)
+{
+ const size_t msg_len = 128;
+ char msg[128];
+
+ if (strcmp(found, iface_ver)) {
+ snprintf (msg, msg_len,
+ "provider interface version mismatch: need '%s', found '%s'",
+ iface_ver, found);
+ logger (WSREP_LOG_ERROR, msg);
+ return EINVAL;
+ }
+
+ return 0;
+}
+
static int verify(const wsrep_t *wh, const char *iface_ver)
{
const size_t msg_len = 128;
VERIFY(wh);
VERIFY(wh->version);
- if (strcmp(wh->version, iface_ver)) {
- snprintf (msg, msg_len,
- "provider interface version mismatch: need '%s', found '%s'",
- iface_ver, wh->version);
- logger (WSREP_LOG_ERROR, msg);
+ if (wsrep_check_iface_version(wh->version, iface_ver))
return EINVAL;
- }
VERIFY(wh->init);
VERIFY(wh->options_set);
return alias.dlfun;
}
+static int wsrep_check_version_symbol(void *dlh)
+{
+ char** dlversion = NULL;
+ dlversion = (char**) dlsym(dlh, "wsrep_interface_version");
+ if (dlversion == NULL)
+ return 0;
+ return wsrep_check_iface_version(*dlversion, WSREP_INTERFACE_VERSION);
+}
+
extern int wsrep_dummy_loader(wsrep_t *w);
int wsrep_load(const char *spec, wsrep_t **hptr, wsrep_log_cb_t log_cb)
goto out;
}
+ if (wsrep_check_version_symbol(dlh) != 0) {
+ ret = EINVAL;
+ goto out;
+ }
+
if ((ret = (*dlfun)(*hptr)) != 0) {
snprintf(msg, msg_len, "wsrep_load(): loader failed: %s",
strerror(ret));