[MDEV-26512] my_print_defaults --defaults-extra-file does not work in 10.5 and later Created: 2021-08-31  Updated: 2021-09-06  Resolved: 2021-09-06

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.5.10, 10.5.11, 10.6.4
Fix Version/s: 10.5.12

Type: Bug Priority: Major
Reporter: Danilo Spinella Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: Compatibility
Environment:

openSUSE Tumbleweed, SUSE Linux Enterprise Server 15 SP3



 Description   

my_print_defaults --defaults-extra-file=/etc/mynode1.cnf doesn't read the extra file starting form version 10.5. The extra file contains the datadir; the output from my_print_defaults is used by the SUSE script mysql-systemd-helper. Missing datadir, this script will run mysql_install_db on a fallback directory, causing errors when mariadb is started.

I have tested this on mariadb version 10.5.10 and 10.6.4 on Tumbleweed and version 10.5.11 on SUSE Linux Enterprise Server 15 SP3.

To test I have created a file /etc/mynode1.cnf:

[mysqld]
port = 3310
datadir = /var/lib/mysql/node1/databases
pid-file = /var/lib/mysql/node1/databases/mysqld.pid
socket = /run/mysql/node1mysql.sock
log-error = /var/log/mysql/node1/mysqld.log
secure_file_priv = /var/lib/mysql-files

Then run the following command:

/usr/bin/my_print_defaults mysqld mysqld_multi "node1" --defaults-file=/etc/mynode1.cnf

On mariadb 10.4 my_print_defaults print the following output:

// default options, left out
--port=3310
--datadir=/var/lib/mysql/node1/databases
--pid-file=/var/lib/mysql/node1/databases/mysqld.pid
--socket=/run/mysql/node1mysql.sock
--log-error=/var/log/mysql/node1/mysqld.log
--secure_file_priv=/var/lib/mysql-files

On newer version, starting from 10.5, the options from the extra files are left out.

I have read the diff for mysys/my_default.c between branch 10.4 and branch 10.5, it seems to me that it has been completely rewritten. The "Upgrading from 10.4 to 10.5" page doesn't refer this change, so this could potentially be a newly introduced bug.



 Comments   
Comment by Danilo Spinella [ 2021-09-02 ]

I have tried with version newer versions 10.5.12 and 10.6.4 and this issue has been resolved.

Generated at Thu Feb 08 09:45:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.