[mysqltuner] Patch to fix various engine availability related issues (#682477).

Ville Skyttä scop at fedoraproject.org
Sun Mar 6 11:20:29 UTC 2011


commit e5d063384aacdba1bc1b9fdfc423851514a3886b
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun Mar 6 13:20:13 2011 +0200

    Patch to fix various engine availability related issues (#682477).

 ...etection-of-Federated-engine-availability.patch |   26 ++++++++++++
 ...ngine-availability-also-with-SHOW-ENGINES.patch |   42 ++++++++++++++++++++
 ...-MySQL-bug-59393-wrt.-ignore-builtin-inno.patch |   27 +++++++++++++
 mysqltuner.spec                                    |   12 +++++-
 4 files changed, 106 insertions(+), 1 deletions(-)
---
diff --git a/0002-Fix-detection-of-Federated-engine-availability.patch b/0002-Fix-detection-of-Federated-engine-availability.patch
new file mode 100644
index 0000000..18911ec
--- /dev/null
+++ b/0002-Fix-detection-of-Federated-engine-availability.patch
@@ -0,0 +1,26 @@
+From a1d71147595e27019021b2c88ca4bcd4438624ed Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta at iki.fi>
+Date: Sun, 6 Mar 2011 12:53:32 +0200
+Subject: [PATCH 2/4] Fix detection of Federated engine availability.
+
+The variable is have_federated_engine, not have_federated.
+---
+ mysqltuner.pl |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/mysqltuner.pl b/mysqltuner.pl
+index 7ab2ec1..8bc7b56 100755
+--- a/mysqltuner.pl
++++ b/mysqltuner.pl
+@@ -455,7 +455,7 @@ sub check_storage_engines {
+ 	my $engines;
+ 	$engines .= (defined $myvar{'have_archive'} && $myvar{'have_archive'} eq "YES")? greenwrap "+Archive " : redwrap "-Archive " ;
+ 	$engines .= (defined $myvar{'have_bdb'} && $myvar{'have_bdb'} eq "YES")? greenwrap "+BDB " : redwrap "-BDB " ;
+-	$engines .= (defined $myvar{'have_federated'} && $myvar{'have_federated'} eq "YES")? greenwrap "+Federated " : redwrap "-Federated " ;
++	$engines .= (defined $myvar{'have_federated_engine'} && $myvar{'have_federated_engine'} eq "YES")? greenwrap "+Federated " : redwrap "-Federated " ;
+ 	$engines .= (defined $myvar{'have_innodb'} && $myvar{'have_innodb'} eq "YES")? greenwrap "+InnoDB " : redwrap "-InnoDB " ;
+ 	$engines .= (defined $myvar{'have_isam'} && $myvar{'have_isam'} eq "YES")? greenwrap "+ISAM " : redwrap "-ISAM " ;
+ 	$engines .= (defined $myvar{'have_ndbcluster'} && $myvar{'have_ndbcluster'} eq "YES")? greenwrap "+NDBCluster " : redwrap "-NDBCluster " ;	
+-- 
+1.7.4
+
diff --git a/0003-Check-engine-availability-also-with-SHOW-ENGINES.patch b/0003-Check-engine-availability-also-with-SHOW-ENGINES.patch
new file mode 100644
index 0000000..30977e1
--- /dev/null
+++ b/0003-Check-engine-availability-also-with-SHOW-ENGINES.patch
@@ -0,0 +1,42 @@
+From 4df766729cc8582daa4ba9f28ec9c09fdf7f0752 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta at iki.fi>
+Date: Sun, 6 Mar 2011 12:59:46 +0200
+Subject: [PATCH 3/4] Check engine availability also with SHOW ENGINES.
+
+have_$engine are deprecated and will be removed in MySQL 5.6, and some
+of them are either missing in some versions before that or show wrong
+values - see e.g. MySQL bugs #47286 and #59393.
+---
+ mysqltuner.pl |   16 ++++++++++++++++
+ 1 files changed, 16 insertions(+), 0 deletions(-)
+
+diff --git a/mysqltuner.pl b/mysqltuner.pl
+index 8bc7b56..c83c793 100755
+--- a/mysqltuner.pl
++++ b/mysqltuner.pl
+@@ -354,6 +354,22 @@ sub get_all_vars {
+ 		$line =~ /([a-zA-Z_]*)\s*(.*)/;
+ 		$mystat{$1} = $2;
+ 	}
++	# have_* for engines is deprecated and will be removed in MySQL 5.6;
++	# check SHOW ENGINES and set corresponding old style variables.
++	# Also works around MySQL bug #59393 wrt. skip-innodb
++	my @mysqlenginelist = `mysql $mysqllogin -Bse "SHOW ENGINES;" 2>/dev/null`;
++	foreach my $line (@mysqlenginelist) {
++		if ($line =~ /^([a-zA-Z_]+)\s+(\S+)/) {
++			my $engine = lc($1);
++			if ($engine eq "federated" || $engine eq "blackhole") {
++				$engine .= "_engine";
++			} elsif ($engine eq "berkeleydb") {
++				$engine = "bdb";
++			}
++			my $val = ($2 eq "DEFAULT") ? "YES" : $2;
++			$myvar{"have_$engine"} = $val;
++		}
++	}
+ }
+ 
+ sub security_recommendations {
+-- 
+1.7.4
+
diff --git a/0004-Work-around-MySQL-bug-59393-wrt.-ignore-builtin-inno.patch b/0004-Work-around-MySQL-bug-59393-wrt.-ignore-builtin-inno.patch
new file mode 100644
index 0000000..07d3214
--- /dev/null
+++ b/0004-Work-around-MySQL-bug-59393-wrt.-ignore-builtin-inno.patch
@@ -0,0 +1,27 @@
+From 778cc60885ab0901f5a511dc056ef0c22f9f15e9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta at iki.fi>
+Date: Sun, 6 Mar 2011 13:04:08 +0200
+Subject: [PATCH 4/4] Work around MySQL bug #59393 wrt. ignore-builtin-innodb.
+
+---
+ mysqltuner.pl |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/mysqltuner.pl b/mysqltuner.pl
+index c83c793..085af70 100755
+--- a/mysqltuner.pl
++++ b/mysqltuner.pl
+@@ -354,6 +354,10 @@ sub get_all_vars {
+ 		$line =~ /([a-zA-Z_]*)\s*(.*)/;
+ 		$mystat{$1} = $2;
+ 	}
++	# Workaround for MySQL bug #59393 wrt. ignore-builtin-innodb
++	if (($myvar{'ignore_builtin_innodb'} || "") eq "ON") {
++		$myvar{'have_innodb'} = "NO";
++	}
+ 	# have_* for engines is deprecated and will be removed in MySQL 5.6;
+ 	# check SHOW ENGINES and set corresponding old style variables.
+ 	# Also works around MySQL bug #59393 wrt. skip-innodb
+-- 
+1.7.4
+
diff --git a/mysqltuner.spec b/mysqltuner.spec
index e07ce9a..bb35db5 100644
--- a/mysqltuner.spec
+++ b/mysqltuner.spec
@@ -3,7 +3,7 @@
 
 Name:           mysqltuner
 Version:        1.1.1
-Release:        3.%{gitdate}git%{?dist}
+Release:        4.%{gitdate}git%{?dist}
 Summary:        MySQL configuration assistant
 
 Group:          Applications/Databases
@@ -11,6 +11,10 @@ License:        GPLv3+
 URL:            http://mysqltuner.com/
 # http://github.com/rackerhacker/MySQLTuner-perl/tarball/master
 Source0:        rackerhacker-MySQLTuner-perl-v%{version}-1-g%{gitrev}.tar.gz
+# Patches 0-2: https://github.com/rackerhacker/MySQLTuner-perl/pull/3
+Patch0:         0002-Fix-detection-of-Federated-engine-availability.patch
+Patch1:         0003-Check-engine-availability-also-with-SHOW-ENGINES.patch
+Patch2:         0004-Work-around-MySQL-bug-59393-wrt.-ignore-builtin-inno.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -26,6 +30,9 @@ MySQL installation and the areas where it can be improved.
 
 %prep
 %setup -q -n rackerhacker-MySQLTuner-perl-%{gitrev}
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 
 %build
@@ -47,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Sun Mar  6 2011 Ville Skyttä <ville.skytta at iki.fi> - 1.1.1-4.20100125git
+- Patch to fix various engine availability related issues (#682477).
+
 * Mon Feb 28 2011 Ville Skyttä <ville.skytta at iki.fi> - 1.1.1-3.20100125git
 - Update to git revision e8495ce for users w/o passwords listing improvements.
 


More information about the scm-commits mailing list