Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providers broken with MariaDB 11 #1580

Open
jantman opened this issue Jul 7, 2023 · 4 comments · May be fixed by #1626 or #1645
Open

Providers broken with MariaDB 11 #1580

jantman opened this issue Jul 7, 2023 · 4 comments · May be fixed by #1626 or #1645

Comments

@jantman
Copy link

jantman commented Jul 7, 2023

Describe the Bug

MariaDB 11 is out, and has deprecated the mysql (and mysqldump and mysqladmin) commands in favor of mariadb commands. The mysql commands now issue a deprecation message when used, which breaks the provider. e.g.:

Error: Could not prefetch mysql_database provider 'mysql': Execution of '/usr/bin/mysql -NBe show variables like '%_database' /usr/bin/mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead' returned 1: /usr/bin/mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
ERROR 1102 (42000): Incorrect database name '/usr/bin/mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/ma...'

And if we just run mysql directly on the command line:

# mysql
mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3927
Server version: 11.0.2-MariaDB Arch Linux

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Expected Behavior

The provider will work, without throwing errors because of the deprecation message. Ideally, the provider will detect the presence of mariadb (etc.) commands and prefer those over mysql commands (at least if the engine that's running is MariaDB). Or, failing that, the provider won't error out on the deprecation message.

Steps to Reproduce

  1. Install MariaDB 11.0.2 client.
  2. Use any of the features in this module which call out to the mysql binary.

Environment

  • Version: 15.0.0 (latest)
  • Platform: Arch Linux, Puppet 7.24.0
@neufeind
Copy link

neufeind commented Mar 20, 2024

Possible quickfix could imho be in lib/puppet/provider/mysql.rb to adjust mysql_caller. There add a version-compare if mariadb newer than 11.0.0 is used. Then use mariadb_raw instead of mysql_raw (copy those lines). And define a command mariadb_raw of course. Maybe there is a cleaner solution, but for the moment it worked for me.

OxCom pushed a commit to OxCom/puppetlabs-mysql that referenced this issue Mar 29, 2024
@OxCom OxCom linked a pull request Mar 29, 2024 that will close this issue
OxCom added a commit to OxCom/puppetlabs-mysql that referenced this issue Apr 9, 2024
Marc-DRI added a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Aug 27, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
Marc-DRI added a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Aug 28, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
Marc-DRI added a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Aug 28, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
Marc-DRI added a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Aug 28, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
@Marc-DRI Marc-DRI linked a pull request Aug 28, 2024 that will close this issue
neomilium pushed a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Sep 12, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
@ajdelgado
Copy link

ajdelgado commented Sep 20, 2024

The mysql command with MariaDB 11 is a symlink to the mariadb command. So probably a cleaner check will be to check if the mysql_caller is a symlink to mariadb and then use it, or just use the target of the link.
Or just ignore the stderr that shows the deprecation message.

@Marc-DRI
Copy link
Contributor

The mysql command with MariaDB 11 is a symlink to the mariadb command. So probably a cleaner check will be to check if the mysql_caller is a symlink to mariadb and then use it, or just use the target of the link.

@ajdelgado : As explained in the warning: "It will be removed in a future release". Your proposal is working for now but will be obsolete when MariaDB will remove this symlink.

@ajdelgado
Copy link

true, closing this PR

Marc-DRI added a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Sep 25, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
Marc-DRI added a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Sep 25, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
Marc-DRI added a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Sep 25, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
neomilium pushed a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Oct 11, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
neomilium pushed a commit to DRI-Syloe/puppetlabs-mysql that referenced this issue Oct 16, 2024
From MariaDB 11.x, mysql* names are deprecated
(cf. https://jira.mariadb.org/browse/MDEV-29582).

Use mariadb* names instead, to set factors accordingly.
Use these factors to return the proper client binary.

Co-authored-by: Sylvain Luce <[email protected]>
Co-authored-by: Nicolas Le Gaillart <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants