summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tsmith@ramayana.hindu.god>2007-12-07 14:43:31 -0700
committerunknown <tsmith@ramayana.hindu.god>2007-12-07 14:43:31 -0700
commitf77684f3a8da57a113d8c607c5a3d5b895b98952 (patch)
treea759aa7852e9b8518fe5cc21206d3e527e6556f0
parenta4df22109cbe2278192722404def28bd68e59c8e (diff)
downloadmariadb-git-f77684f3a8da57a113d8c607c5a3d5b895b98952.tar.gz
Add a way to remove options which mysql-test-run.pl no longer uses.
mysql-test/mysql-test-run.pl: Add a way to remove options which mysql-test-run.pl no longer uses. Since mysql-test-run.pl passes unrecognized options through to mysqld directly, it is not possible to just remove an option. Otherwise it would be given to mysqld, which probably will not recognize it and will fail to start. Instead, we now explicitly ignore the option, and print a warning to the user.
-rwxr-xr-xmysql-test/mysql-test-run.pl25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 8428f5a63b9..42298d635e7 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -461,6 +461,19 @@ sub main () {
#
##############################################################################
+#
+# When an option is no longer used by this program, it must be explicitly
+# ignored or else it will be passed through to mysqld. GetOptions will call
+# this subroutine once for each such option on the command line. See
+# Getopt::Long documentation.
+#
+
+sub warn_about_removed_option {
+ my ($option, $value, $hash_value) = @_;
+
+ warn "WARNING: This option is no longer used, and is ignored: --$option\n";
+}
+
sub command_line_setup () {
# These are defaults for things that are set on the command line
@@ -498,6 +511,15 @@ sub command_line_setup () {
# Read the command line
# Note: Keep list, and the order, in sync with usage at end of this file
+ # Options that are no longer used must still be processed, because all
+ # unprocessed options are passed directly to mysqld. The user will be
+ # warned that the option is being ignored.
+ #
+ # Put the complete option string here. For example, to remove the --suite
+ # option, remove it from GetOptions() below and put 'suite|suites=s' here.
+ my @removed_options = (
+ );
+
Getopt::Long::Configure("pass_through");
GetOptions(
# Control what engine/variation to run
@@ -626,6 +648,9 @@ sub command_line_setup () {
'suite-timeout=i' => \$opt_suite_timeout,
'warnings|log-warnings' => \$opt_warnings,
+ # Options which are no longer used
+ (map { $_ => \&warn_about_removed_option } @removed_options),
+
'help|h' => \$opt_usage,
) or usage("Can't read options");