summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorArun Kuruvila <arun.kuruvila@oracle.com>2015-10-14 12:00:39 +0530
committerArun Kuruvila <arun.kuruvila@oracle.com>2015-10-14 12:00:39 +0530
commita86191c69c95240ba3dcd9858341a30898c34285 (patch)
tree2d6e78068aa228a2d69ac2bb945265793de267d8 /mysql-test
parent3846b085521bce8e4600d4860dc3f2ea5f2ceb2d (diff)
downloadmariadb-git-a86191c69c95240ba3dcd9858341a30898c34285.tar.gz
Bug #21235226 : THE --ENABLE-CLEARTEXT-PLUGIN IS NOT
IMPLEMENTED IN ALL CLIENT PROGRAMS Description: Option "enable-cleartext-plugin" is not available for the following client utilities:- mysqldump mysqlimport mysqlshow mysqlcheck Analysis: The unavailability of this option limits the features like PAM authentication from using the above mentioned utilities. Fix: Option "enable-cleartext-plugin" is implemented in the above mentioned client utilities.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/enable_cleartext_plugin.result35
-rw-r--r--mysql-test/t/enable_cleartext_plugin-master.opt2
-rw-r--r--mysql-test/t/enable_cleartext_plugin.test65
3 files changed, 102 insertions, 0 deletions
diff --git a/mysql-test/r/enable_cleartext_plugin.result b/mysql-test/r/enable_cleartext_plugin.result
new file mode 100644
index 00000000000..b57a6fc0e16
--- /dev/null
+++ b/mysql-test/r/enable_cleartext_plugin.result
@@ -0,0 +1,35 @@
+#
+# Bug #21235226 : THE --ENABLE-CLEARTEXT-PLUGIN IS NOT IMPLEMENTED
+# IN ALL CLIENT PROGRAMS
+#
+CREATE DATABASE db21235226;
+USE db21235226;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1), (2);
+SELECT * FROM t1;
+a
+1
+2
+CREATE USER uplain@localhost IDENTIFIED WITH 'cleartext_plugin_server'
+ AS 'cleartext_test';
+GRANT ALL PRIVILEGES ON *.* TO uplain@localhost;
+mysqldump: Got error: 2059: Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled when trying to connect
+SELECT * FROM t1;
+a
+mysqlimport: Error: 2059 Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled
+SELECT * FROM t1;
+a
+1
+2
+mysqlshow: Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled
+Database: db21235226
++--------+
+| Tables |
++--------+
+| t1 |
++--------+
+mysqlcheck: Got error: 2059: Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled when trying to connect
+db21235226.t1 OK
+DROP TABLE t1;
+DROP DATABASE db21235226;
+DROP USER uplain@localhost;
diff --git a/mysql-test/t/enable_cleartext_plugin-master.opt b/mysql-test/t/enable_cleartext_plugin-master.opt
new file mode 100644
index 00000000000..3536d102387
--- /dev/null
+++ b/mysql-test/t/enable_cleartext_plugin-master.opt
@@ -0,0 +1,2 @@
+$PLUGIN_AUTH_OPT
+$PLUGIN_AUTH_LOAD
diff --git a/mysql-test/t/enable_cleartext_plugin.test b/mysql-test/t/enable_cleartext_plugin.test
new file mode 100644
index 00000000000..e2ae35c8e73
--- /dev/null
+++ b/mysql-test/t/enable_cleartext_plugin.test
@@ -0,0 +1,65 @@
+--source include/have_plugin_auth.inc
+--source include/not_embedded.inc
+
+--echo #
+--echo # Bug #21235226 : THE --ENABLE-CLEARTEXT-PLUGIN IS NOT IMPLEMENTED
+--echo # IN ALL CLIENT PROGRAMS
+--echo #
+
+CREATE DATABASE db21235226;
+USE db21235226;
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1), (2);
+SELECT * FROM t1;
+
+CREATE USER uplain@localhost IDENTIFIED WITH 'cleartext_plugin_server'
+ AS 'cleartext_test';
+
+GRANT ALL PRIVILEGES ON *.* TO uplain@localhost;
+
+#Reset the LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN variable.
+let LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN=N;
+
+#Scenario 1 : MYSQL_DUMP without --enable_cleartext_plugin
+# Should get CR_AUTH_PLUGIN_CANNOT_LOAD error
+--error 2
+--exec $MYSQL_DUMP --user=uplain --password=cleartext_test --tab=$MYSQLTEST_VARDIR/tmp/ db21235226 2>&1
+
+#Scenario 2 : MYSQL_DUMP with --enable_cleartext_plugin
+--exec $MYSQL_DUMP --enable_cleartext_plugin --user=uplain --password=cleartext_test --tab=$MYSQLTEST_VARDIR/tmp/ db21235226
+--exec $MYSQL --enable_cleartext_plugin --user=uplain --password=cleartext_test db21235226 < $MYSQLTEST_VARDIR/tmp/t1.sql
+SELECT * FROM t1;
+
+#Scenario 3 : MYSQL_IMPORT without --enable_cleartext_plugin
+# Should get CR_AUTH_PLUGIN_CANNOT_LOAD error
+--replace_regex /.*mysqlimport(\.exe)*/mysqlimport/
+--error 1
+--exec $MYSQL_IMPORT --user=uplain --password=cleartext_test --silent db21235226 $MYSQLTEST_VARDIR/tmp/t1.txt 2>&1
+
+#Scenario 4 : MYSQL_IMPORT with --enable_cleartext_plugin
+--exec $MYSQL_IMPORT --enable_cleartext_plugin --user=uplain --password=cleartext_test --silent db21235226 $MYSQLTEST_VARDIR/tmp/t1.txt
+SELECT * FROM t1;
+
+#Scenario 5 : MYSQL_SHOW without --enable_cleartext_plugin
+# Should get CR_AUTH_PLUGIN_CANNOT_LOAD error
+--replace_regex /.*mysqlshow(\.exe)*/mysqlshow/
+--error 1
+--exec $MYSQL_SHOW --user=uplain --password=cleartext_test db21235226 2>&1
+
+#Scenario 6 : MYSQL_SHOW with --enable_cleartext_plugin
+--exec $MYSQL_SHOW --enable_cleartext_plugin --user=uplain --password=cleartext_test db21235226
+
+#Scenario 7 : MYSQL_CHECK without --enable_cleartext_plugin
+# Should get CR_AUTH_PLUGIN_CANNOT_LOAD error
+--replace_regex /.*mysqlcheck(\.exe)*/mysqlcheck/
+--error 2
+--exec $MYSQL_CHECK --user=uplain --password=cleartext_test db21235226 t1 2>&1
+
+#Scenario 8 : MYSQL_CHECK with --enable_cleartext_plugin
+--exec $MYSQL_CHECK --enable_cleartext_plugin --user=uplain --password=cleartext_test db21235226 t1
+
+#Cleanup
+DROP TABLE t1;
+DROP DATABASE db21235226;
+DROP USER uplain@localhost;