Debian Codegraph @

mysql-test/suite/auth_sec/t/skip_grant_protocols_windows.test

raw
1 # This test is added to verify the Bug#27400095 fix.
2
3 # with ps_protocol ON, The select query from P_S.thread doesn't return any result
4 # that cuases test to fail due to result content mismatch error.
5 --source include/no_ps_protocol.inc
6
7 # Windows does not have SOCKET, but will try to create a PIPE as well as MEMORY
8 --source include/windows.inc
9
10 # Create a new datadir1 and a new user with non-default plugin type
11 --source suite/auth_sec/include/skip_grant_protocols.inc
12
13 --echo
14 --echo # Restart the server with --skip-grant-tables, --shared-memory options
15 --echo # enabled and new datadir
16 --replace_result $MYSQLD_DATADIR1 MYSQLD_DATADIR1
17 --let $restart_parameters="restart: --skip-grant-tables --shared-memory --datadir=$MYSQLD_DATADIR1"
18 --source include/restart_mysqld.inc
19
20 --echo
21 --echo # connect the root user which uses the default auth plugin
22 let $shm_name= query_get_value("SHOW GLOBAL VARIABLES LIKE 'shared_memory_base_name'", Value, 1);
23 connect(shm_con1,localhost,root,passwd,,,$shm_name,SHM);
24 connection shm_con1;
25 SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query';
26 SELECT CURRENT_USER;
27
28 connection default;
29 disconnect shm_con1;
30
31 --echo
32 --echo # connect the root user which uses the mysql_native_password auth plugin
33 connect(shm_con1,localhost,root,passwd,,,$shm_name,SHM,mysql_native_password);
34 connection shm_con1;
35 SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query';
36 SELECT CURRENT_USER;
37
38 connection default;
39 disconnect shm_con1;
40
41 --echo
42 --echo # connect the user which uses the non-default auth plugin
43 connect(shm_con1,localhost,native_user,passwd,,,$shm_name,SHM);
44 connection shm_con1;
45 SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query';
46 SELECT CURRENT_USER;
47
48 connection default;
49 disconnect shm_con1;
50
51 --echo
52 --echo # connect the native_user user which uses corresponding
53 --echo # mysql_native_password auth plugin
54 connect(shm_con1,localhost,native_user,passwd,,,$shm_name,SHM,mysql_native_password);
55 connection shm_con1;
56 SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query';
57 SELECT CURRENT_USER;
58
59 connection default;
60 disconnect shm_con1;
61
62 --echo
63 --echo # Restart the server with --skip-grant-tables, --enable-named-pipe
64 --echo # options enabled and new datadir
65 --replace_result $MYSQLD_DATADIR1 MYSQLD_DATADIR1
66 --let $restart_parameters="restart: --skip-grant-tables --enable-named-pipe --datadir=$MYSQLD_DATADIR1"
67 --source include/restart_mysqld.inc
68
69 --echo
70 --echo # connect the root user which uses the default auth plugin
71 connect(pipe_con1,localhost,root,passwd,,,,PIPE);
72 SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query';
73 SELECT CURRENT_USER;
74 connection default;
75 disconnect pipe_con1;
76
77 --echo
78 --echo # connect the root user which uses the mysql_native_password auth plugin
79 connect(pipe_con1,localhost,root,passwd,,,,PIPE,mysql_native_password);
80 connection pipe_con1;
81 SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query';
82 SELECT CURRENT_USER;
83 connection default;
84 disconnect pipe_con1;
85
86 --echo
87 --echo # connect the user which uses the non-default auth plugin
88 connect(pipe_con1,localhost,native_user,passwd,,,,PIPE);
89 connection pipe_con1;
90 SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query';
91 SELECT CURRENT_USER;
92 connection default;
93 disconnect pipe_con1;
94
95 --echo
96 --echo # connect the native_user user which uses corresponding
97 --echo # mysql_native_password auth plugin
98 connect(pipe_con1,localhost,native_user,passwd,,,,PIPE,mysql_native_password);
99 connection pipe_con1;
100 SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query';
101 SELECT CURRENT_USER;
102
103 connection default;
104 disconnect pipe_con1;
105
106
107 --echo # since we didn't specify server's public keys explicitly,
108 --echo # following insecure connections must fail with
109 --echo # error: Authentication requires secure connection.
110
111 --echo
112 --echo # connect the root user which uses the default auth plugin
113 --echo # error 1
114 --error 1
115 --exec $MYSQL --host=localhost --user=root --password=passwd --protocol=PIPE -e "SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query'; SELECT current_user;"
116
117 --echo
118 --echo # connect the root user which uses the mysql_native_password auth plugin
119 --echo # error 1
120 --error 1
121 --exec $MYSQL --host=localhost --user=native_user --password=passwd --protocol=PIPE -e "SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query'; SELECT current_user;"
122
123 --echo
124 --echo # connect the root user which uses the non-default auth plugin
125 --echo # error 1
126 --error 1
127 --exec $MYSQL --host=localhost --user=root --password=passwd --protocol=PIPE --default-auth=mysql_native_password -e "SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query'; SELECT current_user;"
128
129 --echo
130 --echo # connect the native user plugin user which uses corresponding plugin
131 --echo # error 1
132 --error 1
133 --exec $MYSQL --host=localhost --user=native_user --password=passwd --default-auth=mysql_native_password --protocol=PIPE -e "SELECT connection_type FROM performance_schema.threads WHERE processlist_command='Query'; SELECT current_user;"
134
135 --echo
136 --echo # Cleanup
137 let $restart_parameters=;
138 --source include/restart_mysqld.inc
139 # Remove residue files and data folder
140 --force-rmdir $MYSQL_TMP_DIR/datadir1/