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

Fix mysql via mariadb warns about being deprecated (#6183) #6189

Open
wants to merge 1 commit into
base: 13.x
Choose a base branch
from

Conversation

MakerTim
Copy link
Contributor

@MakerTim MakerTim commented Jan 3, 2025

See #6183 for context

In short, this PR will prevent the following message while being fully compatible with mysql as a dropin replacement

"mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead"
When the mysql-binary is removed, this code-change will still be fully working with mariadb.

@weitzman
Copy link
Member

weitzman commented Jan 3, 2025

#6183 is for Drupal 7 which requires Drush 8.x. This PR is for Drush 13. Are you sure this is needed in Drush 13?

@MakerTim
Copy link
Contributor Author

MakerTim commented Jan 3, 2025

I understand that the issue has the starting direction of Drupal-7.
But the underlying issue is that mariadb-client throws this warning.

I can make a new issue if you like that more, but since both cases inside issue #6183 where SSL issues with a warning, which is fixed by this pr, This is to stop red-harrings and stop the warning from comming.

@greg-1-anderson
Copy link
Member

Seems like this will be needed for anyone using the most recent versions of the mariadb client. I'm not sure which version introduced the behavior described in the above-referenced issue.

@MakerTim
Copy link
Contributor Author

MakerTim commented Jan 3, 2025

It seems introduced in 11.4.x, we encounter it in 11.4.4

$process = Drush::shell('mysql --version');
$process->setSimulated(false);
$process->run();
if ((!$process->isSuccessful() || strpos($process->getOutput(), 'MariaDB') !== false) && self::programExists('mariadb')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't figure out what the double parens do here. Did you mean to surround so that the || condition is more clearly evaluated? Also, lets keep using str_contains() and not strpos()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs code style fix

PSR12.Classes.OpeningBraceSpace.Found at /home/wodby/drush/src/Sql/SqlMariaDB.php (8:1)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|| and && ordering is not always clear to read and changes in every language, so my nature makes them explicit so when im changing languages there is no question if the order is correct

"mysql: Deprecated program name. It will be removed in a future release, use '/usr/bin/mariadb' instead"
@MakerTim MakerTim force-pushed the 13.x--native-mariadb-support branch from f474a64 to 169c999 Compare January 6, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants