Commit 744d545f authored by Sergei Golubchik's avatar Sergei Golubchik

restore support for --defaults-file=<(...)

if my_realpath() fails, don't return the error code, get_defaults_options()
returns a number of options consumed, not 0=ok/1=error.

instead, ignore the error from my_realpath. If it fails it internally
falls back to my_load_path, which restores 10.4- behavior
parent 8bcbdaf7
...@@ -2,11 +2,11 @@ Could not open required defaults file: /path/with/no/extension ...@@ -2,11 +2,11 @@ Could not open required defaults file: /path/with/no/extension
Fatal error in defaults handling. Program aborted Fatal error in defaults handling. Program aborted
Could not open required defaults file: /path/with.ext Could not open required defaults file: /path/with.ext
Fatal error in defaults handling. Program aborted Fatal error in defaults handling. Program aborted
Could not open required defaults file: relative/path/with.ext Could not open required defaults file: MYSQL_TEST_DIR/relative/path/with.ext
Fatal error in defaults handling. Program aborted Fatal error in defaults handling. Program aborted
Could not open required defaults file: relative/path/without/extension Could not open required defaults file: MYSQL_TEST_DIR/relative/path/without/extension
Fatal error in defaults handling. Program aborted Fatal error in defaults handling. Program aborted
Could not open required defaults file: with.ext Could not open required defaults file: MYSQL_TEST_DIR/with.ext
Fatal error in defaults handling. Program aborted Fatal error in defaults handling. Program aborted
Could not open required defaults file: no_extension Could not open required defaults file: MYSQL_TEST_DIR/no_extension
Fatal error in defaults handling. Program aborted Fatal error in defaults handling. Program aborted
...@@ -7,21 +7,27 @@ source include/not_windows.inc; ...@@ -7,21 +7,27 @@ source include/not_windows.inc;
# All these tests refer to configuration files that do not exist # All these tests refer to configuration files that do not exist
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--error 1 --error 1
exec $MYSQLD --defaults-file=/path/with/no/extension --print-defaults 2>&1; exec $MYSQLD --defaults-file=/path/with/no/extension --print-defaults 2>&1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--error 1 --error 1
exec $MYSQLD --defaults-file=/path/with.ext --print-defaults 2>&1; exec $MYSQLD --defaults-file=/path/with.ext --print-defaults 2>&1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--error 1 --error 1
exec $MYSQLD --defaults-file=relative/path/with.ext --print-defaults 2>&1; exec $MYSQLD --defaults-file=relative/path/with.ext --print-defaults 2>&1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--error 1 --error 1
exec $MYSQLD --defaults-file=relative/path/without/extension --print-defaults 2>&1; exec $MYSQLD --defaults-file=relative/path/without/extension --print-defaults 2>&1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--error 1 --error 1
exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1; exec $MYSQLD --defaults-file=with.ext --print-defaults 2>&1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--error 1 --error 1
exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1; exec $MYSQLD --defaults-file=no_extension --print-defaults 2>&1;
...@@ -322,17 +322,13 @@ int get_defaults_options(char **argv) ...@@ -322,17 +322,13 @@ int get_defaults_options(char **argv)
if (my_defaults_extra_file && my_defaults_extra_file != extra_file_buffer) if (my_defaults_extra_file && my_defaults_extra_file != extra_file_buffer)
{ {
int error= my_realpath(extra_file_buffer, my_defaults_extra_file, MYF(0)); my_realpath(extra_file_buffer, my_defaults_extra_file, MYF(0));
if (error)
return error;
my_defaults_extra_file= extra_file_buffer; my_defaults_extra_file= extra_file_buffer;
} }
if (my_defaults_file && my_defaults_file != file_buffer) if (my_defaults_file && my_defaults_file != file_buffer)
{ {
int error= my_realpath(file_buffer, my_defaults_file, MYF(0)); my_realpath(file_buffer, my_defaults_file, MYF(0));
if (error)
return error;
my_defaults_file= file_buffer; my_defaults_file= file_buffer;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment