Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for MySQL version check subroutine (issue #7) #14

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 23 additions & 17 deletions mysqltuner.pl
Expand Up @@ -463,25 +463,31 @@ sub mysql_version_ge {
# Checks for 32-bit boxes with more than 2GB of RAM
my ($arch);
sub check_architecture {
if ($doremote eq 1) { return; }
if (`uname` =~ /SunOS/ && `isainfo -b` =~ /64/) {
$arch = 64;
goodprint "Operating on 64-bit architecture\n";
} elsif (`uname` !~ /SunOS/ && `uname -m` =~ /64/) {
# We assume that 32-bit version is used by default
$arch = 32;

# If version_compile_machine ends with 64
# then we have 64-bit MySQL on non-Windows OS
if ($myvar{'version_compile_machine'} =~ /64$/) {
$arch = 64;
goodprint "Operating on 64-bit architecture\n";
} elsif (`uname` =~ /AIX/ && `bootinfo -K` =~ /64/) {
goodprint "Operating on 64-bit version of MySQL\n";
} elsif ($myvar{'version_compile_os'} =~ /64$/) {
# We have 64-bit version of MySQL on 64-bit Windows OS
$arch = 64;
goodprint "Operating on 64-bit architecture\n";
} else {
$arch = 32;
if ($physical_memory > 2147483648) {
badprint "Switch to 64-bit OS - MySQL cannot currently use all of your RAM\n";
} else {
goodprint "Operating on 32-bit architecture with less than 2GB RAM\n";
}
}
}
goodprint "Operating on 64-bit version of MySQL\n";
}

# Check for available memory and suggest switching to
# 64-bit version of mysql
if ($arch == 32) {
if ($physical_memory > 2147483648) {
badprint "Switch to 64-bit version of MySQL\n";
badprint "MySQL cannot currently use all of your RAM\n";
} else {
goodprint "Operating on 32-bit version of MySQL with less than 2GB RAM\n";
}
} # end-if-32-bit-arch-check
} #end-sub-check_architecture

# Start up a ton of storage engine counts/statistics
my (%enginestats,%enginecount,$fragtables);
Expand Down