diff --git a/client/client_priv.h b/client/client_priv.h
index 5e764cc33fd..275d3c6853b 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -102,6 +102,7 @@ enum options_client
OPT_IGNORE_DATA,
OPT_PRINT_ROW_COUNT, OPT_PRINT_ROW_EVENT_POSITIONS,
OPT_CHECK_IF_UPGRADE_NEEDED,
+ OPT_COMPATIBILTY_CLEARTEXT_PLUGIN,
OPT_MAX_CLIENT_OPTION /* should be always the last */
};
diff --git a/client/mysql.cc b/client/mysql.cc
index 558b54e3909..ea92c84e1d1 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1521,6 +1521,8 @@ static struct my_option my_long_options[] =
&delimiter_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"execute", 'e', "Execute command and quit. (Disables --force and history file.)", 0,
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"enable-cleartext-plugin", OPT_COMPATIBILTY_CLEARTEXT_PLUGIN, "Obsolete option. Exists only for MySQL compatibility.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"vertical", 'E', "Print the output of a query (rows) vertically.",
&vertical, &vertical, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
@@ -1817,6 +1819,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
printf("WARNING: --server-arg option not supported in this configuration.\n");
#endif
break;
+ case OPT_COMPATIBILTY_CLEARTEXT_PLUGIN:
+ /*
+ This option exists in MySQL client but not in MariaDB. Users switching from
+ MySQL might still have this option in their commands, and it will not work
+ in MariaDB unless it is handled. Therefore output a warning and continue.
+ */
+ printf("WARNING: option '--enable-cleartext-plugin' is obsolete.\n");
+ break;
case 'A':
opt_rehash= 0;
break;
diff --git a/man/mysql.1 b/man/mysql.1
index 3ae8fdf9d69..238106843ef 100644
--- a/man/mysql.1
+++ b/man/mysql.1
@@ -507,6 +507,21 @@ the section called \(lqMYSQL COMMANDS\(rq\&.
.sp -1
.IP \(bu 2.3
.\}
+.\" mysql: enable cleartext plugin option
+.\" enable cleartext plugin option: mysql
+\fB\-\-enable\-cleartext\-plugin\fR
+.sp
+Obsolete option\&. Exists only for MySQL compatibility\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
.\" mysql: execute option
.\" execute option: mysql
\fB\-\-execute=\fR\fB\fIstatement\fR\fR,
diff --git a/mysql-test/main/mysql.result b/mysql-test/main/mysql.result
index ec2760ce8a7..9b0936b5924 100644
--- a/mysql-test/main/mysql.result
+++ b/mysql-test/main/mysql.result
@@ -629,4 +629,7 @@ drop table t1;
#
# MDEV-15538 '-N' Produce html output wrong
#
-
\ No newline at end of file
+
+WARNING: option '--enable-cleartext-plugin' is obsolete.
+1
+1
diff --git a/mysql-test/main/mysql.test b/mysql-test/main/mysql.test
index 1cb4977a32d..0f41add821a 100644
--- a/mysql-test/main/mysql.test
+++ b/mysql-test/main/mysql.test
@@ -708,3 +708,11 @@ drop table t1;
--echo # MDEV-15538 '-N' Produce html output wrong
--echo #
--exec $MYSQL -NHe "select 1 as a"
+
+
+#
+# Test obsolete option --enable-cleartext-plugin
+# This should proceed with a warning
+#
+--echo
+--exec $MYSQL test --enable-cleartext-plugin -e "select 1"