Skip to content

Commit

Permalink
MDEV-17076: mtr int options aren't negative
Browse files Browse the repository at this point in the history
  • Loading branch information
grooverdan committed Jul 27, 2020
1 parent 99af3cb commit beec840
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mysql-test/mysql-test-run.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,17 @@ sub command_line_setup {
report_option('verbose', $opt_verbose);
}

# Negative values aren't meaningful on integer options
foreach(grep(/=i$/, keys %options))
{
if (defined ${$options{$_}} &&
do { no warnings "numeric"; int ${$options{$_}} < 0})
{
my $v= (split /=/)[0];
die("$v doesn't accept a negative value:");
}
}

# Find the absolute path to the test directory
$glob_mysql_test_dir= cwd();
if ($glob_mysql_test_dir =~ / /)
Expand Down

0 comments on commit beec840

Please sign in to comment.