mariadb/mysql-test/std_data/bug57108.cnf
Mats Kindahl d817b7cb8a 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.
2010-11-04 11:00:59 +01:00

95 lines
2.9 KiB
INI

[mysqld]
open-files-limit=1024
character-set-server=latin1
connect-timeout=4711
log-bin-trust-function-creators=1
key_buffer_size=1M
sort_buffer=256K
max_heap_table_size=1M
loose-innodb_data_file_path=ibdata1:10M:autoextend
loose-innodb_buffer_pool_size=8M
loose-innodb_write_io_threads=2
loose-innodb_read_io_threads=2
loose-innodb_log_buffer_size=1M
loose-innodb_log_file_size=5M
loose-innodb_additional_mem_pool_size=1M
loose-innodb_log_files_in_group=2
slave-net-timeout=120
log-bin=mysqld-bin
loose-enable-performance-schema
loose-performance-schema-max-mutex-instances=10000
loose-performance-schema-max-rwlock-instances=10000
loose-performance-schema-max-table-instances=500
loose-performance-schema-max-table-handles=1000
binlog-direct-non-transactional-updates
[mysql]
default-character-set=latin1
[mysqlshow]
default-character-set=latin1
[mysqlimport]
default-character-set=latin1
[mysqlcheck]
default-character-set=latin1
[mysql_upgrade]
default-character-set=latin1
tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp
[mysqld.1]
#!run-master-sh
log-bin=master-bin
loose-enable-performance-schema
basedir=/home/bzr/bugs/b57108-5.5-bugteam
tmpdir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1
character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets
lc-messages-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/
datadir=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/data
pid-file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/run/mysqld.1.pid
#host=localhost
port=13000
socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
#log-error=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/log/mysqld.1.err
general_log=1
general_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld.log
slow_query_log=1
slow_query_log_file=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/mysqld.1/mysqld-slow.log
#user=root
#password=
server-id=1
secure-file-priv=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var
ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem
ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-cert.pem
ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/server-key.pem
[mysqlbinlog]
disable-force-if-open
character-sets-dir=/home/bzr/bugs/b57108-5.5-bugteam/sql/share/charsets
[ENV]
MASTER_MYPORT=13000
MASTER_MYSOCK=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
[client]
password=
user=root
port=13000
host=localhost
socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock
[mysqltest]
ssl-ca=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/cacert.pem
ssl-cert=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-cert.pem
ssl-key=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/std_data/client-key.pem
skip-ssl=1
[client.1]
password=
user=root
port=13000
host=localhost
socket=/home/bzr/bugs/b57108-5.5-bugteam/mysql-test/var/tmp/mysqld.1.sock