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

Merge 10.6 into 10.8

This commit is contained in:
Marko Mäkelä
2023-04-27 17:14:36 +03:00
18 changed files with 177 additions and 606 deletions

View File

@@ -41,8 +41,6 @@ static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static uint opt_protocol=0;
static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
static void get_options(int *argc,char ***argv);
static uint opt_mysql_port=0;
static int list_dbs(MYSQL *mysql,const char *wild);
@@ -81,14 +79,6 @@ int main(int argc, char **argv)
get_options(&argc,&argv);
/* Command line options override configured protocol */
if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
&& protocol_to_force != opt_protocol)
{
warn_protocol_override(host, &opt_protocol, protocol_to_force);
}
sf_leaking_memory=0; /* from now on we cleanup properly */
wild=0;
if (argc)
@@ -308,9 +298,6 @@ get_one_option(const struct my_option *opt, const char *argument,
const char *filename)
{
/* Track when protocol is set via CLI to not force overrides */
static my_bool ignore_protocol_override = FALSE;
switch(opt->id) {
case 'v':
opt_verbose++;
@@ -339,13 +326,6 @@ get_one_option(const struct my_option *opt, const char *argument,
case 'W':
#ifdef _WIN32
opt_protocol = MYSQL_PROTOCOL_PIPE;
/* Prioritize pipe if explicit via command line */
if (filename[0] == '\0')
{
ignore_protocol_override = TRUE;
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
}
#endif
break;
case OPT_MYSQL_PROTOCOL:
@@ -355,47 +335,22 @@ get_one_option(const struct my_option *opt, const char *argument,
sf_leaking_memory= 1; /* no memory leak reports here */
exit(1);
}
/* Specification of protocol via CLI trumps implicit overrides */
if (filename[0] == '\0')
{
ignore_protocol_override = TRUE;
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
}
break;
case 'P':
/* If port and socket are set, fall back to default behavior */
if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
if (filename[0] == '\0')
{
ignore_protocol_override = TRUE;
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
}
/* If port is set via CLI, try to force protocol to TCP */
if (filename[0] == '\0' &&
!ignore_protocol_override &&
protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
{
protocol_to_force = MYSQL_PROTOCOL_TCP;
/* Port given on command line, switch protocol to use TCP */
opt_protocol= MYSQL_PROTOCOL_TCP;
}
break;
case 'S':
/* If port and socket are set, fall back to default behavior */
if (protocol_to_force == MYSQL_PROTOCOL_TCP)
if (filename[0] == '\0')
{
ignore_protocol_override = TRUE;
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
}
/* Prioritize socket if set via command line */
if (filename[0] == '\0' &&
!ignore_protocol_override &&
protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
{
protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
/* Socket given on command line, switch protocol to use SOCKETSt */
opt_protocol= MYSQL_PROTOCOL_SOCKET;
}
break;
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
debug_check_flag= 1;