Debian Codegraph @

mysql-test/suite/x/r/connection_auth_same_user_name.result

raw
1 call mtr.add_suppression("Plugin mysqlx reported: .*Unsuccessful login attempt: Invalid user or password");
2 CREATE DATABASE xtest;
3 USE xtest;
4 CREATE USER user1@'%' IDENTIFIED WITH 'mysql_native_password' BY 'pass_all_hosts';
5 CREATE USER user1@'127.0.0.1' IDENTIFIED WITH 'mysql_native_password' BY 'pass_127.0.0.1';
6 CREATE USER user1@'localhost' IDENTIFIED WITH 'mysql_native_password' BY 'pass_localhost';
7 CREATE TABLE `table_all_hosts`(id integer);
8 CREATE TABLE `table_127.0.0.1`(id integer);
9 CREATE TABLE `table_localhost`(id integer);
10 INSERT INTO `table_all_hosts`(id) VALUES(2),(4);
11 INSERT INTO `table_127.0.0.1`(id) VALUES(1),(3);
12 INSERT INTO `table_localhost`(id) VALUES(5),(6);
13 GRANT SELECT ON xtest.`table_all_hosts` TO 'user1'@'%';
14 GRANT SELECT ON xtest.`table_127.0.0.1` TO 'user1'@'127.0.0.1';
15 GRANT SELECT ON xtest.`table_localhost` TO 'user1'@'localhost';
16 ##
17 ## X Plugin should only authenticate 'user1'@'127.0.0.1' account on TCP
18 ##
19 RUN select current_user();
20 current_user()
21 [email protected]
22 0 rows affected
23 RUN select * from `table_all_hosts`;
24 Got expected error (code 0)
25 RUN select * from `table_127.0.0.1`;
26 Got expected error (code 0)
27 RUN select * from `table_localhost`;
28 Got expected error (code 0)
29 Mysqlx.Ok {
30 msg: "bye!"
31 }
32 Login with 'user1:pass_localhost@localhost/xtest' should fail
33 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
34 ok
35 Login with 'user1:pass_all_hosts@localhost/xtest' should fail
36 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
37 ok
38 ##
39 ## X Plugin should only authenticate 'user1'@'localhost' account on UNIX socket
40 ##
41 RUN select current_user();
42 current_user()
43 user1@localhost
44 0 rows affected
45 RUN select * from `table_all_hosts`;
46 Got expected error (code 0)
47 RUN select * from `table_127.0.0.1`;
48 Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_127.0.0.1' (code 1142)
49 RUN select * from `table_localhost`;
50 Got expected error (code 0)
51 Mysqlx.Ok {
52 msg: "bye!"
53 }
54 Login with 'user1:pass_127.0.0.1@localhost/xtest' should fail
55 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
56 ok
57 Login with 'user1:pass_all_hosts@localhost/xtest' should fail
58 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
59 ok
60 DROP USER user1@'127.0.0.1';
61 ##
62 ## X Plugin should only authenticate 'user1'@'127.0.0.%' account on TCP
63 ##
64 Login with 'user1:pass_127.0.0.1@localhost/xtest' should fail
65 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
66 ok
67 RUN select current_user();
68 current_user()
69 user1@localhost
70 0 rows affected
71 RUN select * from `table_all_hosts`;
72 Got expected error (code 0)
73 RUN select * from `table_127.0.0.1`;
74 Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_127.0.0.1' (code 1142)
75 RUN select * from `table_localhost`;
76 Got expected error (code 0)
77 Mysqlx.Ok {
78 msg: "bye!"
79 }
80 Login with 'user1:pass_all_hosts@localhost/xtest' should fail
81 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
82 ok
83 DROP USER user1@'localhost';
84 ##
85 ## X Plugin should only authenticate 'user1'@'%' account on TCP
86 ##
87 Login with 'user1:pass_127.0.0.1@localhost/xtest' should fail
88 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
89 ok
90 Login with 'user1:pass_localhost@localhost/xtest' should fail
91 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
92 ok
93 RUN select current_user();
94 current_user()
95 user1@%
96 0 rows affected
97 RUN select * from `table_all_hosts`;
98 Got expected error (code 0)
99 RUN select * from `table_127.0.0.1`;
100 Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_127.0.0.1' (code 1142)
101 RUN select * from `table_localhost`;
102 Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_localhost' (code 1142)
103 Mysqlx.Ok {
104 msg: "bye!"
105 }
106 DROP DATABASE xtest;
107 DROP USER user1@'%';