Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 4df766729cc8582daa4ba9f28ec9c09fdf7f0752 1 parent a1d7114
@scop scop authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 mysqltuner.pl
View
16 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 {
Please sign in to comment.
Something went wrong with that request. Please try again.