From 3f619478f796eddbba6e39502fe941b285dd97b1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:00:34 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- mysql-test/main/mysqld--defaults-file.test | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 mysql-test/main/mysqld--defaults-file.test (limited to 'mysql-test/main/mysqld--defaults-file.test') diff --git a/mysql-test/main/mysqld--defaults-file.test b/mysql-test/main/mysqld--defaults-file.test new file mode 100644 index 00000000..9ca42756 --- /dev/null +++ b/mysql-test/main/mysqld--defaults-file.test @@ -0,0 +1,50 @@ +# BUG#58455 +# Starting mysqld with defaults file without extension cause +# segmentation fault + +source include/not_embedded.inc; +source include/not_windows.inc; +source include/not_aix.inc; + +# All these tests refer to configuration files that do not exist + +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1 +exec $MYSQLD --defaults-file=/path/with/no/extension --print-defaults 2>&1; + +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1 +exec $MYSQLD --defaults-file=/path/with.ext --print-defaults 2>&1; + +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1 +exec $MYSQLD --defaults-file=relative/path/with.ext --print-defaults 2>&1; + +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1 +exec $MYSQLD --defaults-file=relative/path/without/extension --print-defaults 2>&1; + +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1 +exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1; + +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--error 1 +exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1; + +--echo # +--echo # MDEV-21374: When "--help --verbose" prints out configuration file paths, +--echo # the --defaults-file option is not considered +--echo # + +--echo # Test on `defaults-file` +--replace_result $MYSQLTEST_REAL_VARDIR MYSQLTEST_VARDIR +exec $MYSQLD --defaults-file=$MYSQLTEST_VARDIR/my.cnf --help --verbose | grep -A 1 'Default options are read'; + +--echo # Test on `defaults-extra-file` +# = `/etc/my.cnf /etc/mysql/my.cnf` +# Using sysconfdir configuration, we don't always have `/etc/mysql/my.cnf`, so replace them with a regex as well. +copy_file $MYSQLTEST_VARDIR/my.cnf $MYSQLTEST_VARDIR/my_test.cnf; +--replace_regex /.*my_test.cnf/ MYSQLTEST_VARDIR\/my_test.cnf/ +exec $MYSQLD --defaults-extra-file=$MYSQLTEST_VARDIR/my_test.cnf --help --verbose | grep -A 1 'Default options are read'; +remove_file $MYSQLTEST_VARDIR/my_test.cnf; -- cgit v1.2.3