Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mysql-test/main/mysqld_option_err.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Test that unknown option is not silently ignored.
Test bad binlog format.
Test empty value for --create-tmp-table-binlog-formats is rejected.
FOUND 1 /create-tmp-table-binlog-formats cannot be empty/ in mysqltest.log
Test bad default storage engine.
Test non-numeric value passed to number option.
Test with invalid path
Expand Down
11 changes: 9 additions & 2 deletions mysql-test/main/mysqld_option_err.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --log-bin --binlog-format=badformat >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1


--echo Test empty value for --create-tmp-table-binlog-formats is rejected.
--error 1
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --create-tmp-table-binlog-formats= >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1

--let SEARCH_FILE = $MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log

--let SEARCH_PATTERN=create-tmp-table-binlog-formats cannot be empty
--source include/search_pattern_in_file.inc

--echo Test bad default storage engine.
--error 1
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --default-storage-engine=nonexistentengine >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
Expand All @@ -50,8 +59,6 @@ mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
--error 1
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --plugin-maturity=experimental --plugin-load=example=ha_example --plugin-example=FORCE --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1

--let SEARCH_FILE = $MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log

--echo Test to see if multiple unknown options will be displayed in the error output
--error 7
--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --nonexistentoption2 --alsononexistent --nonexistentvariable=1 >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
Expand Down
7 changes: 7 additions & 0 deletions sql/mysqld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9186,6 +9186,13 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
OLD_MODE_COMPAT_5_1_CHECKSUM);
}

if (!global_system_variables.create_temporary_table_binlog_formats)
{
sql_print_error("--create-tmp-table-binlog-formats cannot be empty. "
"Allowed values are STATEMENT or MIXED,STATEMENT");
return 1;
}

if (global_system_variables.net_buffer_length >
global_system_variables.max_allowed_packet)
{
Expand Down