summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2020-07-27 11:51:50 +1000
committerDaniel Black <daniel@mariadb.org>2020-07-28 09:08:36 +1000
commitbeec8404fa967bd2617a8da50a80930356877980 (patch)
treedcbf9a6049c2c6afdcde1dd4ba6130a4bdb7ae37
parent99af3cbc854a4f9319c5c1f6db9f1289b4f773e1 (diff)
downloadmariadb-git-beec8404fa967bd2617a8da50a80930356877980.tar.gz
MDEV-17076: mtr int options aren't negative
-rwxr-xr-xmysql-test/mysql-test-run.pl11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 65fac0ce5be..52920530132 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -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 =~ / /)