Skip to content

Commit 48bee0a

Browse files
committed
Merge branch 'mysql-5.6' into mysql-5.7
2 parents 56bab4c + 079fd01 commit 48bee0a

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

client/mysqladmin.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,7 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile)
15591559
{
15601560
MYSQL_RES* result;
15611561

1562-
if (mysql_query(mysql, "SHOW VARIABLES LIKE 'pid_file'"))
1562+
if (mysql_query(mysql, "SELECT @@datadir, @@pid_file"))
15631563
{
15641564
my_printf_error(mysql_errno(mysql),
15651565
"The query to get the server's pid file failed,"
@@ -1570,8 +1570,13 @@ static my_bool get_pidfile(MYSQL *mysql, char *pidfile)
15701570
if (result)
15711571
{
15721572
MYSQL_ROW row=mysql_fetch_row(result);
1573-
if (row)
1574-
my_stpcpy(pidfile, row[1]);
1573+
if (row) {
1574+
char datadir[FN_REFLEN];
1575+
char pidfile_option[FN_REFLEN];
1576+
my_stpcpy(datadir, row[0]);
1577+
my_stpcpy(pidfile_option, row[1]);
1578+
(void) my_load_path(pidfile, pidfile_option, datadir);
1579+
}
15751580
mysql_free_result(result);
15761581
return row == 0; /* Error if row = 0 */
15771582
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#
2+
# Bug#28466137 MYSQLADMIN SHUTDOWN DOES NOT WAIT FOR MYSQL TO SHUT DOWN ANYMORE
3+
#
4+
Warning: Using a password on the command line interface can be insecure.

mysql-test/t/mysqladmin_shutdown.test

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Supported on platforms with UNIX sockets only
2+
--source include/not_windows.inc
3+
4+
--echo #
5+
--echo # Bug#28466137 MYSQLADMIN SHUTDOWN DOES NOT WAIT FOR MYSQL TO SHUT DOWN ANYMORE
6+
--echo #
7+
8+
--let $_pid_file_location= `SELECT @@pid_file`
9+
10+
# Write file to make mtr expect the shutdown and avoid implicit restart
11+
--let $_server_id= `SELECT @@server_id`
12+
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
13+
--exec echo "wait" > $_expect_file_name
14+
15+
--exec $MYSQLADMIN -uroot --password="" -S $MASTER_MYSOCK shutdown 2>&1
16+
17+
# pid file should be gone
18+
--error 1
19+
--file_exists $_pid_file_location
20+
21+
--source include/wait_until_disconnected.inc
22+
23+
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
24+
--enable_reconnect
25+
--source include/wait_until_connected_again.inc

0 commit comments

Comments
 (0)