Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ static int port = 0;
static uint my_end_arg;
static const char *sock = 0;
static char *opt_plugin_dir = 0, *opt_default_auth = 0;
static uint opt_enable_cleartext_plugin = 0;
static bool using_opt_enable_cleartext_plugin = 0;

#if defined(_WIN32)
static char *shared_memory_base_name = 0;
Expand Down Expand Up @@ -1593,6 +1595,10 @@ static struct my_option my_long_options[] = {
{"print-table-metadata", OPT_PRINT_TABLE_METADATA,
"Print metadata stored in Table_map_log_event", &opt_print_table_metadata,
&opt_print_table_metadata, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"enable_cleartext_plugin", OPT_ENABLE_CLEARTEXT_PLUGIN,
"Enable/disable the clear text authentication plugin.",
&opt_enable_cleartext_plugin, &opt_enable_cleartext_plugin, 0, GET_BOOL,
OPT_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}};

/**
Expand Down Expand Up @@ -1802,6 +1808,9 @@ extern "C" bool get_one_option(int optid, const struct my_option *opt,
warning(CLIENT_WARN_DEPRECATED_MSG("--stop-never-slave-server-id",
"--connection-server-id"));
break;
case OPT_ENABLE_CLEARTEXT_PLUGIN:
using_opt_enable_cleartext_plugin = true;
break;
}
if (tty_password) pass = get_tty_password(NullS);

Expand Down Expand Up @@ -1840,6 +1849,10 @@ static Exit_status safe_connect() {
return ERROR_STOP;
}

if (using_opt_enable_cleartext_plugin)
mysql_options(mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN,
(char *)&opt_enable_cleartext_plugin);

SSL_SET_OPTIONS(mysql);

if (opt_plugin_dir && *opt_plugin_dir)
Expand Down