summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMats Kindahl <mats.kindahl@oracle.com>2010-11-04 11:00:59 +0100
committerMats Kindahl <mats.kindahl@oracle.com>2010-11-04 11:00:59 +0100
commitd817b7cb8af1f0f4754ffd14135a86660a23006d (patch)
treec5426bf51ab430f6ea8c6d3ff41aed4633f171b9 /include
parent69aea87d5f424efc92708a44d0d3753958210610 (diff)
downloadmariadb-git-d817b7cb8af1f0f4754ffd14135a86660a23006d.tar.gz
BUG#57108: mysqld crashes when I attempt to install plugin
If a relative path is supplied to option --defaults-file or --defaults-extra-file, the server will crash when executing an INSTALL PLUGIN command. The reason is that the defaults file is initially read relative the current working directory when the server is started, but when INSTALL PLUGIN is executed, the server has changed working directory to the data directory. Since there is no check that the call to my_load_defaults() inside mysql_install_plugin(), the subsequence call to free_defaults() will crash the server. This patch fixes the problem by: - Prepending the current working directory to the file name when a relative path is given to the --defaults-file or --defaults- extra-file option the first time my_load_defaults() is called, which is just after the server has started in main(). - Adding a check of the return value of my_load_defaults() inside mysql_install_plugin() and aborting command (with an error) if an error is returned. - It also adds a check of the return value for load_defaults in lib_sql.cc for the embedded server since that was missing. To test that the relative files for the options --defaults-file and --defaults-extra-file is handled properly, mysql-test-run.pl is also changed to not add a --defaults-file option if one is provided in the tests *.opt file.
Diffstat (limited to 'include')
-rw-r--r--include/my_sys.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index 23c9b2da55f..7b437e2a745 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -256,7 +256,7 @@ extern my_bool my_disable_locking, my_disable_async_io,
extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;
/* from default.c */
-extern char *my_defaults_extra_file;
+extern const char *my_defaults_extra_file;
extern const char *my_defaults_group_suffix;
extern const char *my_defaults_file;