[MDEV-14978] Client programs to use $MARIADB_HOST consistently
Description
Note: mysql_upgrade already uses environment variable as default. This feature was not added in for mysql_plugin and mysqltest
Only mysql client program was using $MYSQL_HOST as the default host.
Add the same feature in most other client programs but using $MARIADB_HOST instead.
How can this PR be tested?
Set up environment variable export MARIADB_HOST=your_test_server
Run each client program with the following commands:
client/mysqlslap -h another_test_server -P 3306 -u admin -p
client/mysqlslap -P 3306 -u admin -p
Verify that $MARIADB_HOST is used when -h is not specified. Also verify $MARIADB_HOST does not override command line argument.
Basing the PR against the correct MariaDB version
- [X] This is a new feature and the PR is based against the latest MariaDB development branch
Copyright
All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
This is an improved take on #1067. Please review and merge, thanks!
Hi @grooverdan I updated my pull requested based off your feedback. I also updated the help function to include $MARIADB_HOST. In mysqlbinlog and mysqldump the memory is freed at the end during clean up so I was getting SIGSEV error when trying to use assignment. Assignments work for all the other client programs.
For mysql client program would you like me to change it to $MARIADB_HOST in this pr also?
Thanks for the review!
I pushed a new revision based off feedback. $MARIADB_HOST is added the mysql client program. For the MTR test, I created client-env-variable.cnf and added positive tests to show the connection is there.
@LinuxJedi thanks for the feedback, I pushed a new revision based off your comments. Please review again.
@grooverdan @LinuxJedi I rebased the commit onto 11.6 branch. The failing buildbots appear to be just flaky MTR tests. Can you help re-run those?
@grooverdan @LinuxJedi I rebased the commit onto the main branch. Please let me know if you need anything else from me.