Skip to content

Commit cc09075

Browse files
committed
Bug#33619511: MySQL server exits in debug build when -p parameter used
Fixes server exit due to uninitialized variables in keyring migration code. Approved by: Harin Vadodaria <harin.vadodaria@oracle.com> Change-Id: I05bf3dfd059140c4c1ac0e14a9260e51f5a40ca8
1 parent 9542f30 commit cc09075

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#
2+
# Bug#33619511: MySQL server exits in debug build when -p parameter used
3+
#
4+
# Expect log that proves the server clean exit
5+
Pattern "\[ERROR\] \[MY-[0-9]+] \[Server\] Aborting" found
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
# Checking if perl Expect module is installed on the system.
3+
# If not, the test will be skipped.
4+
--source include/have_expect.inc
5+
--source include/not_windows.inc
6+
7+
--echo #
8+
--echo # Bug#33619511: MySQL server exits in debug build when -p parameter used
9+
--echo #
10+
11+
# No $ sign before the name to make it visible in Perl code below
12+
--let MYSQLD_ARGS = --datadir=$MYSQLD_DATADIR --secure-file-priv="" -p
13+
--let MYSQLD_LOG = $MYSQL_TMP_DIR/bug33619511_log.txt
14+
15+
# Start a custom mysqld instance and interactively fill up the dummy password.
16+
# Server should exit with "[Server] Aborting"
17+
--perl
18+
19+
use strict;
20+
require Expect;
21+
22+
# 1. Start the server
23+
# The server should enter password prompt, we'll type a password 'a'.
24+
# Use "log_stdout(0)" to avoid leaking output to record file because it contains timestamps and custom paths.
25+
my $texp = new Expect();
26+
$texp->raw_pty(1);
27+
$texp->log_stdout(0);
28+
$texp->log_file("$ENV{MYSQLD_LOG}", "w");
29+
$texp->spawn("$ENV{MYSQLD} $ENV{MYSQLD_ARGS}");
30+
$texp->expect(15,' -re ',[ 'Enter password:' => sub {
31+
$texp->send("a\n");}]) or die "Error sending the password";
32+
33+
$texp->soft_close();
34+
35+
EOF
36+
37+
--echo # Expect log that proves the server clean exit
38+
--let SEARCH_FILE = $MYSQLD_LOG
39+
--let SEARCH_PATTERN=\[ERROR\] \[MY-[0-9]+] \[Server\] Aborting
40+
--source include/search_pattern.inc
41+
42+
# Cleanup
43+
--remove_file $MYSQLD_LOG

sql/migrate_keyring.cc

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ Migrate_keyring::Migrate_keyring()
3737
m_source_plugin_handle= NULL;
3838
m_destination_plugin_handle= NULL;
3939
mysql= NULL;
40+
m_argc = 0;
41+
m_argv = nullptr;
4042
}
4143

4244
/**

0 commit comments

Comments
 (0)