| 1 |
call mtr.add_suppression("Maximum number of authentication attempts reached"); |
| 2 |
call mtr.add_suppression("Access denied for user .*"); |
| 3 |
CREATE USER [email protected] IDENTIFIED WITH 'mysql_native_password' BY ''; |
| 4 |
CREATE USER [email protected] IDENTIFIED WITH 'mysql_native_password' BY ''; |
| 5 |
CREATE USER user_all@'%' IDENTIFIED WITH 'mysql_native_password' BY ''; |
| 6 |
CREATE USER user_localhost@localhost IDENTIFIED WITH 'mysql_native_password' BY ''; |
| 7 |
CREATE USER user_localhost_8_8_8_8@localhost IDENTIFIED WITH 'mysql_native_password' BY ''; |
| 8 |
CREATE USER [email protected] IDENTIFIED WITH 'mysql_native_password' BY ''; |
| 9 |
CREATE USER user_requires_ssl IDENTIFIED WITH 'mysql_native_password' BY '' REQUIRE SSL; |
| 10 |
GRANT ALL ON *.* TO [email protected]; |
| 11 |
GRANT ALL ON *.* TO [email protected]; |
| 12 |
GRANT ALL ON *.* TO user_all@'%'; |
| 13 |
GRANT ALL ON *.* TO user_localhost@localhost; |
| 14 |
GRANT ALL ON *.* TO [email protected]; |
| 15 |
GRANT ALL ON *.* TO user_localhost_8_8_8_8@localhost; |
| 16 |
GRANT ALL ON *.* TO user_requires_ssl; |
| 17 |
CREATE TABLE `city` ( |
| 18 |
`ID` int(11) NOT NULL auto_increment, |
| 19 |
`Name` char(35) NOT NULL default '', |
| 20 |
`CountryCode` char(3) NOT NULL default '', |
| 21 |
`District` char(20) NOT NULL default '', |
| 22 |
`Population` int(11) NOT NULL default '0', |
| 23 |
PRIMARY KEY (`ID`) |
| 24 |
); |
| 25 |
Warnings: |
| 26 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 27 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 28 |
INSERT INTO `city` VALUES (1,'Kabul','AFG','Kabol',1780); |
| 29 |
INSERT INTO `city` VALUES (2,'Qandahar','AFG','Qandahar',237); |
| 30 |
INSERT INTO `city` VALUES (3,'Herat','AFG','Herat',186); |
| 31 |
INSERT INTO `city` VALUES (4,'Mazar-e-Sharif','AFG','Balkh',127); |
| 32 |
INSERT INTO `city` VALUES (5,'Amsterdam','NLD','Noord-Holland',731); |
| 33 |
INSERT INTO `city` VALUES (6,'Rotterdam','NLD','Zuid-Holland',593); |
| 34 |
call mtr.add_suppression("Plugin mysqlx reported: '1.1: Unsuccessful login attempt: Invalid user or password'"); |
| 35 |
call mtr.add_suppression("Plugin mysqlx reported: '2.1: Unsuccessful login attempt: Invalid user or password'"); |
| 36 |
Application terminated with expected error: Access denied for user 'user_127_0_0_1'@'localhost' (using password: NO) (code 1045) |
| 37 |
ok |
| 38 |
Application terminated with expected error: Access denied for user 'user_8_8_8_8'@'localhost' (using password: NO) (code 1045) |
| 39 |
ok |
| 40 |
send Mysqlx.Sql.StmtExecute { |
| 41 |
stmt: "ping" |
| 42 |
namespace: "mysqlx" |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
command ok |
| 47 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 48 |
CONNECTION_TYPE |
| 49 |
Socket |
| 50 |
0 rows affected |
| 51 |
send Mysqlx.Crud.Find { |
| 52 |
collection { |
| 53 |
name: "city" |
| 54 |
schema: "test" |
| 55 |
} |
| 56 |
data_model: TABLE |
| 57 |
criteria { |
| 58 |
type: OPERATOR |
| 59 |
operator { |
| 60 |
name: "<" |
| 61 |
param { |
| 62 |
type: IDENT |
| 63 |
identifier { |
| 64 |
name: "Population" |
| 65 |
} |
| 66 |
} |
| 67 |
param { |
| 68 |
type: LITERAL |
| 69 |
literal { |
| 70 |
type: V_SINT |
| 71 |
v_signed_int: 250 |
| 72 |
} |
| 73 |
} |
| 74 |
} |
| 75 |
} |
| 76 |
} |
| 77 |
|
| 78 |
ID Name CountryCode District Population |
| 79 |
2 Qandahar AFG Qandahar 237 |
| 80 |
3 Herat AFG Herat 186 |
| 81 |
4 Mazar-e-Sharif AFG Balkh 127 |
| 82 |
command ok |
| 83 |
Mysqlx.Ok { |
| 84 |
msg: "bye!" |
| 85 |
} |
| 86 |
ok |
| 87 |
send Mysqlx.Sql.StmtExecute { |
| 88 |
stmt: "ping" |
| 89 |
namespace: "mysqlx" |
| 90 |
} |
| 91 |
|
| 92 |
|
| 93 |
command ok |
| 94 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 95 |
CONNECTION_TYPE |
| 96 |
Socket |
| 97 |
0 rows affected |
| 98 |
send Mysqlx.Crud.Find { |
| 99 |
collection { |
| 100 |
name: "city" |
| 101 |
schema: "test" |
| 102 |
} |
| 103 |
data_model: TABLE |
| 104 |
criteria { |
| 105 |
type: OPERATOR |
| 106 |
operator { |
| 107 |
name: "<" |
| 108 |
param { |
| 109 |
type: IDENT |
| 110 |
identifier { |
| 111 |
name: "Population" |
| 112 |
} |
| 113 |
} |
| 114 |
param { |
| 115 |
type: LITERAL |
| 116 |
literal { |
| 117 |
type: V_SINT |
| 118 |
v_signed_int: 250 |
| 119 |
} |
| 120 |
} |
| 121 |
} |
| 122 |
} |
| 123 |
} |
| 124 |
|
| 125 |
ID Name CountryCode District Population |
| 126 |
2 Qandahar AFG Qandahar 237 |
| 127 |
3 Herat AFG Herat 186 |
| 128 |
4 Mazar-e-Sharif AFG Balkh 127 |
| 129 |
command ok |
| 130 |
Mysqlx.Ok { |
| 131 |
msg: "bye!" |
| 132 |
} |
| 133 |
ok |
| 134 |
send Mysqlx.Sql.StmtExecute { |
| 135 |
stmt: "ping" |
| 136 |
namespace: "mysqlx" |
| 137 |
} |
| 138 |
|
| 139 |
|
| 140 |
command ok |
| 141 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 142 |
CONNECTION_TYPE |
| 143 |
Socket |
| 144 |
0 rows affected |
| 145 |
send Mysqlx.Crud.Find { |
| 146 |
collection { |
| 147 |
name: "city" |
| 148 |
schema: "test" |
| 149 |
} |
| 150 |
data_model: TABLE |
| 151 |
criteria { |
| 152 |
type: OPERATOR |
| 153 |
operator { |
| 154 |
name: "<" |
| 155 |
param { |
| 156 |
type: IDENT |
| 157 |
identifier { |
| 158 |
name: "Population" |
| 159 |
} |
| 160 |
} |
| 161 |
param { |
| 162 |
type: LITERAL |
| 163 |
literal { |
| 164 |
type: V_SINT |
| 165 |
v_signed_int: 250 |
| 166 |
} |
| 167 |
} |
| 168 |
} |
| 169 |
} |
| 170 |
} |
| 171 |
|
| 172 |
ID Name CountryCode District Population |
| 173 |
2 Qandahar AFG Qandahar 237 |
| 174 |
3 Herat AFG Herat 186 |
| 175 |
4 Mazar-e-Sharif AFG Balkh 127 |
| 176 |
command ok |
| 177 |
Mysqlx.Ok { |
| 178 |
msg: "bye!" |
| 179 |
} |
| 180 |
ok |
| 181 |
Application terminated with expected error: Access denied for user 'user_requires_ssl'@'localhost' (using password: NO) (code 1045) |
| 182 |
ok |
| 183 |
send Mysqlx.Sql.StmtExecute { |
| 184 |
stmt: "ping" |
| 185 |
namespace: "mysqlx" |
| 186 |
} |
| 187 |
|
| 188 |
|
| 189 |
command ok |
| 190 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 191 |
CONNECTION_TYPE |
| 192 |
SSL/TLS |
| 193 |
0 rows affected |
| 194 |
send Mysqlx.Crud.Find { |
| 195 |
collection { |
| 196 |
name: "city" |
| 197 |
schema: "test" |
| 198 |
} |
| 199 |
data_model: TABLE |
| 200 |
criteria { |
| 201 |
type: OPERATOR |
| 202 |
operator { |
| 203 |
name: "<" |
| 204 |
param { |
| 205 |
type: IDENT |
| 206 |
identifier { |
| 207 |
name: "Population" |
| 208 |
} |
| 209 |
} |
| 210 |
param { |
| 211 |
type: LITERAL |
| 212 |
literal { |
| 213 |
type: V_SINT |
| 214 |
v_signed_int: 250 |
| 215 |
} |
| 216 |
} |
| 217 |
} |
| 218 |
} |
| 219 |
} |
| 220 |
|
| 221 |
ID Name CountryCode District Population |
| 222 |
2 Qandahar AFG Qandahar 237 |
| 223 |
3 Herat AFG Herat 186 |
| 224 |
4 Mazar-e-Sharif AFG Balkh 127 |
| 225 |
command ok |
| 226 |
Mysqlx.Ok { |
| 227 |
msg: "bye!" |
| 228 |
} |
| 229 |
ok |
| 230 |
Check if mysqlx_socket has correct value |
| 231 |
result |
| 232 |
1 |
| 233 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 234 |
CONNECTION_TYPE |
| 235 |
Socket |
| 236 |
0 rows affected |
| 237 |
connecting... |
| 238 |
active session is now 'session2' |
| 239 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 240 |
CONNECTION_TYPE |
| 241 |
Socket |
| 242 |
0 rows affected |
| 243 |
connecting... |
| 244 |
active session is now 'session3' |
| 245 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 246 |
CONNECTION_TYPE |
| 247 |
Socket |
| 248 |
0 rows affected |
| 249 |
switched to session session3 |
| 250 |
RUN select '3_1'; |
| 251 |
switched to session session2 |
| 252 |
RUN select '2_1'; |
| 253 |
switched to session default |
| 254 |
RUN select '1_1'; |
| 255 |
switched to session session2 |
| 256 |
2_1 |
| 257 |
2_1 |
| 258 |
0 rows affected |
| 259 |
switched to session session3 |
| 260 |
3_1 |
| 261 |
3_1 |
| 262 |
0 rows affected |
| 263 |
switched to session default |
| 264 |
1_1 |
| 265 |
1_1 |
| 266 |
0 rows affected |
| 267 |
Mysqlx.Ok { |
| 268 |
msg: "bye!" |
| 269 |
} |
| 270 |
ok |
| 271 |
# |
| 272 |
# Match capabilities with the result file, |
| 273 |
# must contain PLAIN and MYSQL41 |
| 274 |
# |
| 275 |
Mysqlx.Connection.Capabilities(capabilities[1].value.array) = Mysqlx.Datatypes.Array { |
| 276 |
value { |
| 277 |
type: SCALAR |
| 278 |
scalar { |
| 279 |
type: V_STRING |
| 280 |
v_string { |
| 281 |
value: "MYSQL41" |
| 282 |
} |
| 283 |
} |
| 284 |
} |
| 285 |
value { |
| 286 |
type: SCALAR |
| 287 |
scalar { |
| 288 |
type: V_STRING |
| 289 |
v_string { |
| 290 |
value: "PLAIN" |
| 291 |
} |
| 292 |
} |
| 293 |
} |
| 294 |
value { |
| 295 |
type: SCALAR |
| 296 |
scalar { |
| 297 |
type: V_STRING |
| 298 |
v_string { |
| 299 |
value: "SHA256_MEMORY" |
| 300 |
} |
| 301 |
} |
| 302 |
} |
| 303 |
} |
| 304 |
|
| 305 |
# |
| 306 |
# Do plain authentication (must be available) |
| 307 |
# |
| 308 |
Mysqlx.Session.AuthenticateOk { |
| 309 |
auth_data: "" |
| 310 |
} |
| 311 |
|
| 312 |
ok |
| 313 |
# |
| 314 |
# Lets confirm that user can connect through UNIX socket connection is secure one |
| 315 |
# |
| 316 |
SET GLOBAL require_secure_transport:=1; |
| 317 |
send Mysqlx.Sql.StmtExecute { |
| 318 |
stmt: "ping" |
| 319 |
namespace: "mysqlx" |
| 320 |
} |
| 321 |
|
| 322 |
|
| 323 |
command ok |
| 324 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 325 |
CONNECTION_TYPE |
| 326 |
Socket |
| 327 |
0 rows affected |
| 328 |
send Mysqlx.Crud.Find { |
| 329 |
collection { |
| 330 |
name: "city" |
| 331 |
schema: "test" |
| 332 |
} |
| 333 |
data_model: TABLE |
| 334 |
criteria { |
| 335 |
type: OPERATOR |
| 336 |
operator { |
| 337 |
name: "<" |
| 338 |
param { |
| 339 |
type: IDENT |
| 340 |
identifier { |
| 341 |
name: "Population" |
| 342 |
} |
| 343 |
} |
| 344 |
param { |
| 345 |
type: LITERAL |
| 346 |
literal { |
| 347 |
type: V_SINT |
| 348 |
v_signed_int: 250 |
| 349 |
} |
| 350 |
} |
| 351 |
} |
| 352 |
} |
| 353 |
} |
| 354 |
|
| 355 |
ID Name CountryCode District Population |
| 356 |
2 Qandahar AFG Qandahar 237 |
| 357 |
3 Herat AFG Herat 186 |
| 358 |
4 Mazar-e-Sharif AFG Balkh 127 |
| 359 |
command ok |
| 360 |
Mysqlx.Ok { |
| 361 |
msg: "bye!" |
| 362 |
} |
| 363 |
ok |
| 364 |
# |
| 365 |
# Match capabilities with the result file, |
| 366 |
# must contain PLAIN and MYSQL41 |
| 367 |
# |
| 368 |
Mysqlx.Connection.Capabilities(capabilities[1].value.array) = Mysqlx.Datatypes.Array { |
| 369 |
value { |
| 370 |
type: SCALAR |
| 371 |
scalar { |
| 372 |
type: V_STRING |
| 373 |
v_string { |
| 374 |
value: "MYSQL41" |
| 375 |
} |
| 376 |
} |
| 377 |
} |
| 378 |
value { |
| 379 |
type: SCALAR |
| 380 |
scalar { |
| 381 |
type: V_STRING |
| 382 |
v_string { |
| 383 |
value: "PLAIN" |
| 384 |
} |
| 385 |
} |
| 386 |
} |
| 387 |
value { |
| 388 |
type: SCALAR |
| 389 |
scalar { |
| 390 |
type: V_STRING |
| 391 |
v_string { |
| 392 |
value: "SHA256_MEMORY" |
| 393 |
} |
| 394 |
} |
| 395 |
} |
| 396 |
} |
| 397 |
|
| 398 |
# |
| 399 |
# Do plain authentication (must be available) |
| 400 |
# |
| 401 |
Mysqlx.Session.AuthenticateOk { |
| 402 |
auth_data: "" |
| 403 |
} |
| 404 |
|
| 405 |
ok |
| 406 |
SET GLOBAL require_secure_transport:=0; |
| 407 |
# restart: --mysqlx-socket=SOCKET |
| 408 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 409 |
CONNECTION_TYPE |
| 410 |
Socket |
| 411 |
0 rows affected |
| 412 |
Mysqlx.Ok { |
| 413 |
msg: "bye!" |
| 414 |
} |
| 415 |
ok |
| 416 |
RUN SELECT CONNECTION_TYPE from performance_schema.threads where processlist_command='Query' and PROCESSLIST_ID=connection_id(); |
| 417 |
CONNECTION_TYPE |
| 418 |
Socket |
| 419 |
0 rows affected |
| 420 |
Mysqlx.Ok { |
| 421 |
msg: "bye!" |
| 422 |
} |
| 423 |
ok |
| 424 |
# restart: |
| 425 |
DROP TABLE `city`; |
| 426 |
DROP USER [email protected]; |
| 427 |
DROP USER [email protected]; |
| 428 |
DROP USER user_all@'%'; |
| 429 |
DROP USER user_localhost@localhost; |
| 430 |
DROP USER user_localhost_8_8_8_8@localhost; |
| 431 |
DROP USER [email protected]; |
| 432 |
DROP USER user_requires_ssl; |