1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-33469 Fix behavior on invalid arguments

When passing in an invalid value (e.g. incorrect data type) for a variable, the
server startup will fail with misleading error messages.

The behavior **before** this change:

For server options:
- The error message will indicate that the argument is being adjusted to a valid value
- Server startup still fails

For plugin options:
- The error message will indicate that the argument is being adjusted to a valid value
- The plugin is still disabled
- Server startup fails with a message that it does not recognize the plugin option

The behavior **after** this change:

For server options:
- Output that an invalid argument was provided
- Exit server startup

For plugin options:
- Output that an invalid argument was provided
- Disable the plugin
- Attempt to continue server startup

All new code of the whole pull request, including one or several files that are
either new files or modified ones, are contributed under the BSD-new license. I
am contributing on behalf of my employer Amazon Web Services, Inc.
This commit is contained in:
Tony Chen
2024-02-25 02:03:44 +00:00
committed by Daniel Black
parent dd639985c1
commit 47d75cdd80
4 changed files with 13 additions and 3 deletions

View File

@ -61,7 +61,7 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--echo Test to see if multiple ambiguous options and invalid arguments will be displayed in the error output
--error 1
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --getopt-prefix-matching --sql-mode=invalid_value --character --bootstrap=partstoob >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --getopt-prefix-matching --sql-mode=invalid_value --character --bootstrap=partstoob --binlog_cache_size=18446744073709551616 >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--let SEARCH_PATTERN=Error while setting value 'invalid_value' to 'sql_mode'
--source include/search_pattern_in_file.inc
@ -69,6 +69,10 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=option '--bootstrap' cannot take an argument
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=Incorrect integer value: '18446744073709551616'
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=Error while setting value '18446744073709551616' to 'binlog_cache_size'
--source include/search_pattern_in_file.inc
#
# Test that an wrong option with --help --verbose gives an error