diff --git a/mysql-test/main/mysqld_option_err.result b/mysql-test/main/mysqld_option_err.result index c59d038a3965a..346b9ee28dd41 100644 --- a/mysql-test/main/mysqld_option_err.result +++ b/mysql-test/main/mysqld_option_err.result @@ -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 diff --git a/mysql-test/main/mysqld_option_err.test b/mysql-test/main/mysqld_option_err.test index 2b98ef0fb9304..f4c0680d6617c 100644 --- a/mysql-test/main/mysqld_option_err.test +++ b/mysql-test/main/mysqld_option_err.test @@ -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 @@ -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 diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 24cab0250c4c6..66ef671001921 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -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) {