1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge 10.9 into 10.10

This commit is contained in:
Marko Mäkelä
2023-05-02 10:22:43 +03:00
21 changed files with 211 additions and 615 deletions

View File

@@ -299,8 +299,6 @@ unsigned short terminal_width= 80;
static uint opt_protocol=0;
static const char *opt_protocol_type= "";
static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
#include "sslopt-vars.h"
const char *default_dbug_option="d:t:o,/tmp/mariadb.trace";
@@ -1269,14 +1267,6 @@ int main(int argc,char *argv[])
exit(status.exit_status);
}
/* Command line options override configured protocol */
if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
&& protocol_to_force != opt_protocol)
{
warn_protocol_override(current_host, &opt_protocol, protocol_to_force);
}
if (status.batch && !status.line_buff &&
!(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin)))
{
@@ -1870,11 +1860,9 @@ static void usage(int version)
my_bool
get_one_option(const struct my_option *opt, const char *argument, const char *filename)
get_one_option(const struct my_option *opt, const char *argument,
const char *filename)
{
/* Track when protocol is set via CLI to not force port TCP protocol override */
static my_bool ignore_protocol_override = FALSE;
switch(opt->id) {
case OPT_CHARSETS_DIR:
strmake_buf(mysql_charsets_dir, argument);
@@ -1935,18 +1923,11 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
#ifndef EMBEDDED_LIBRARY
if (!argument[0])
opt_protocol= 0;
else if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
else if ((opt_protocol=
find_type_with_warning(argument, &sql_protocol_typelib,
opt->name)) <= 0)
exit(1);
#endif
/* Specification of protocol via CLI trumps implicit overrides */
if (filename[0] == '\0')
{
ignore_protocol_override = TRUE;
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
}
break;
case OPT_SERVER_ARG:
#ifdef EMBEDDED_LIBRARY
@@ -2046,13 +2027,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
#ifdef _WIN32
opt_protocol = MYSQL_PROTOCOL_PIPE;
opt_protocol_type= "pipe";
/* Prioritize pipe if explicit via command line */
if (filename[0] == '\0')
{
ignore_protocol_override = TRUE;
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
}
#endif
break;
#include <sslopt-case.h>
@@ -2065,35 +2039,17 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
mysql_end(-1);
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;
case 'I':