File: enable_cleartext_plugin.test

package info (click to toggle)
mysql-5.5 5.5.60-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 201,012 kB
  • sloc: cpp: 648,063; ansic: 552,041; perl: 48,017; pascal: 25,099; sh: 15,065; yacc: 13,088; cs: 4,647; xml: 4,178; sql: 3,380; makefile: 1,368; lex: 639; awk: 54
file content (65 lines) | stat: -rw-r--r-- 2,536 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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;