Skip to content

Commit a906046

Browse files
committed
Merge 10.11 into 11.0
2 parents a9e1386 + 3430767 commit a906046

30 files changed

+226
-416
lines changed

client/mysql.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,8 +2068,15 @@ get_one_option(const struct my_option *opt, const char *argument,
20682068
case 'S':
20692069
if (filename[0] == '\0')
20702070
{
2071-
/* Socket given on command line, switch protocol to use SOCKETSt */
2072-
opt_protocol= MYSQL_PROTOCOL_SOCKET;
2071+
/*
2072+
Socket given on command line, switch protocol to use SOCKETSt
2073+
Except on Windows if 'protocol= pipe' has been provided in
2074+
the config file or command line.
2075+
*/
2076+
if (opt_protocol != MYSQL_PROTOCOL_PIPE)
2077+
{
2078+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
2079+
}
20732080
}
20742081
break;
20752082
case 'I':

client/mysqladmin.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,15 @@ get_one_option(const struct my_option *opt, const char *argument,
321321
case 'S':
322322
if (filename[0] == '\0')
323323
{
324-
/* Socket given on command line, switch protocol to use SOCKETSt */
325-
opt_protocol= MYSQL_PROTOCOL_SOCKET;
324+
/*
325+
Socket given on command line, switch protocol to use SOCKETSt
326+
Except on Windows if 'protocol= pipe' has been provided in
327+
the config file or command line.
328+
*/
329+
if (opt_protocol != MYSQL_PROTOCOL_PIPE)
330+
{
331+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
332+
}
326333
}
327334
break;
328335
}

client/mysqlbinlog.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,8 +2162,15 @@ get_one_option(const struct my_option *opt, const char *argument,
21622162
case 'S':
21632163
if (filename[0] == '\0')
21642164
{
2165-
/* Socket given on command line, switch protocol to use SOCKETSt */
2166-
opt_protocol= MYSQL_PROTOCOL_SOCKET;
2165+
/*
2166+
Socket given on command line, switch protocol to use SOCKETSt
2167+
Except on Windows if 'protocol= pipe' has been provided in
2168+
the config file or command line.
2169+
*/
2170+
if (opt_protocol != MYSQL_PROTOCOL_PIPE)
2171+
{
2172+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
2173+
}
21672174
}
21682175
break;
21692176
case 'v':

client/mysqlcheck.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,15 @@ get_one_option(const struct my_option *opt,
379379
case 'S':
380380
if (filename[0] == '\0')
381381
{
382-
/* Socket given on command line, switch protocol to use SOCKETSt */
383-
opt_protocol= MYSQL_PROTOCOL_SOCKET;
382+
/*
383+
Socket given on command line, switch protocol to use SOCKETSt
384+
Except on Windows if 'protocol= pipe' has been provided in
385+
the config file or command line.
386+
*/
387+
if (opt_protocol != MYSQL_PROTOCOL_PIPE)
388+
{
389+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
390+
}
384391
}
385392
break;
386393
}

client/mysqldump.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,8 +1073,15 @@ get_one_option(const struct my_option *opt,
10731073
case 'S':
10741074
if (filename[0] == '\0')
10751075
{
1076-
/* Socket given on command line, switch protocol to use SOCKETSt */
1077-
opt_protocol= MYSQL_PROTOCOL_SOCKET;
1076+
/*
1077+
Socket given on command line, switch protocol to use SOCKETSt
1078+
Except on Windows if 'protocol= pipe' has been provided in
1079+
the config file or command line.
1080+
*/
1081+
if (opt_protocol != MYSQL_PROTOCOL_PIPE)
1082+
{
1083+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
1084+
}
10781085
}
10791086
break;
10801087
}

client/mysqlimport.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,15 @@ get_one_option(const struct my_option *opt, const char *argument,
264264
case 'S':
265265
if (filename[0] == '\0')
266266
{
267-
/* Socket given on command line, switch protocol to use SOCKETSt */
268-
opt_protocol= MYSQL_PROTOCOL_SOCKET;
267+
/*
268+
Socket given on command line, switch protocol to use SOCKETSt
269+
Except on Windows if 'protocol= pipe' has been provided in
270+
the config file or command line.
271+
*/
272+
if (opt_protocol != MYSQL_PROTOCOL_PIPE)
273+
{
274+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
275+
}
269276
}
270277
break;
271278
case '#':

client/mysqlshow.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,15 @@ get_one_option(const struct my_option *opt, const char *argument,
339339
case 'S':
340340
if (filename[0] == '\0')
341341
{
342-
/* Socket given on command line, switch protocol to use SOCKETSt */
343-
opt_protocol= MYSQL_PROTOCOL_SOCKET;
342+
/*
343+
Socket given on command line, switch protocol to use SOCKETSt
344+
Except on Windows if 'protocol= pipe' has been provided in
345+
the config file or command line.
346+
*/
347+
if (opt_protocol != MYSQL_PROTOCOL_PIPE)
348+
{
349+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
350+
}
344351
}
345352
break;
346353
break;

client/mysqlslap.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,8 +777,15 @@ get_one_option(const struct my_option *opt, const char *argument,
777777
case 'S':
778778
if (filename[0] == '\0')
779779
{
780-
/* Socket given on command line, switch protocol to use SOCKETSt */
781-
opt_protocol= MYSQL_PROTOCOL_SOCKET;
780+
/*
781+
Socket given on command line, switch protocol to use SOCKETSt
782+
Except on Windows if 'protocol= pipe' has been provided in
783+
the config file or command line.
784+
*/
785+
if (opt_protocol != MYSQL_PROTOCOL_PIPE)
786+
{
787+
opt_protocol= MYSQL_PROTOCOL_SOCKET;
788+
}
782789
}
783790
break;
784791
case '#':

mysql-test/main/cli_options_force_protocol_win.result

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ Connection: localhost via named pipe
1212
# exec MYSQL --host=localhost -W -e "status" 2>&1 | findstr /c:"Connection:"
1313
Connection: localhost via named pipe
1414
# exec MYSQL --host=localhost -W --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
15-
Connection: localhost via TCP/IP
15+
Connection: localhost via named pipe
1616
# exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
1717
Connection: localhost via TCP/IP
18+
#
19+
# MDEV-30639: Upgrade to 10.8 and later does not work on Windows
20+
# due to connection protocol overwrite
21+
#
22+
# exec MYSQL --host=localhost --protocol=pipe --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
23+
Connection: localhost via named pipe

mysql-test/main/cli_options_force_protocol_win.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@
2525

2626
--echo # exec MYSQL --host=localhost --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
2727
--exec $MYSQL --host=localhost --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
28+
29+
--echo #
30+
--echo # MDEV-30639: Upgrade to 10.8 and later does not work on Windows
31+
--echo # due to connection protocol overwrite
32+
--echo #
33+
--echo # exec MYSQL --host=localhost --protocol=pipe --socket=MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"
34+
--exec $MYSQL --host=localhost --protocol=pipe --socket=$MASTER_MYSOCK -e "status" 2>&1 | findstr /c:"Connection:"

0 commit comments

Comments
 (0)