server icon indicating copy to clipboard operation
server copied to clipboard

[MDEV-14978] Client programs to use $MARIADB_HOST consistently

Open oceanli-hub opened this issue 2 years ago • 6 comments

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.

oceanli-hub avatar Mar 16 '23 20:03 oceanli-hub

CLA assistant check
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.

CLAassistant avatar Mar 16 '23 20:03 CLAassistant

This is an improved take on #1067. Please review and merge, thanks!

ottok avatar Mar 18 '23 22:03 ottok

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!

oceanli-hub avatar Apr 18 '23 17:04 oceanli-hub

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.

oceanli-hub avatar May 05 '23 20:05 oceanli-hub

@LinuxJedi thanks for the feedback, I pushed a new revision based off your comments. Please review again.

oceanli-hub avatar Apr 10 '24 00:04 oceanli-hub

@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?

oceanli-hub avatar Jul 15 '24 23:07 oceanli-hub

@grooverdan @LinuxJedi I rebased the commit onto the main branch. Please let me know if you need anything else from me.

oceanli-hub avatar Aug 30 '24 23:08 oceanli-hub