Fix for issue #7 about more reliable MySQL version reckognition.

Adopting scop's idea for MySQL version check. Now should work as discussed, both for local and remote servers.
This commit is contained in:
Dimiter 'Arruor' Nikov 2011-12-30 15:07:46 +02:00
parent f75e9d039b
commit 77d23981be

View file

@ -463,28 +463,30 @@ sub mysql_version_ge {
# Checks for 32-bit boxes with more than 2GB of RAM # Checks for 32-bit boxes with more than 2GB of RAM
my ($arch); my ($arch);
sub check_architecture { sub check_architecture {
# Checking MySQL compiled version # We assume that 32-bit version is used by default
if ($myvar{'version_compile_machine'} =~ /x86_64/) { $arch = 32;
# We have 64-bit version of MySQL
# 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; $arch = 64;
goodprint "Operating on 64-bit version of MySQL\n"; goodprint "Operating on 64-bit version of MySQL\n";
} elsif ($myvar{'version_compile_machine'} =~ /i*86/) { } elsif ($myvar{'version_compile_os'} =~ /64$/) {
# We have 32-bit version of MySQL # We have 64-bit version of MySQL on 64-bit Windows OS
$arch = 32; $arch = 64;
goodprint "Operating on 64-bit version of MySQL\n";
}
# Check for available memory and suggest switching to # Check for available memory and suggest switching to
# 64-bit version of mysql # 64-bit version of mysql
if ($arch == 32) {
if ($physical_memory > 2147483648) { if ($physical_memory > 2147483648) {
badprint "Switch to 64-bit version of MySQL\n"; badprint "Switch to 64-bit version of MySQL\n";
badprint "MySQL cannot currently use all of your RAM\n"; badprint "MySQL cannot currently use all of your RAM\n";
} else { } else {
goodprint "Operating on 32-bit version of MySQL with less than 2GB RAM\n"; goodprint "Operating on 32-bit version of MySQL with less than 2GB RAM\n";
} }
} else { } # end-if-32-bit-arch-check
# Unknown version or missing compile string
$arch = 0;
badprint "Operating on unknown version of MySQL\n"
}
} #end-sub-check_architecture } #end-sub-check_architecture
# Start up a ton of storage engine counts/statistics # Start up a ton of storage engine counts/statistics