| 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@'%'; |
| 86 |
call mtr.add_suppression("Plugin mysqlx reported: .*Unsuccessful login attempt: Invalid user or password"); |
| 87 |
CREATE DATABASE xtest; |
| 88 |
USE xtest; |
| 89 |
CREATE USER user1@'%' IDENTIFIED WITH 'sha256_password' BY 'pass_all_hosts'; |
| 90 |
CREATE USER user1@'127.0.0.1' IDENTIFIED WITH 'sha256_password' BY 'pass_127.0.0.1'; |
| 91 |
CREATE USER user1@'localhost' IDENTIFIED WITH 'sha256_password' BY 'pass_localhost'; |
| 92 |
CREATE TABLE `table_all_hosts`(id integer); |
| 93 |
CREATE TABLE `table_127.0.0.1`(id integer); |
| 94 |
CREATE TABLE `table_localhost`(id integer); |
| 95 |
INSERT INTO `table_all_hosts`(id) VALUES(2),(4); |
| 96 |
INSERT INTO `table_127.0.0.1`(id) VALUES(1),(3); |
| 97 |
INSERT INTO `table_localhost`(id) VALUES(5),(6); |
| 98 |
GRANT SELECT ON xtest.`table_all_hosts` TO 'user1'@'%'; |
| 99 |
GRANT SELECT ON xtest.`table_127.0.0.1` TO 'user1'@'127.0.0.1'; |
| 100 |
GRANT SELECT ON xtest.`table_localhost` TO 'user1'@'localhost'; |
| 101 |
## |
| 102 |
## X Plugin should only authenticate 'user1'@'127.0.0.1' account on TCP |
| 103 |
## |
| 104 |
RUN select current_user(); |
| 105 |
current_user() |
| 106 |
[email protected] |
| 107 |
0 rows affected |
| 108 |
RUN select * from `table_all_hosts`; |
| 109 |
Got expected error (code 0) |
| 110 |
RUN select * from `table_127.0.0.1`; |
| 111 |
Got expected error (code 0) |
| 112 |
RUN select * from `table_localhost`; |
| 113 |
Got expected error (code 0) |
| 114 |
Mysqlx.Ok { |
| 115 |
msg: "bye!" |
| 116 |
} |
| 117 |
Login with 'user1:pass_localhost@localhost/xtest' should fail |
| 118 |
error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045) |
| 119 |
ok |
| 120 |
Login with 'user1:pass_all_hosts@localhost/xtest' should fail |
| 121 |
error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045) |
| 122 |
ok |
| 123 |
DROP USER user1@'127.0.0.1'; |
| 124 |
## |
| 125 |
## X Plugin should only authenticate 'user1'@'127.0.0.%' account on TCP |
| 126 |
## |
| 127 |
Login with 'user1:pass_127.0.0.1@localhost/xtest' should fail |
| 128 |
error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045) |
| 129 |
ok |
| 130 |
RUN select current_user(); |
| 131 |
current_user() |
| 132 |
user1@localhost |
| 133 |
0 rows affected |
| 134 |
RUN select * from `table_all_hosts`; |
| 135 |
Got expected error (code 0) |
| 136 |
RUN select * from `table_127.0.0.1`; |
| 137 |
Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_127.0.0.1' (code 1142) |
| 138 |
RUN select * from `table_localhost`; |
| 139 |
Got expected error (code 0) |
| 140 |
Mysqlx.Ok { |
| 141 |
msg: "bye!" |
| 142 |
} |
| 143 |
Login with 'user1:pass_all_hosts@localhost/xtest' should fail |
| 144 |
error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045) |
| 145 |
ok |
| 146 |
DROP USER user1@'localhost'; |
| 147 |
## |
| 148 |
## X Plugin should only authenticate 'user1'@'%' account on TCP |
| 149 |
## |
| 150 |
Login with 'user1:pass_127.0.0.1@localhost/xtest' should fail |
| 151 |
error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045) |
| 152 |
ok |
| 153 |
Login with 'user1:pass_localhost@localhost/xtest' should fail |
| 154 |
error (as expected): Access denied for user 'user1'@'localhost' (using password: YES) (code 1045) |
| 155 |
ok |
| 156 |
RUN select current_user(); |
| 157 |
current_user() |
| 158 |
user1@% |
| 159 |
0 rows affected |
| 160 |
RUN select * from `table_all_hosts`; |
| 161 |
Got expected error (code 0) |
| 162 |
RUN select * from `table_127.0.0.1`; |
| 163 |
Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_127.0.0.1' (code 1142) |
| 164 |
RUN select * from `table_localhost`; |
| 165 |
Got expected error: SELECT command denied to user 'user1'@'localhost' for table 'table_localhost' (code 1142) |
| 166 |
Mysqlx.Ok { |
| 167 |
msg: "bye!" |
| 168 |
} |
| 169 |
DROP DATABASE xtest; |
| 170 |
DROP USER user1@'%'; |