Skip to content

Commit 8347faf

Browse files
committed
improve "$arch" variable usage
- handle the (default!) undefined case; - really treat it as a number (cause that's the way it is defined everywhere in "check_architecture", and it is compared to a number too); - (try to) avoid extra ops by reordering the operations.
1 parent d9eef7d commit 8347faf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mysqltuner.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ sub mysql_stats {
763763

764764
# Memory usage
765765
infoprint "Total buffers: ".hr_bytes($mycalc{'server_buffers'})." global + ".hr_bytes($mycalc{'per_thread_buffers'})." per thread ($myvar{'max_connections'} max threads)\n";
766-
if ($mycalc{'total_possible_used_memory'} > 2*1024*1024*1024 && $arch eq 32) {
766+
if ($arch && $arch == 32 && $mycalc{'total_possible_used_memory'} > 2*1024*1024*1024) {
767767
badprint "Allocating > 2GB RAM on 32-bit systems can cause system instability\n";
768768
badprint "Maximum possible memory usage: ".hr_bytes($mycalc{'total_possible_used_memory'})." ($mycalc{'pct_physical_memory'}% of installed RAM)\n";
769769
} elsif ($mycalc{'pct_physical_memory'} > 85) {

0 commit comments

Comments
 (0)