Debian Codegraph @

mysql-test/suite/x/r/connection_auth_same_user_name_win.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 DROP USER user1@'127.0.0.1';
39 ##
40 ## X Plugin should only authenticate 'user1'@'127.0.0.%' account on TCP
41 ##
42 Login with 'user1:pass_127.0.0.1@localhost/xtest' should fail
43 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
44 ok
45 RUN select current_user();
46 current_user()
47 user1@localhost
48 0 rows affected
49 RUN select * from `table_all_hosts`;
50 Got expected error (code 0)
51 RUN select * from `table_127.0.0.1`;
52 Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_127.0.0.1' (code 1142)
53 RUN select * from `table_localhost`;
54 Got expected error (code 0)
55 Mysqlx.Ok {
56 msg: "bye!"
57 }
58 Login with 'user1:pass_all_hosts@localhost/xtest' should fail
59 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
60 ok
61 DROP USER user1@'localhost';
62 ##
63 ## X Plugin should only authenticate 'user1'@'%' account on TCP
64 ##
65 Login with 'user1:pass_127.0.0.1@localhost/xtest' should fail
66 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
67 ok
68 Login with 'user1:pass_localhost@localhost/xtest' should fail
69 error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045)
70 ok
71 RUN select current_user();
72 current_user()
73 user1@%
74 0 rows affected
75 RUN select * from `table_all_hosts`;
76 Got expected error (code 0)
77 RUN select * from `table_127.0.0.1`;
78 Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_127.0.0.1' (code 1142)
79 RUN select * from `table_localhost`;
80 Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_localhost' (code 1142)
81 Mysqlx.Ok {
82 msg: "bye!"
83 }
84 DROP DATABASE xtest;
85 DROP USER user1@'%';