Skip to content

Commit 0005f2f

Browse files
committed
Merge branch 'bb-10.11-release' into bb-11.0-release
2 parents 5ba3baf + 4e2b93d commit 0005f2f

File tree

430 files changed

+4170
-1742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

430 files changed

+4170
-1742
lines changed

client/client_priv.h

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -153,51 +153,3 @@ enum options_client
153153
#else
154154
#define SOCKET_PROTOCOL_TO_FORCE MYSQL_PROTOCOL_PIPE
155155
#endif
156-
157-
/**
158-
Utility function to implicitly change the connection protocol to a
159-
consistent value given the command line arguments. Additionally,
160-
warns the user that the protocol has been changed.
161-
162-
Arguments:
163-
@param [in] host Name of the host to connect to
164-
@param [in, out] opt_protocol Location of the protocol option
165-
variable to update
166-
@param [in] new_protocol New protocol to force
167-
*/
168-
static inline void warn_protocol_override(char *host,
169-
uint *opt_protocol,
170-
uint new_protocol)
171-
{
172-
DBUG_ASSERT(new_protocol == MYSQL_PROTOCOL_TCP
173-
|| new_protocol == SOCKET_PROTOCOL_TO_FORCE);
174-
175-
176-
if ((host == NULL
177-
|| strncmp(host, LOCAL_HOST, sizeof(LOCAL_HOST)-1) == 0))
178-
{
179-
const char *protocol_name;
180-
181-
if (*opt_protocol == MYSQL_PROTOCOL_DEFAULT
182-
#ifndef _WIN32
183-
&& new_protocol == MYSQL_PROTOCOL_SOCKET
184-
#else
185-
&& new_protocol == MYSQL_PROTOCOL_TCP
186-
#endif
187-
)
188-
{
189-
/* This is already the default behavior, do nothing */
190-
return;
191-
}
192-
193-
protocol_name= sql_protocol_typelib.type_names[new_protocol-1];
194-
195-
fprintf(stderr, "%s %s %s\n",
196-
"WARNING: Forcing protocol to ",
197-
protocol_name,
198-
" due to option specification. "
199-
"Please explicitly state intended protocol.");
200-
201-
*opt_protocol = new_protocol;
202-
}
203-
}

client/mysql.cc

Lines changed: 10 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,6 @@ unsigned short terminal_width= 80;
299299
static uint opt_protocol=0;
300300
static const char *opt_protocol_type= "";
301301

302-
static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
303-
304302
#include "sslopt-vars.h"
305303

306304
const char *default_dbug_option="d:t:o,/tmp/mariadb.trace";
@@ -1273,14 +1271,6 @@ int main(int argc,char *argv[])
12731271
exit(status.exit_status);
12741272
}
12751273

1276-
/* Command line options override configured protocol */
1277-
if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
1278-
&& protocol_to_force != opt_protocol)
1279-
{
1280-
warn_protocol_override(current_host, &opt_protocol, protocol_to_force);
1281-
}
1282-
1283-
12841274
if (status.batch && !status.line_buff &&
12851275
!(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin)))
12861276
{
@@ -1890,11 +1880,9 @@ static void usage(int version)
18901880

18911881

18921882
my_bool
1893-
get_one_option(const struct my_option *opt, const char *argument, const char *filename)
1883+
get_one_option(const struct my_option *opt, const char *argument,
1884+
const char *filename)
18941885
{
1895-
/* Track when protocol is set via CLI to not force port TCP protocol override */
1896-
static my_bool ignore_protocol_override = FALSE;
1897-
18981886
switch(opt->id) {
18991887
case OPT_CHARSETS_DIR:
19001888
strmake_buf(mysql_charsets_dir, argument);
@@ -1955,18 +1943,11 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
19551943
#ifndef EMBEDDED_LIBRARY
19561944
if (!argument[0])
19571945
opt_protocol= 0;
1958-
else if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
1946+
else if ((opt_protocol=
1947+
find_type_with_warning(argument, &sql_protocol_typelib,
19591948
opt->name)) <= 0)
19601949
exit(1);
19611950
#endif
1962-
1963-
/* Specification of protocol via CLI trumps implicit overrides */
1964-
if (filename[0] == '\0')
1965-
{
1966-
ignore_protocol_override = TRUE;
1967-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
1968-
}
1969-
19701951
break;
19711952
case OPT_SERVER_ARG:
19721953
#ifdef EMBEDDED_LIBRARY
@@ -2066,13 +2047,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
20662047
#ifdef _WIN32
20672048
opt_protocol = MYSQL_PROTOCOL_PIPE;
20682049
opt_protocol_type= "pipe";
2069-
2070-
/* Prioritize pipe if explicit via command line */
2071-
if (filename[0] == '\0')
2072-
{
2073-
ignore_protocol_override = TRUE;
2074-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
2075-
}
20762050
#endif
20772051
break;
20782052
#include <sslopt-case.h>
@@ -2085,35 +2059,17 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
20852059
mysql_end(-1);
20862060
break;
20872061
case 'P':
2088-
/* If port and socket are set, fall back to default behavior */
2089-
if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
2090-
{
2091-
ignore_protocol_override = TRUE;
2092-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
2093-
}
2094-
2095-
/* If port is set via CLI, try to force protocol to TCP */
2096-
if (filename[0] == '\0' &&
2097-
!ignore_protocol_override &&
2098-
protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
2062+
if (filename[0] == '\0')
20992063
{
2100-
protocol_to_force = MYSQL_PROTOCOL_TCP;
2064+
/* Port given on command line, switch protocol to use TCP */
2065+
opt_protocol= MYSQL_PROTOCOL_TCP;
21012066
}
21022067
break;
21032068
case 'S':
2104-
/* If port and socket are set, fall back to default behavior */
2105-
if (protocol_to_force == MYSQL_PROTOCOL_TCP)
2106-
{
2107-
ignore_protocol_override = TRUE;
2108-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
2109-
}
2110-
2111-
/* Prioritize socket if set via command line */
2112-
if (filename[0] == '\0' &&
2113-
!ignore_protocol_override &&
2114-
protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
2069+
if (filename[0] == '\0')
21152070
{
2116-
protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
2071+
/* Socket given on command line, switch protocol to use SOCKETSt */
2072+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
21172073
}
21182074
break;
21192075
case 'I':

client/mysqladmin.cc

Lines changed: 8 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ static bool sql_log_bin_off= false;
5454
static uint opt_protocol=0;
5555
static myf error_flags; /* flags to pass to my_printf_error, like ME_BELL */
5656

57-
static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
58-
5957
/*
6058
When using extended-status relatively, ex_val_max_len is the estimated
6159
maximum length for any relative value printed by extended-status. The
@@ -243,12 +241,9 @@ static const char *load_default_groups[]=
243241
0 };
244242

245243
my_bool
246-
get_one_option(const struct my_option *opt, const char *argument, const char *filename)
244+
get_one_option(const struct my_option *opt, const char *argument,
245+
const char *filename)
247246
{
248-
249-
/* Track when protocol is set via CLI to not force overrides */
250-
static my_bool ignore_protocol_override = FALSE;
251-
252247
switch(opt->id) {
253248
case 'c':
254249
opt_count_iterations= 1;
@@ -280,13 +275,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
280275
case 'W':
281276
#ifdef _WIN32
282277
opt_protocol = MYSQL_PROTOCOL_PIPE;
283-
284-
/* Prioritize pipe if explicit via command line */
285-
if (filename[0] == '\0')
286-
{
287-
ignore_protocol_override = TRUE;
288-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
289-
}
290278
#endif
291279
break;
292280
case '#':
@@ -322,45 +310,19 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
322310
sf_leaking_memory= 1; /* no memory leak reports here */
323311
exit(1);
324312
}
325-
326-
/* Specification of protocol via CLI trumps implicit overrides */
327-
if (filename[0] == '\0')
328-
{
329-
ignore_protocol_override = TRUE;
330-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
331-
}
332-
333313
break;
334314
case 'P':
335-
/* If port and socket are set, fall back to default behavior */
336-
if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
337-
{
338-
ignore_protocol_override = TRUE;
339-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
340-
}
341-
342-
/* If port is set via CLI, try to force protocol to TCP */
343-
if (filename[0] == '\0' &&
344-
!ignore_protocol_override &&
345-
protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
315+
if (filename[0] == '\0')
346316
{
347-
protocol_to_force = MYSQL_PROTOCOL_TCP;
317+
/* Port given on command line, switch protocol to use TCP */
318+
opt_protocol= MYSQL_PROTOCOL_TCP;
348319
}
349320
break;
350321
case 'S':
351-
/* If port and socket are set, fall back to default behavior */
352-
if (protocol_to_force == MYSQL_PROTOCOL_TCP)
353-
{
354-
ignore_protocol_override = TRUE;
355-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
356-
}
357-
358-
/* Prioritize socket if set via command line */
359-
if (filename[0] == '\0' &&
360-
!ignore_protocol_override &&
361-
protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
322+
if (filename[0] == '\0')
362323
{
363-
protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
324+
/* Socket given on command line, switch protocol to use SOCKETSt */
325+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
364326
}
365327
break;
366328
}
@@ -388,13 +350,6 @@ int main(int argc,char *argv[])
388350
temp_argv= mask_password(argc, &argv);
389351
temp_argc= argc;
390352

391-
/* Command line options override configured protocol */
392-
if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
393-
&& protocol_to_force != opt_protocol)
394-
{
395-
warn_protocol_override(host, &opt_protocol, protocol_to_force);
396-
}
397-
398353
if (debug_info_flag)
399354
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
400355
if (debug_check_flag)

client/mysqlbinlog.cc

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ static const char *output_prefix= "";
100100
static char **defaults_argv= 0;
101101
static MEM_ROOT glob_root;
102102

103-
static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT;
104-
105103
#ifndef DBUG_OFF
106104
static const char *default_dbug_option = "d:t:o,/tmp/mariadb-binlog.trace";
107105
const char *current_dbug_option= default_dbug_option;
@@ -2061,13 +2059,11 @@ int parse_gtid_filter_option(
20612059
}
20622060

20632061
extern "C" my_bool
2064-
get_one_option(const struct my_option *opt, const char *argument, const char *filename)
2062+
get_one_option(const struct my_option *opt, const char *argument,
2063+
const char *filename)
20652064
{
20662065
bool tty_password=0;
20672066

2068-
/* Track when protocol is set via CLI to not force overrides */
2069-
static my_bool ignore_protocol_override = FALSE;
2070-
20712067
switch (opt->id) {
20722068
#ifndef DBUG_OFF
20732069
case '#':
@@ -2117,14 +2113,6 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
21172113
sf_leaking_memory= 1; /* no memory leak reports here */
21182114
die(1);
21192115
}
2120-
2121-
/* Specification of protocol via CLI trumps implicit overrides */
2122-
if (filename[0] == '\0')
2123-
{
2124-
ignore_protocol_override = TRUE;
2125-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
2126-
}
2127-
21282116
break;
21292117
#ifdef WHEN_FLASHBACK_REVIEW_READY
21302118
case opt_flashback_review:
@@ -2165,35 +2153,17 @@ get_one_option(const struct my_option *opt, const char *argument, const char *fi
21652153
print_row_event_positions_used= 1;
21662154
break;
21672155
case 'P':
2168-
/* If port and socket are set, fall back to default behavior */
2169-
if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE)
2170-
{
2171-
ignore_protocol_override = TRUE;
2172-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
2173-
}
2174-
2175-
/* If port is set via CLI, try to force protocol to TCP */
2176-
if (filename[0] == '\0' &&
2177-
!ignore_protocol_override &&
2178-
protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
2156+
if (filename[0] == '\0')
21792157
{
2180-
protocol_to_force = MYSQL_PROTOCOL_TCP;
2158+
/* Port given on command line, switch protocol to use TCP */
2159+
opt_protocol= MYSQL_PROTOCOL_TCP;
21812160
}
21822161
break;
21832162
case 'S':
2184-
/* If port and socket are set, fall back to default behavior */
2185-
if (protocol_to_force == MYSQL_PROTOCOL_TCP)
2186-
{
2187-
ignore_protocol_override = TRUE;
2188-
protocol_to_force = MYSQL_PROTOCOL_DEFAULT;
2189-
}
2190-
2191-
/* Prioritize socket if set via command line */
2192-
if (filename[0] == '\0' &&
2193-
!ignore_protocol_override &&
2194-
protocol_to_force == MYSQL_PROTOCOL_DEFAULT)
2163+
if (filename[0] == '\0')
21952164
{
2196-
protocol_to_force = SOCKET_PROTOCOL_TO_FORCE;
2165+
/* Socket given on command line, switch protocol to use SOCKETSt */
2166+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
21972167
}
21982168
break;
21992169
case 'v':
@@ -3261,13 +3231,6 @@ int main(int argc, char** argv)
32613231

32623232
parse_args(&argc, (char***)&argv);
32633233

3264-
/* Command line options override configured protocol */
3265-
if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT
3266-
&& protocol_to_force != opt_protocol)
3267-
{
3268-
warn_protocol_override(host, &opt_protocol, protocol_to_force);
3269-
}
3270-
32713234
if (!argc || opt_version)
32723235
{
32733236
if (!opt_version)

0 commit comments

Comments
 (0)