diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:00:34 +0000 |
commit | 3f619478f796eddbba6e39502fe941b285dd97b1 (patch) | |
tree | e2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/mysqld--defaults-file.test | |
parent | Initial commit. (diff) | |
download | mariadb-upstream.tar.xz mariadb-upstream.zip |
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/mysqld--defaults-file.test')
-rw-r--r-- | mysql-test/main/mysqld--defaults-file.test | 50 |
1 files changed, 50 insertions, 0 deletions
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` +# <first-defaults> = `/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/<first-defaults> 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; |