1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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

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.

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.
This commit is contained in:
Ocean Li
2024-07-15 18:54:55 +00:00
committed by Andrew Hutchings
parent 383d1f90dd
commit eedbb901e5
11 changed files with 152 additions and 17 deletions

View File

@@ -145,8 +145,9 @@ static struct my_option my_long_options[] =
0, 0 },
{"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"host",'h', "Connect to host.", &current_host,
&current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"host",'h', "Connect to host. Defaults in the following order: "
"$MARIADB_HOST, and then localhost",
&current_host, &current_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"medium-check", 'm',
"Faster than extended-check, but only finds 99.99 percent of all errors. Should be good enough for most cases.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -413,6 +414,9 @@ static int get_options(int *argc, char ***argv)
int ho_error;
DBUG_ENTER("get_options");
if (current_host == NULL)
current_host= getenv("MARIADB_HOST");
if (*argc == 1)
{
usage();