Skip to content

Commit

Permalink
Use of uninitialized value #304
Browse files Browse the repository at this point in the history
tidify script
  • Loading branch information
jmrenouard committed Mar 6, 2017
1 parent 48be29a commit f04b32c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion USAGE.md
Expand Up @@ -140,4 +140,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.
38 changes: 26 additions & 12 deletions mysqltuner.pl
Expand Up @@ -1230,6 +1230,9 @@ sub cve_recommendations {
return;
}

#$mysqlvermajor=10;
#$mysqlverminor=1;
#$mysqlvermicro=17;
#prettyprint "Look for related CVE for $myvar{'version'} or lower in $opt{cvefile}";
my $cvefound = 0;
open( my $fh, "<", $opt{cvefile} )
Expand Down Expand Up @@ -1514,8 +1517,8 @@ sub get_system_info {
else {
badprint "Internet : Disconnected";
}
$result{'OS'}{'NbCore'}= `nproc`;
infoprint "Number of Core CPU : ". `nproc`;
$result{'OS'}{'NbCore'} = `nproc`;
infoprint "Number of Core CPU : " . `nproc`;
$result{'OS'}{'Type'} = `uname -o`;
infoprint "Operating System Type : " . infocmd_one "uname -o";
$result{'OS'}{'Kernel'} = `uname -r`;
Expand Down Expand Up @@ -2771,7 +2774,9 @@ sub mysql_stats {
}

# name resolution
if ( defined( $result{'Variables'}{'skip_networking'} ) && $result{'Variables'}{'skip_networking'} eq 'ON' ) {
if ( defined( $result{'Variables'}{'skip_networking'} )
&& $result{'Variables'}{'skip_networking'} eq 'ON' )
{
infoprint
"Skipped name resolution test due to skip_networking=ON in system variables.";
}
Expand Down Expand Up @@ -4993,6 +4998,7 @@ sub get_wsrep_option {
return '' unless scalar(@galera_options) > 0;
my @memValues = grep /\s*$key =/, @galera_options;
my $memValue = $memValues[0];
return 0 unless defined $memValue;
$memValue =~ s/.*=\s*(.+)$/$1/g;
return $memValue;
}
Expand Down Expand Up @@ -5041,32 +5047,40 @@ sub mariadb_galera {
having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0"
);

if (get_wsrep_option('wsrep_slave_threads') > `nproc`*4 or get_wsrep_option('wsrep_slave_threads') < `nproc`*3) {
badprint "wsrep_slave_threads is not equal to 3 or 4 times number of CPU(s)";
if ( get_wsrep_option('wsrep_slave_threads') > `nproc` * 4
or get_wsrep_option('wsrep_slave_threads') < `nproc` * 3 )
{
badprint
"wsrep_slave_threads is not equal to 3 or 4 times number of CPU(s)";
push @adjvars, "wsrep_slave_threads= Nb of Core CPU * 4";
} else {
goodprint "wsrep_slave_threads is equal to 3 or 4 times number of CPU(s)";
}
}
else {
goodprint
"wsrep_slave_threads is equal to 3 or 4 times number of CPU(s)";
}

if (get_wsrep_option('gcs.limit') != get_wsrep_option('wsrep_slave_threads') *5 ) {
if ( get_wsrep_option('gcs.limit') !=
get_wsrep_option('wsrep_slave_threads') * 5 )
{
badprint "gcs.limit should be equal to 5 * wsrep_slave_threads";
push @adjvars, "gcs.limit= wsrep_slave_threads * 5";
}
else {
goodprint "gcs.limit is equal to 5 * wsrep_slave_threads";
}
if (get_wsrep_option('gcs.fc_factor') == 0.8 ) {
if ( get_wsrep_option('gcs.fc_factor') == 0.8 ) {
badprint "gcs.fc_factor should be equal to 0.8";
push @adjvars, "gcs.fc_factor=0.8";
}
else {
goodprint "gcs.limit is equal to 5 * wsrep_slave_threads";
}
if (get_wsrep_option('wsrep_flow_control_paused') > 0.02) {
if ( get_wsrep_option('wsrep_flow_control_paused') > 0.02 ) {
badprint "Fraction of time node pause flow control > 0.02";
}
else {
goodprint "Flow control fraction seems to be OK (wsrep_flow_control_paused<=0.02)";
goodprint
"Flow control fraction seems to be OK (wsrep_flow_control_paused<=0.02)";
}
if ( scalar(@primaryKeysNbTables) > 0 ) {
badprint "Following table(s) don't have primary key:";
Expand Down

0 comments on commit f04b32c

Please sign in to comment.