| 1 |
CREATE SCHEMA IF NOT EXISTS xtest; |
| 2 |
USE xtest; |
| 3 |
CREATE PROCEDURE recreate_tables() |
| 4 |
BEGIN |
| 5 |
CREATE TABLE IF NOT EXISTS xtable (phrase VARCHAR(30), prio INTEGER); |
| 6 |
TRUNCATE TABLE xtable; |
| 7 |
INSERT INTO xtable (phrase, prio) VALUES ('Alice has a cat', 1); |
| 8 |
INSERT INTO xtable (phrase, prio) VALUES ('Bob has a dog 1', 2); |
| 9 |
INSERT INTO xtable (phrase, prio) VALUES ('Peppa has a teddy', 1); |
| 10 |
INSERT INTO xtable (phrase, prio) VALUES ('Bob has a dog 2', 3); |
| 11 |
INSERT INTO xtable (phrase, prio) VALUES ('Row to delete', 4); |
| 12 |
CREATE TABLE IF NOT EXISTS xtable_with_pk (p_id INTEGER AUTO_INCREMENT PRIMARY KEY, description varchar(40)); |
| 13 |
TRUNCATE TABLE xtable_with_pk; |
| 14 |
INSERT INTO xtable_with_pk (description) VALUES ('MyRow'); |
| 15 |
END // |
| 16 |
|
| 17 |
## A. Execute the test using zlib/group |
| 18 |
# |
| 19 |
CALL recreate_tables(); |
| 20 |
|
| 21 |
|
| 22 |
## Test setup |
| 23 |
|
| 24 |
|
| 25 |
## I. Validate simple resultsets for CRUD messages |
| 26 |
# |
| 27 |
# 1. Assert resultset for CRUD-delete message |
| 28 |
# 2. Assert resultset for CRUD-update message |
| 29 |
# 3. Assert resultset for CRUD-create message (table with auto_inc column) |
| 30 |
# 4. Assert resultset for CRUD-create message (table without auto_inc column) |
| 31 |
# 5. Assert resultset for CRUD-read message |
| 32 |
|
| 33 |
## II. Validate simple resultset with warnings |
| 34 |
# |
| 35 |
# 1. Assert one resultsets for select queries |
| 36 |
|
| 37 |
# |
| 38 |
# I.1 |
| 39 |
send Mysqlx.Prepare.Prepare { |
| 40 |
stmt_id: 1 |
| 41 |
stmt { |
| 42 |
type: DELETE |
| 43 |
delete { |
| 44 |
collection { |
| 45 |
name: "xtable" |
| 46 |
} |
| 47 |
data_model: TABLE |
| 48 |
criteria { |
| 49 |
type: OPERATOR |
| 50 |
operator { |
| 51 |
name: "==" |
| 52 |
param { |
| 53 |
type: IDENT |
| 54 |
identifier { |
| 55 |
name: "prio" |
| 56 |
} |
| 57 |
} |
| 58 |
param { |
| 59 |
type: LITERAL |
| 60 |
literal { |
| 61 |
type: V_SINT |
| 62 |
v_signed_int: 3 |
| 63 |
} |
| 64 |
} |
| 65 |
} |
| 66 |
} |
| 67 |
} |
| 68 |
} |
| 69 |
} |
| 70 |
|
| 71 |
RUN recvok |
| 72 |
send Mysqlx.Prepare.Execute { |
| 73 |
stmt_id: 1 |
| 74 |
} |
| 75 |
|
| 76 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 77 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 78 |
|
| 79 |
# |
| 80 |
# I.2 |
| 81 |
send Mysqlx.Prepare.Prepare { |
| 82 |
stmt_id: 2 |
| 83 |
stmt { |
| 84 |
type: UPDATE |
| 85 |
update { |
| 86 |
collection { |
| 87 |
name: "xtable" |
| 88 |
} |
| 89 |
data_model: TABLE |
| 90 |
operation { |
| 91 |
source { |
| 92 |
name: "prio" |
| 93 |
} |
| 94 |
operation: SET |
| 95 |
value { |
| 96 |
type: OPERATOR |
| 97 |
operator { |
| 98 |
name: "-" |
| 99 |
param { |
| 100 |
type: IDENT |
| 101 |
identifier { |
| 102 |
name: "prio" |
| 103 |
} |
| 104 |
} |
| 105 |
param { |
| 106 |
type: LITERAL |
| 107 |
literal { |
| 108 |
type: V_SINT |
| 109 |
v_signed_int: 1 |
| 110 |
} |
| 111 |
} |
| 112 |
} |
| 113 |
} |
| 114 |
} |
| 115 |
} |
| 116 |
} |
| 117 |
} |
| 118 |
|
| 119 |
RUN recvok |
| 120 |
send Mysqlx.Prepare.Execute { |
| 121 |
stmt_id: 2 |
| 122 |
} |
| 123 |
|
| 124 |
[ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING] |
| 125 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:4] |
| 126 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 127 |
|
| 128 |
# |
| 129 |
# I.3 |
| 130 |
send Mysqlx.Prepare.Prepare { |
| 131 |
stmt_id: 3 |
| 132 |
stmt { |
| 133 |
type: INSERT |
| 134 |
insert { |
| 135 |
collection { |
| 136 |
name: "xtable" |
| 137 |
} |
| 138 |
data_model: TABLE |
| 139 |
row { |
| 140 |
field { |
| 141 |
type: LITERAL |
| 142 |
literal { |
| 143 |
type: V_STRING |
| 144 |
v_string { |
| 145 |
value: "sixth" |
| 146 |
} |
| 147 |
} |
| 148 |
} |
| 149 |
field { |
| 150 |
type: LITERAL |
| 151 |
literal { |
| 152 |
type: V_SINT |
| 153 |
v_signed_int: 3 |
| 154 |
} |
| 155 |
} |
| 156 |
} |
| 157 |
upsert: false |
| 158 |
} |
| 159 |
} |
| 160 |
} |
| 161 |
|
| 162 |
RUN recvok |
| 163 |
send Mysqlx.Prepare.Execute { |
| 164 |
stmt_id: 3 |
| 165 |
} |
| 166 |
|
| 167 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 168 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 169 |
|
| 170 |
# |
| 171 |
# I.4 |
| 172 |
send Mysqlx.Prepare.Prepare { |
| 173 |
stmt_id: 4 |
| 174 |
stmt { |
| 175 |
type: INSERT |
| 176 |
insert { |
| 177 |
collection { |
| 178 |
name: "xtable_with_pk" |
| 179 |
} |
| 180 |
data_model: TABLE |
| 181 |
projection { |
| 182 |
name: "description" |
| 183 |
} |
| 184 |
row { |
| 185 |
field { |
| 186 |
type: LITERAL |
| 187 |
literal { |
| 188 |
type: V_STRING |
| 189 |
v_string { |
| 190 |
value: "test" |
| 191 |
} |
| 192 |
} |
| 193 |
} |
| 194 |
} |
| 195 |
upsert: false |
| 196 |
} |
| 197 |
} |
| 198 |
} |
| 199 |
|
| 200 |
RUN recvok |
| 201 |
send Mysqlx.Prepare.Execute { |
| 202 |
stmt_id: 4 |
| 203 |
} |
| 204 |
|
| 205 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 206 |
[ASSERT notice session state change - GENERATED_INSERT_ID, v_unsigned_int: 2] |
| 207 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 208 |
|
| 209 |
# |
| 210 |
# I.5 |
| 211 |
send Mysqlx.Prepare.Prepare { |
| 212 |
stmt_id: 5 |
| 213 |
stmt { |
| 214 |
type: FIND |
| 215 |
find { |
| 216 |
collection { |
| 217 |
name: "xtable" |
| 218 |
} |
| 219 |
data_model: TABLE |
| 220 |
projection { |
| 221 |
source { |
| 222 |
type: IDENT |
| 223 |
identifier { |
| 224 |
name: "prio" |
| 225 |
} |
| 226 |
} |
| 227 |
alias: "prio" |
| 228 |
} |
| 229 |
} |
| 230 |
} |
| 231 |
} |
| 232 |
|
| 233 |
RUN recvok |
| 234 |
send Mysqlx.Prepare.Execute { |
| 235 |
stmt_id: 5 |
| 236 |
} |
| 237 |
|
| 238 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 239 |
[ASSERT Mysqlx.Resultset.Row] |
| 240 |
[ASSERT Mysqlx.Resultset.Row] |
| 241 |
[ASSERT Mysqlx.Resultset.Row] |
| 242 |
[ASSERT Mysqlx.Resultset.Row] |
| 243 |
[ASSERT Mysqlx.Resultset.Row] |
| 244 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 245 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 246 |
|
| 247 |
# |
| 248 |
# II.1 |
| 249 |
send Mysqlx.Prepare.Prepare { |
| 250 |
stmt_id: 6 |
| 251 |
stmt { |
| 252 |
type: FIND |
| 253 |
find { |
| 254 |
collection { |
| 255 |
name: "xtable" |
| 256 |
} |
| 257 |
data_model: TABLE |
| 258 |
projection { |
| 259 |
source { |
| 260 |
type: OPERATOR |
| 261 |
operator { |
| 262 |
name: "/" |
| 263 |
param { |
| 264 |
type: LITERAL |
| 265 |
literal { |
| 266 |
type: V_SINT |
| 267 |
v_signed_int: 1 |
| 268 |
} |
| 269 |
} |
| 270 |
param { |
| 271 |
type: IDENT |
| 272 |
identifier { |
| 273 |
name: "prio" |
| 274 |
} |
| 275 |
} |
| 276 |
} |
| 277 |
} |
| 278 |
alias: "name" |
| 279 |
} |
| 280 |
} |
| 281 |
} |
| 282 |
} |
| 283 |
|
| 284 |
RUN recvok |
| 285 |
send Mysqlx.Prepare.Execute { |
| 286 |
stmt_id: 6 |
| 287 |
} |
| 288 |
|
| 289 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 290 |
[ASSERT Mysqlx.Resultset.Row] |
| 291 |
[ASSERT Mysqlx.Resultset.Row] |
| 292 |
[ASSERT Mysqlx.Resultset.Row] |
| 293 |
[ASSERT Mysqlx.Resultset.Row] |
| 294 |
[ASSERT Mysqlx.Resultset.Row] |
| 295 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 296 |
[ASSERT notice warning - WARNING, 1365] |
| 297 |
[ASSERT notice warning - WARNING, 1365] |
| 298 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 299 |
Mysqlx.Ok { |
| 300 |
msg: "bye!" |
| 301 |
} |
| 302 |
ok |
| 303 |
|
| 304 |
## B. Execute the test using zlib/multiple |
| 305 |
# |
| 306 |
CALL recreate_tables(); |
| 307 |
|
| 308 |
|
| 309 |
## Test setup |
| 310 |
|
| 311 |
|
| 312 |
## I. Validate simple resultsets for CRUD messages |
| 313 |
# |
| 314 |
# 1. Assert resultset for CRUD-delete message |
| 315 |
# 2. Assert resultset for CRUD-update message |
| 316 |
# 3. Assert resultset for CRUD-create message (table with auto_inc column) |
| 317 |
# 4. Assert resultset for CRUD-create message (table without auto_inc column) |
| 318 |
# 5. Assert resultset for CRUD-read message |
| 319 |
|
| 320 |
## II. Validate simple resultset with warnings |
| 321 |
# |
| 322 |
# 1. Assert one resultsets for select queries |
| 323 |
|
| 324 |
# |
| 325 |
# I.1 |
| 326 |
send Mysqlx.Prepare.Prepare { |
| 327 |
stmt_id: 1 |
| 328 |
stmt { |
| 329 |
type: DELETE |
| 330 |
delete { |
| 331 |
collection { |
| 332 |
name: "xtable" |
| 333 |
} |
| 334 |
data_model: TABLE |
| 335 |
criteria { |
| 336 |
type: OPERATOR |
| 337 |
operator { |
| 338 |
name: "==" |
| 339 |
param { |
| 340 |
type: IDENT |
| 341 |
identifier { |
| 342 |
name: "prio" |
| 343 |
} |
| 344 |
} |
| 345 |
param { |
| 346 |
type: LITERAL |
| 347 |
literal { |
| 348 |
type: V_SINT |
| 349 |
v_signed_int: 3 |
| 350 |
} |
| 351 |
} |
| 352 |
} |
| 353 |
} |
| 354 |
} |
| 355 |
} |
| 356 |
} |
| 357 |
|
| 358 |
RUN recvok |
| 359 |
send Mysqlx.Prepare.Execute { |
| 360 |
stmt_id: 1 |
| 361 |
} |
| 362 |
|
| 363 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 364 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 365 |
|
| 366 |
# |
| 367 |
# I.2 |
| 368 |
send Mysqlx.Prepare.Prepare { |
| 369 |
stmt_id: 2 |
| 370 |
stmt { |
| 371 |
type: UPDATE |
| 372 |
update { |
| 373 |
collection { |
| 374 |
name: "xtable" |
| 375 |
} |
| 376 |
data_model: TABLE |
| 377 |
operation { |
| 378 |
source { |
| 379 |
name: "prio" |
| 380 |
} |
| 381 |
operation: SET |
| 382 |
value { |
| 383 |
type: OPERATOR |
| 384 |
operator { |
| 385 |
name: "-" |
| 386 |
param { |
| 387 |
type: IDENT |
| 388 |
identifier { |
| 389 |
name: "prio" |
| 390 |
} |
| 391 |
} |
| 392 |
param { |
| 393 |
type: LITERAL |
| 394 |
literal { |
| 395 |
type: V_SINT |
| 396 |
v_signed_int: 1 |
| 397 |
} |
| 398 |
} |
| 399 |
} |
| 400 |
} |
| 401 |
} |
| 402 |
} |
| 403 |
} |
| 404 |
} |
| 405 |
|
| 406 |
RUN recvok |
| 407 |
send Mysqlx.Prepare.Execute { |
| 408 |
stmt_id: 2 |
| 409 |
} |
| 410 |
|
| 411 |
[ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING] |
| 412 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:4] |
| 413 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 414 |
|
| 415 |
# |
| 416 |
# I.3 |
| 417 |
send Mysqlx.Prepare.Prepare { |
| 418 |
stmt_id: 3 |
| 419 |
stmt { |
| 420 |
type: INSERT |
| 421 |
insert { |
| 422 |
collection { |
| 423 |
name: "xtable" |
| 424 |
} |
| 425 |
data_model: TABLE |
| 426 |
row { |
| 427 |
field { |
| 428 |
type: LITERAL |
| 429 |
literal { |
| 430 |
type: V_STRING |
| 431 |
v_string { |
| 432 |
value: "sixth" |
| 433 |
} |
| 434 |
} |
| 435 |
} |
| 436 |
field { |
| 437 |
type: LITERAL |
| 438 |
literal { |
| 439 |
type: V_SINT |
| 440 |
v_signed_int: 3 |
| 441 |
} |
| 442 |
} |
| 443 |
} |
| 444 |
upsert: false |
| 445 |
} |
| 446 |
} |
| 447 |
} |
| 448 |
|
| 449 |
RUN recvok |
| 450 |
send Mysqlx.Prepare.Execute { |
| 451 |
stmt_id: 3 |
| 452 |
} |
| 453 |
|
| 454 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 455 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 456 |
|
| 457 |
# |
| 458 |
# I.4 |
| 459 |
send Mysqlx.Prepare.Prepare { |
| 460 |
stmt_id: 4 |
| 461 |
stmt { |
| 462 |
type: INSERT |
| 463 |
insert { |
| 464 |
collection { |
| 465 |
name: "xtable_with_pk" |
| 466 |
} |
| 467 |
data_model: TABLE |
| 468 |
projection { |
| 469 |
name: "description" |
| 470 |
} |
| 471 |
row { |
| 472 |
field { |
| 473 |
type: LITERAL |
| 474 |
literal { |
| 475 |
type: V_STRING |
| 476 |
v_string { |
| 477 |
value: "test" |
| 478 |
} |
| 479 |
} |
| 480 |
} |
| 481 |
} |
| 482 |
upsert: false |
| 483 |
} |
| 484 |
} |
| 485 |
} |
| 486 |
|
| 487 |
RUN recvok |
| 488 |
send Mysqlx.Prepare.Execute { |
| 489 |
stmt_id: 4 |
| 490 |
} |
| 491 |
|
| 492 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 493 |
[ASSERT notice session state change - GENERATED_INSERT_ID, v_unsigned_int: 2] |
| 494 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 495 |
|
| 496 |
# |
| 497 |
# I.5 |
| 498 |
send Mysqlx.Prepare.Prepare { |
| 499 |
stmt_id: 5 |
| 500 |
stmt { |
| 501 |
type: FIND |
| 502 |
find { |
| 503 |
collection { |
| 504 |
name: "xtable" |
| 505 |
} |
| 506 |
data_model: TABLE |
| 507 |
projection { |
| 508 |
source { |
| 509 |
type: IDENT |
| 510 |
identifier { |
| 511 |
name: "prio" |
| 512 |
} |
| 513 |
} |
| 514 |
alias: "prio" |
| 515 |
} |
| 516 |
} |
| 517 |
} |
| 518 |
} |
| 519 |
|
| 520 |
RUN recvok |
| 521 |
send Mysqlx.Prepare.Execute { |
| 522 |
stmt_id: 5 |
| 523 |
} |
| 524 |
|
| 525 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 526 |
[ASSERT Mysqlx.Resultset.Row] |
| 527 |
[ASSERT Mysqlx.Resultset.Row] |
| 528 |
[ASSERT Mysqlx.Resultset.Row] |
| 529 |
[ASSERT Mysqlx.Resultset.Row] |
| 530 |
[ASSERT Mysqlx.Resultset.Row] |
| 531 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 532 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 533 |
|
| 534 |
# |
| 535 |
# II.1 |
| 536 |
send Mysqlx.Prepare.Prepare { |
| 537 |
stmt_id: 6 |
| 538 |
stmt { |
| 539 |
type: FIND |
| 540 |
find { |
| 541 |
collection { |
| 542 |
name: "xtable" |
| 543 |
} |
| 544 |
data_model: TABLE |
| 545 |
projection { |
| 546 |
source { |
| 547 |
type: OPERATOR |
| 548 |
operator { |
| 549 |
name: "/" |
| 550 |
param { |
| 551 |
type: LITERAL |
| 552 |
literal { |
| 553 |
type: V_SINT |
| 554 |
v_signed_int: 1 |
| 555 |
} |
| 556 |
} |
| 557 |
param { |
| 558 |
type: IDENT |
| 559 |
identifier { |
| 560 |
name: "prio" |
| 561 |
} |
| 562 |
} |
| 563 |
} |
| 564 |
} |
| 565 |
alias: "name" |
| 566 |
} |
| 567 |
} |
| 568 |
} |
| 569 |
} |
| 570 |
|
| 571 |
RUN recvok |
| 572 |
send Mysqlx.Prepare.Execute { |
| 573 |
stmt_id: 6 |
| 574 |
} |
| 575 |
|
| 576 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 577 |
[ASSERT Mysqlx.Resultset.Row] |
| 578 |
[ASSERT Mysqlx.Resultset.Row] |
| 579 |
[ASSERT Mysqlx.Resultset.Row] |
| 580 |
[ASSERT Mysqlx.Resultset.Row] |
| 581 |
[ASSERT Mysqlx.Resultset.Row] |
| 582 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 583 |
[ASSERT notice warning - WARNING, 1365] |
| 584 |
[ASSERT notice warning - WARNING, 1365] |
| 585 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 586 |
Mysqlx.Ok { |
| 587 |
msg: "bye!" |
| 588 |
} |
| 589 |
ok |
| 590 |
|
| 591 |
## C. Execute the test using zlib/single |
| 592 |
# |
| 593 |
CALL recreate_tables(); |
| 594 |
|
| 595 |
|
| 596 |
## Test setup |
| 597 |
|
| 598 |
|
| 599 |
## I. Validate simple resultsets for CRUD messages |
| 600 |
# |
| 601 |
# 1. Assert resultset for CRUD-delete message |
| 602 |
# 2. Assert resultset for CRUD-update message |
| 603 |
# 3. Assert resultset for CRUD-create message (table with auto_inc column) |
| 604 |
# 4. Assert resultset for CRUD-create message (table without auto_inc column) |
| 605 |
# 5. Assert resultset for CRUD-read message |
| 606 |
|
| 607 |
## II. Validate simple resultset with warnings |
| 608 |
# |
| 609 |
# 1. Assert one resultsets for select queries |
| 610 |
|
| 611 |
# |
| 612 |
# I.1 |
| 613 |
send Mysqlx.Prepare.Prepare { |
| 614 |
stmt_id: 1 |
| 615 |
stmt { |
| 616 |
type: DELETE |
| 617 |
delete { |
| 618 |
collection { |
| 619 |
name: "xtable" |
| 620 |
} |
| 621 |
data_model: TABLE |
| 622 |
criteria { |
| 623 |
type: OPERATOR |
| 624 |
operator { |
| 625 |
name: "==" |
| 626 |
param { |
| 627 |
type: IDENT |
| 628 |
identifier { |
| 629 |
name: "prio" |
| 630 |
} |
| 631 |
} |
| 632 |
param { |
| 633 |
type: LITERAL |
| 634 |
literal { |
| 635 |
type: V_SINT |
| 636 |
v_signed_int: 3 |
| 637 |
} |
| 638 |
} |
| 639 |
} |
| 640 |
} |
| 641 |
} |
| 642 |
} |
| 643 |
} |
| 644 |
|
| 645 |
RUN recvok |
| 646 |
send Mysqlx.Prepare.Execute { |
| 647 |
stmt_id: 1 |
| 648 |
} |
| 649 |
|
| 650 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 651 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 652 |
|
| 653 |
# |
| 654 |
# I.2 |
| 655 |
send Mysqlx.Prepare.Prepare { |
| 656 |
stmt_id: 2 |
| 657 |
stmt { |
| 658 |
type: UPDATE |
| 659 |
update { |
| 660 |
collection { |
| 661 |
name: "xtable" |
| 662 |
} |
| 663 |
data_model: TABLE |
| 664 |
operation { |
| 665 |
source { |
| 666 |
name: "prio" |
| 667 |
} |
| 668 |
operation: SET |
| 669 |
value { |
| 670 |
type: OPERATOR |
| 671 |
operator { |
| 672 |
name: "-" |
| 673 |
param { |
| 674 |
type: IDENT |
| 675 |
identifier { |
| 676 |
name: "prio" |
| 677 |
} |
| 678 |
} |
| 679 |
param { |
| 680 |
type: LITERAL |
| 681 |
literal { |
| 682 |
type: V_SINT |
| 683 |
v_signed_int: 1 |
| 684 |
} |
| 685 |
} |
| 686 |
} |
| 687 |
} |
| 688 |
} |
| 689 |
} |
| 690 |
} |
| 691 |
} |
| 692 |
|
| 693 |
RUN recvok |
| 694 |
send Mysqlx.Prepare.Execute { |
| 695 |
stmt_id: 2 |
| 696 |
} |
| 697 |
|
| 698 |
[ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING] |
| 699 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:4] |
| 700 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 701 |
|
| 702 |
# |
| 703 |
# I.3 |
| 704 |
send Mysqlx.Prepare.Prepare { |
| 705 |
stmt_id: 3 |
| 706 |
stmt { |
| 707 |
type: INSERT |
| 708 |
insert { |
| 709 |
collection { |
| 710 |
name: "xtable" |
| 711 |
} |
| 712 |
data_model: TABLE |
| 713 |
row { |
| 714 |
field { |
| 715 |
type: LITERAL |
| 716 |
literal { |
| 717 |
type: V_STRING |
| 718 |
v_string { |
| 719 |
value: "sixth" |
| 720 |
} |
| 721 |
} |
| 722 |
} |
| 723 |
field { |
| 724 |
type: LITERAL |
| 725 |
literal { |
| 726 |
type: V_SINT |
| 727 |
v_signed_int: 3 |
| 728 |
} |
| 729 |
} |
| 730 |
} |
| 731 |
upsert: false |
| 732 |
} |
| 733 |
} |
| 734 |
} |
| 735 |
|
| 736 |
RUN recvok |
| 737 |
send Mysqlx.Prepare.Execute { |
| 738 |
stmt_id: 3 |
| 739 |
} |
| 740 |
|
| 741 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 742 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 743 |
|
| 744 |
# |
| 745 |
# I.4 |
| 746 |
send Mysqlx.Prepare.Prepare { |
| 747 |
stmt_id: 4 |
| 748 |
stmt { |
| 749 |
type: INSERT |
| 750 |
insert { |
| 751 |
collection { |
| 752 |
name: "xtable_with_pk" |
| 753 |
} |
| 754 |
data_model: TABLE |
| 755 |
projection { |
| 756 |
name: "description" |
| 757 |
} |
| 758 |
row { |
| 759 |
field { |
| 760 |
type: LITERAL |
| 761 |
literal { |
| 762 |
type: V_STRING |
| 763 |
v_string { |
| 764 |
value: "test" |
| 765 |
} |
| 766 |
} |
| 767 |
} |
| 768 |
} |
| 769 |
upsert: false |
| 770 |
} |
| 771 |
} |
| 772 |
} |
| 773 |
|
| 774 |
RUN recvok |
| 775 |
send Mysqlx.Prepare.Execute { |
| 776 |
stmt_id: 4 |
| 777 |
} |
| 778 |
|
| 779 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 780 |
[ASSERT notice session state change - GENERATED_INSERT_ID, v_unsigned_int: 2] |
| 781 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 782 |
|
| 783 |
# |
| 784 |
# I.5 |
| 785 |
send Mysqlx.Prepare.Prepare { |
| 786 |
stmt_id: 5 |
| 787 |
stmt { |
| 788 |
type: FIND |
| 789 |
find { |
| 790 |
collection { |
| 791 |
name: "xtable" |
| 792 |
} |
| 793 |
data_model: TABLE |
| 794 |
projection { |
| 795 |
source { |
| 796 |
type: IDENT |
| 797 |
identifier { |
| 798 |
name: "prio" |
| 799 |
} |
| 800 |
} |
| 801 |
alias: "prio" |
| 802 |
} |
| 803 |
} |
| 804 |
} |
| 805 |
} |
| 806 |
|
| 807 |
RUN recvok |
| 808 |
send Mysqlx.Prepare.Execute { |
| 809 |
stmt_id: 5 |
| 810 |
} |
| 811 |
|
| 812 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 813 |
[ASSERT Mysqlx.Resultset.Row] |
| 814 |
[ASSERT Mysqlx.Resultset.Row] |
| 815 |
[ASSERT Mysqlx.Resultset.Row] |
| 816 |
[ASSERT Mysqlx.Resultset.Row] |
| 817 |
[ASSERT Mysqlx.Resultset.Row] |
| 818 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 819 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 820 |
|
| 821 |
# |
| 822 |
# II.1 |
| 823 |
send Mysqlx.Prepare.Prepare { |
| 824 |
stmt_id: 6 |
| 825 |
stmt { |
| 826 |
type: FIND |
| 827 |
find { |
| 828 |
collection { |
| 829 |
name: "xtable" |
| 830 |
} |
| 831 |
data_model: TABLE |
| 832 |
projection { |
| 833 |
source { |
| 834 |
type: OPERATOR |
| 835 |
operator { |
| 836 |
name: "/" |
| 837 |
param { |
| 838 |
type: LITERAL |
| 839 |
literal { |
| 840 |
type: V_SINT |
| 841 |
v_signed_int: 1 |
| 842 |
} |
| 843 |
} |
| 844 |
param { |
| 845 |
type: IDENT |
| 846 |
identifier { |
| 847 |
name: "prio" |
| 848 |
} |
| 849 |
} |
| 850 |
} |
| 851 |
} |
| 852 |
alias: "name" |
| 853 |
} |
| 854 |
} |
| 855 |
} |
| 856 |
} |
| 857 |
|
| 858 |
RUN recvok |
| 859 |
send Mysqlx.Prepare.Execute { |
| 860 |
stmt_id: 6 |
| 861 |
} |
| 862 |
|
| 863 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 864 |
[ASSERT Mysqlx.Resultset.Row] |
| 865 |
[ASSERT Mysqlx.Resultset.Row] |
| 866 |
[ASSERT Mysqlx.Resultset.Row] |
| 867 |
[ASSERT Mysqlx.Resultset.Row] |
| 868 |
[ASSERT Mysqlx.Resultset.Row] |
| 869 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 870 |
[ASSERT notice warning - WARNING, 1365] |
| 871 |
[ASSERT notice warning - WARNING, 1365] |
| 872 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 873 |
Mysqlx.Ok { |
| 874 |
msg: "bye!" |
| 875 |
} |
| 876 |
ok |
| 877 |
|
| 878 |
## D. Execute the test using lz4/group |
| 879 |
# |
| 880 |
CALL recreate_tables(); |
| 881 |
|
| 882 |
|
| 883 |
## Test setup |
| 884 |
|
| 885 |
|
| 886 |
## I. Validate simple resultsets for CRUD messages |
| 887 |
# |
| 888 |
# 1. Assert resultset for CRUD-delete message |
| 889 |
# 2. Assert resultset for CRUD-update message |
| 890 |
# 3. Assert resultset for CRUD-create message (table with auto_inc column) |
| 891 |
# 4. Assert resultset for CRUD-create message (table without auto_inc column) |
| 892 |
# 5. Assert resultset for CRUD-read message |
| 893 |
|
| 894 |
## II. Validate simple resultset with warnings |
| 895 |
# |
| 896 |
# 1. Assert one resultsets for select queries |
| 897 |
|
| 898 |
# |
| 899 |
# I.1 |
| 900 |
send Mysqlx.Prepare.Prepare { |
| 901 |
stmt_id: 1 |
| 902 |
stmt { |
| 903 |
type: DELETE |
| 904 |
delete { |
| 905 |
collection { |
| 906 |
name: "xtable" |
| 907 |
} |
| 908 |
data_model: TABLE |
| 909 |
criteria { |
| 910 |
type: OPERATOR |
| 911 |
operator { |
| 912 |
name: "==" |
| 913 |
param { |
| 914 |
type: IDENT |
| 915 |
identifier { |
| 916 |
name: "prio" |
| 917 |
} |
| 918 |
} |
| 919 |
param { |
| 920 |
type: LITERAL |
| 921 |
literal { |
| 922 |
type: V_SINT |
| 923 |
v_signed_int: 3 |
| 924 |
} |
| 925 |
} |
| 926 |
} |
| 927 |
} |
| 928 |
} |
| 929 |
} |
| 930 |
} |
| 931 |
|
| 932 |
RUN recvok |
| 933 |
send Mysqlx.Prepare.Execute { |
| 934 |
stmt_id: 1 |
| 935 |
} |
| 936 |
|
| 937 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 938 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 939 |
|
| 940 |
# |
| 941 |
# I.2 |
| 942 |
send Mysqlx.Prepare.Prepare { |
| 943 |
stmt_id: 2 |
| 944 |
stmt { |
| 945 |
type: UPDATE |
| 946 |
update { |
| 947 |
collection { |
| 948 |
name: "xtable" |
| 949 |
} |
| 950 |
data_model: TABLE |
| 951 |
operation { |
| 952 |
source { |
| 953 |
name: "prio" |
| 954 |
} |
| 955 |
operation: SET |
| 956 |
value { |
| 957 |
type: OPERATOR |
| 958 |
operator { |
| 959 |
name: "-" |
| 960 |
param { |
| 961 |
type: IDENT |
| 962 |
identifier { |
| 963 |
name: "prio" |
| 964 |
} |
| 965 |
} |
| 966 |
param { |
| 967 |
type: LITERAL |
| 968 |
literal { |
| 969 |
type: V_SINT |
| 970 |
v_signed_int: 1 |
| 971 |
} |
| 972 |
} |
| 973 |
} |
| 974 |
} |
| 975 |
} |
| 976 |
} |
| 977 |
} |
| 978 |
} |
| 979 |
|
| 980 |
RUN recvok |
| 981 |
send Mysqlx.Prepare.Execute { |
| 982 |
stmt_id: 2 |
| 983 |
} |
| 984 |
|
| 985 |
[ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING] |
| 986 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:4] |
| 987 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 988 |
|
| 989 |
# |
| 990 |
# I.3 |
| 991 |
send Mysqlx.Prepare.Prepare { |
| 992 |
stmt_id: 3 |
| 993 |
stmt { |
| 994 |
type: INSERT |
| 995 |
insert { |
| 996 |
collection { |
| 997 |
name: "xtable" |
| 998 |
} |
| 999 |
data_model: TABLE |
| 1000 |
row { |
| 1001 |
field { |
| 1002 |
type: LITERAL |
| 1003 |
literal { |
| 1004 |
type: V_STRING |
| 1005 |
v_string { |
| 1006 |
value: "sixth" |
| 1007 |
} |
| 1008 |
} |
| 1009 |
} |
| 1010 |
field { |
| 1011 |
type: LITERAL |
| 1012 |
literal { |
| 1013 |
type: V_SINT |
| 1014 |
v_signed_int: 3 |
| 1015 |
} |
| 1016 |
} |
| 1017 |
} |
| 1018 |
upsert: false |
| 1019 |
} |
| 1020 |
} |
| 1021 |
} |
| 1022 |
|
| 1023 |
RUN recvok |
| 1024 |
send Mysqlx.Prepare.Execute { |
| 1025 |
stmt_id: 3 |
| 1026 |
} |
| 1027 |
|
| 1028 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1029 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1030 |
|
| 1031 |
# |
| 1032 |
# I.4 |
| 1033 |
send Mysqlx.Prepare.Prepare { |
| 1034 |
stmt_id: 4 |
| 1035 |
stmt { |
| 1036 |
type: INSERT |
| 1037 |
insert { |
| 1038 |
collection { |
| 1039 |
name: "xtable_with_pk" |
| 1040 |
} |
| 1041 |
data_model: TABLE |
| 1042 |
projection { |
| 1043 |
name: "description" |
| 1044 |
} |
| 1045 |
row { |
| 1046 |
field { |
| 1047 |
type: LITERAL |
| 1048 |
literal { |
| 1049 |
type: V_STRING |
| 1050 |
v_string { |
| 1051 |
value: "test" |
| 1052 |
} |
| 1053 |
} |
| 1054 |
} |
| 1055 |
} |
| 1056 |
upsert: false |
| 1057 |
} |
| 1058 |
} |
| 1059 |
} |
| 1060 |
|
| 1061 |
RUN recvok |
| 1062 |
send Mysqlx.Prepare.Execute { |
| 1063 |
stmt_id: 4 |
| 1064 |
} |
| 1065 |
|
| 1066 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1067 |
[ASSERT notice session state change - GENERATED_INSERT_ID, v_unsigned_int: 2] |
| 1068 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1069 |
|
| 1070 |
# |
| 1071 |
# I.5 |
| 1072 |
send Mysqlx.Prepare.Prepare { |
| 1073 |
stmt_id: 5 |
| 1074 |
stmt { |
| 1075 |
type: FIND |
| 1076 |
find { |
| 1077 |
collection { |
| 1078 |
name: "xtable" |
| 1079 |
} |
| 1080 |
data_model: TABLE |
| 1081 |
projection { |
| 1082 |
source { |
| 1083 |
type: IDENT |
| 1084 |
identifier { |
| 1085 |
name: "prio" |
| 1086 |
} |
| 1087 |
} |
| 1088 |
alias: "prio" |
| 1089 |
} |
| 1090 |
} |
| 1091 |
} |
| 1092 |
} |
| 1093 |
|
| 1094 |
RUN recvok |
| 1095 |
send Mysqlx.Prepare.Execute { |
| 1096 |
stmt_id: 5 |
| 1097 |
} |
| 1098 |
|
| 1099 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 1100 |
[ASSERT Mysqlx.Resultset.Row] |
| 1101 |
[ASSERT Mysqlx.Resultset.Row] |
| 1102 |
[ASSERT Mysqlx.Resultset.Row] |
| 1103 |
[ASSERT Mysqlx.Resultset.Row] |
| 1104 |
[ASSERT Mysqlx.Resultset.Row] |
| 1105 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 1106 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1107 |
|
| 1108 |
# |
| 1109 |
# II.1 |
| 1110 |
send Mysqlx.Prepare.Prepare { |
| 1111 |
stmt_id: 6 |
| 1112 |
stmt { |
| 1113 |
type: FIND |
| 1114 |
find { |
| 1115 |
collection { |
| 1116 |
name: "xtable" |
| 1117 |
} |
| 1118 |
data_model: TABLE |
| 1119 |
projection { |
| 1120 |
source { |
| 1121 |
type: OPERATOR |
| 1122 |
operator { |
| 1123 |
name: "/" |
| 1124 |
param { |
| 1125 |
type: LITERAL |
| 1126 |
literal { |
| 1127 |
type: V_SINT |
| 1128 |
v_signed_int: 1 |
| 1129 |
} |
| 1130 |
} |
| 1131 |
param { |
| 1132 |
type: IDENT |
| 1133 |
identifier { |
| 1134 |
name: "prio" |
| 1135 |
} |
| 1136 |
} |
| 1137 |
} |
| 1138 |
} |
| 1139 |
alias: "name" |
| 1140 |
} |
| 1141 |
} |
| 1142 |
} |
| 1143 |
} |
| 1144 |
|
| 1145 |
RUN recvok |
| 1146 |
send Mysqlx.Prepare.Execute { |
| 1147 |
stmt_id: 6 |
| 1148 |
} |
| 1149 |
|
| 1150 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 1151 |
[ASSERT Mysqlx.Resultset.Row] |
| 1152 |
[ASSERT Mysqlx.Resultset.Row] |
| 1153 |
[ASSERT Mysqlx.Resultset.Row] |
| 1154 |
[ASSERT Mysqlx.Resultset.Row] |
| 1155 |
[ASSERT Mysqlx.Resultset.Row] |
| 1156 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 1157 |
[ASSERT notice warning - WARNING, 1365] |
| 1158 |
[ASSERT notice warning - WARNING, 1365] |
| 1159 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1160 |
Mysqlx.Ok { |
| 1161 |
msg: "bye!" |
| 1162 |
} |
| 1163 |
ok |
| 1164 |
|
| 1165 |
## E. Execute the test using lz4/multiple |
| 1166 |
# |
| 1167 |
CALL recreate_tables(); |
| 1168 |
|
| 1169 |
|
| 1170 |
## Test setup |
| 1171 |
|
| 1172 |
|
| 1173 |
## I. Validate simple resultsets for CRUD messages |
| 1174 |
# |
| 1175 |
# 1. Assert resultset for CRUD-delete message |
| 1176 |
# 2. Assert resultset for CRUD-update message |
| 1177 |
# 3. Assert resultset for CRUD-create message (table with auto_inc column) |
| 1178 |
# 4. Assert resultset for CRUD-create message (table without auto_inc column) |
| 1179 |
# 5. Assert resultset for CRUD-read message |
| 1180 |
|
| 1181 |
## II. Validate simple resultset with warnings |
| 1182 |
# |
| 1183 |
# 1. Assert one resultsets for select queries |
| 1184 |
|
| 1185 |
# |
| 1186 |
# I.1 |
| 1187 |
send Mysqlx.Prepare.Prepare { |
| 1188 |
stmt_id: 1 |
| 1189 |
stmt { |
| 1190 |
type: DELETE |
| 1191 |
delete { |
| 1192 |
collection { |
| 1193 |
name: "xtable" |
| 1194 |
} |
| 1195 |
data_model: TABLE |
| 1196 |
criteria { |
| 1197 |
type: OPERATOR |
| 1198 |
operator { |
| 1199 |
name: "==" |
| 1200 |
param { |
| 1201 |
type: IDENT |
| 1202 |
identifier { |
| 1203 |
name: "prio" |
| 1204 |
} |
| 1205 |
} |
| 1206 |
param { |
| 1207 |
type: LITERAL |
| 1208 |
literal { |
| 1209 |
type: V_SINT |
| 1210 |
v_signed_int: 3 |
| 1211 |
} |
| 1212 |
} |
| 1213 |
} |
| 1214 |
} |
| 1215 |
} |
| 1216 |
} |
| 1217 |
} |
| 1218 |
|
| 1219 |
RUN recvok |
| 1220 |
send Mysqlx.Prepare.Execute { |
| 1221 |
stmt_id: 1 |
| 1222 |
} |
| 1223 |
|
| 1224 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1225 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1226 |
|
| 1227 |
# |
| 1228 |
# I.2 |
| 1229 |
send Mysqlx.Prepare.Prepare { |
| 1230 |
stmt_id: 2 |
| 1231 |
stmt { |
| 1232 |
type: UPDATE |
| 1233 |
update { |
| 1234 |
collection { |
| 1235 |
name: "xtable" |
| 1236 |
} |
| 1237 |
data_model: TABLE |
| 1238 |
operation { |
| 1239 |
source { |
| 1240 |
name: "prio" |
| 1241 |
} |
| 1242 |
operation: SET |
| 1243 |
value { |
| 1244 |
type: OPERATOR |
| 1245 |
operator { |
| 1246 |
name: "-" |
| 1247 |
param { |
| 1248 |
type: IDENT |
| 1249 |
identifier { |
| 1250 |
name: "prio" |
| 1251 |
} |
| 1252 |
} |
| 1253 |
param { |
| 1254 |
type: LITERAL |
| 1255 |
literal { |
| 1256 |
type: V_SINT |
| 1257 |
v_signed_int: 1 |
| 1258 |
} |
| 1259 |
} |
| 1260 |
} |
| 1261 |
} |
| 1262 |
} |
| 1263 |
} |
| 1264 |
} |
| 1265 |
} |
| 1266 |
|
| 1267 |
RUN recvok |
| 1268 |
send Mysqlx.Prepare.Execute { |
| 1269 |
stmt_id: 2 |
| 1270 |
} |
| 1271 |
|
| 1272 |
[ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING] |
| 1273 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:4] |
| 1274 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1275 |
|
| 1276 |
# |
| 1277 |
# I.3 |
| 1278 |
send Mysqlx.Prepare.Prepare { |
| 1279 |
stmt_id: 3 |
| 1280 |
stmt { |
| 1281 |
type: INSERT |
| 1282 |
insert { |
| 1283 |
collection { |
| 1284 |
name: "xtable" |
| 1285 |
} |
| 1286 |
data_model: TABLE |
| 1287 |
row { |
| 1288 |
field { |
| 1289 |
type: LITERAL |
| 1290 |
literal { |
| 1291 |
type: V_STRING |
| 1292 |
v_string { |
| 1293 |
value: "sixth" |
| 1294 |
} |
| 1295 |
} |
| 1296 |
} |
| 1297 |
field { |
| 1298 |
type: LITERAL |
| 1299 |
literal { |
| 1300 |
type: V_SINT |
| 1301 |
v_signed_int: 3 |
| 1302 |
} |
| 1303 |
} |
| 1304 |
} |
| 1305 |
upsert: false |
| 1306 |
} |
| 1307 |
} |
| 1308 |
} |
| 1309 |
|
| 1310 |
RUN recvok |
| 1311 |
send Mysqlx.Prepare.Execute { |
| 1312 |
stmt_id: 3 |
| 1313 |
} |
| 1314 |
|
| 1315 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1316 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1317 |
|
| 1318 |
# |
| 1319 |
# I.4 |
| 1320 |
send Mysqlx.Prepare.Prepare { |
| 1321 |
stmt_id: 4 |
| 1322 |
stmt { |
| 1323 |
type: INSERT |
| 1324 |
insert { |
| 1325 |
collection { |
| 1326 |
name: "xtable_with_pk" |
| 1327 |
} |
| 1328 |
data_model: TABLE |
| 1329 |
projection { |
| 1330 |
name: "description" |
| 1331 |
} |
| 1332 |
row { |
| 1333 |
field { |
| 1334 |
type: LITERAL |
| 1335 |
literal { |
| 1336 |
type: V_STRING |
| 1337 |
v_string { |
| 1338 |
value: "test" |
| 1339 |
} |
| 1340 |
} |
| 1341 |
} |
| 1342 |
} |
| 1343 |
upsert: false |
| 1344 |
} |
| 1345 |
} |
| 1346 |
} |
| 1347 |
|
| 1348 |
RUN recvok |
| 1349 |
send Mysqlx.Prepare.Execute { |
| 1350 |
stmt_id: 4 |
| 1351 |
} |
| 1352 |
|
| 1353 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1354 |
[ASSERT notice session state change - GENERATED_INSERT_ID, v_unsigned_int: 2] |
| 1355 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1356 |
|
| 1357 |
# |
| 1358 |
# I.5 |
| 1359 |
send Mysqlx.Prepare.Prepare { |
| 1360 |
stmt_id: 5 |
| 1361 |
stmt { |
| 1362 |
type: FIND |
| 1363 |
find { |
| 1364 |
collection { |
| 1365 |
name: "xtable" |
| 1366 |
} |
| 1367 |
data_model: TABLE |
| 1368 |
projection { |
| 1369 |
source { |
| 1370 |
type: IDENT |
| 1371 |
identifier { |
| 1372 |
name: "prio" |
| 1373 |
} |
| 1374 |
} |
| 1375 |
alias: "prio" |
| 1376 |
} |
| 1377 |
} |
| 1378 |
} |
| 1379 |
} |
| 1380 |
|
| 1381 |
RUN recvok |
| 1382 |
send Mysqlx.Prepare.Execute { |
| 1383 |
stmt_id: 5 |
| 1384 |
} |
| 1385 |
|
| 1386 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 1387 |
[ASSERT Mysqlx.Resultset.Row] |
| 1388 |
[ASSERT Mysqlx.Resultset.Row] |
| 1389 |
[ASSERT Mysqlx.Resultset.Row] |
| 1390 |
[ASSERT Mysqlx.Resultset.Row] |
| 1391 |
[ASSERT Mysqlx.Resultset.Row] |
| 1392 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 1393 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1394 |
|
| 1395 |
# |
| 1396 |
# II.1 |
| 1397 |
send Mysqlx.Prepare.Prepare { |
| 1398 |
stmt_id: 6 |
| 1399 |
stmt { |
| 1400 |
type: FIND |
| 1401 |
find { |
| 1402 |
collection { |
| 1403 |
name: "xtable" |
| 1404 |
} |
| 1405 |
data_model: TABLE |
| 1406 |
projection { |
| 1407 |
source { |
| 1408 |
type: OPERATOR |
| 1409 |
operator { |
| 1410 |
name: "/" |
| 1411 |
param { |
| 1412 |
type: LITERAL |
| 1413 |
literal { |
| 1414 |
type: V_SINT |
| 1415 |
v_signed_int: 1 |
| 1416 |
} |
| 1417 |
} |
| 1418 |
param { |
| 1419 |
type: IDENT |
| 1420 |
identifier { |
| 1421 |
name: "prio" |
| 1422 |
} |
| 1423 |
} |
| 1424 |
} |
| 1425 |
} |
| 1426 |
alias: "name" |
| 1427 |
} |
| 1428 |
} |
| 1429 |
} |
| 1430 |
} |
| 1431 |
|
| 1432 |
RUN recvok |
| 1433 |
send Mysqlx.Prepare.Execute { |
| 1434 |
stmt_id: 6 |
| 1435 |
} |
| 1436 |
|
| 1437 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 1438 |
[ASSERT Mysqlx.Resultset.Row] |
| 1439 |
[ASSERT Mysqlx.Resultset.Row] |
| 1440 |
[ASSERT Mysqlx.Resultset.Row] |
| 1441 |
[ASSERT Mysqlx.Resultset.Row] |
| 1442 |
[ASSERT Mysqlx.Resultset.Row] |
| 1443 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 1444 |
[ASSERT notice warning - WARNING, 1365] |
| 1445 |
[ASSERT notice warning - WARNING, 1365] |
| 1446 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1447 |
Mysqlx.Ok { |
| 1448 |
msg: "bye!" |
| 1449 |
} |
| 1450 |
ok |
| 1451 |
|
| 1452 |
## F. Execute the test using lz4/single |
| 1453 |
# |
| 1454 |
CALL recreate_tables(); |
| 1455 |
|
| 1456 |
|
| 1457 |
## Test setup |
| 1458 |
|
| 1459 |
|
| 1460 |
## I. Validate simple resultsets for CRUD messages |
| 1461 |
# |
| 1462 |
# 1. Assert resultset for CRUD-delete message |
| 1463 |
# 2. Assert resultset for CRUD-update message |
| 1464 |
# 3. Assert resultset for CRUD-create message (table with auto_inc column) |
| 1465 |
# 4. Assert resultset for CRUD-create message (table without auto_inc column) |
| 1466 |
# 5. Assert resultset for CRUD-read message |
| 1467 |
|
| 1468 |
## II. Validate simple resultset with warnings |
| 1469 |
# |
| 1470 |
# 1. Assert one resultsets for select queries |
| 1471 |
|
| 1472 |
# |
| 1473 |
# I.1 |
| 1474 |
send Mysqlx.Prepare.Prepare { |
| 1475 |
stmt_id: 1 |
| 1476 |
stmt { |
| 1477 |
type: DELETE |
| 1478 |
delete { |
| 1479 |
collection { |
| 1480 |
name: "xtable" |
| 1481 |
} |
| 1482 |
data_model: TABLE |
| 1483 |
criteria { |
| 1484 |
type: OPERATOR |
| 1485 |
operator { |
| 1486 |
name: "==" |
| 1487 |
param { |
| 1488 |
type: IDENT |
| 1489 |
identifier { |
| 1490 |
name: "prio" |
| 1491 |
} |
| 1492 |
} |
| 1493 |
param { |
| 1494 |
type: LITERAL |
| 1495 |
literal { |
| 1496 |
type: V_SINT |
| 1497 |
v_signed_int: 3 |
| 1498 |
} |
| 1499 |
} |
| 1500 |
} |
| 1501 |
} |
| 1502 |
} |
| 1503 |
} |
| 1504 |
} |
| 1505 |
|
| 1506 |
RUN recvok |
| 1507 |
send Mysqlx.Prepare.Execute { |
| 1508 |
stmt_id: 1 |
| 1509 |
} |
| 1510 |
|
| 1511 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1512 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1513 |
|
| 1514 |
# |
| 1515 |
# I.2 |
| 1516 |
send Mysqlx.Prepare.Prepare { |
| 1517 |
stmt_id: 2 |
| 1518 |
stmt { |
| 1519 |
type: UPDATE |
| 1520 |
update { |
| 1521 |
collection { |
| 1522 |
name: "xtable" |
| 1523 |
} |
| 1524 |
data_model: TABLE |
| 1525 |
operation { |
| 1526 |
source { |
| 1527 |
name: "prio" |
| 1528 |
} |
| 1529 |
operation: SET |
| 1530 |
value { |
| 1531 |
type: OPERATOR |
| 1532 |
operator { |
| 1533 |
name: "-" |
| 1534 |
param { |
| 1535 |
type: IDENT |
| 1536 |
identifier { |
| 1537 |
name: "prio" |
| 1538 |
} |
| 1539 |
} |
| 1540 |
param { |
| 1541 |
type: LITERAL |
| 1542 |
literal { |
| 1543 |
type: V_SINT |
| 1544 |
v_signed_int: 1 |
| 1545 |
} |
| 1546 |
} |
| 1547 |
} |
| 1548 |
} |
| 1549 |
} |
| 1550 |
} |
| 1551 |
} |
| 1552 |
} |
| 1553 |
|
| 1554 |
RUN recvok |
| 1555 |
send Mysqlx.Prepare.Execute { |
| 1556 |
stmt_id: 2 |
| 1557 |
} |
| 1558 |
|
| 1559 |
[ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING] |
| 1560 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:4] |
| 1561 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1562 |
|
| 1563 |
# |
| 1564 |
# I.3 |
| 1565 |
send Mysqlx.Prepare.Prepare { |
| 1566 |
stmt_id: 3 |
| 1567 |
stmt { |
| 1568 |
type: INSERT |
| 1569 |
insert { |
| 1570 |
collection { |
| 1571 |
name: "xtable" |
| 1572 |
} |
| 1573 |
data_model: TABLE |
| 1574 |
row { |
| 1575 |
field { |
| 1576 |
type: LITERAL |
| 1577 |
literal { |
| 1578 |
type: V_STRING |
| 1579 |
v_string { |
| 1580 |
value: "sixth" |
| 1581 |
} |
| 1582 |
} |
| 1583 |
} |
| 1584 |
field { |
| 1585 |
type: LITERAL |
| 1586 |
literal { |
| 1587 |
type: V_SINT |
| 1588 |
v_signed_int: 3 |
| 1589 |
} |
| 1590 |
} |
| 1591 |
} |
| 1592 |
upsert: false |
| 1593 |
} |
| 1594 |
} |
| 1595 |
} |
| 1596 |
|
| 1597 |
RUN recvok |
| 1598 |
send Mysqlx.Prepare.Execute { |
| 1599 |
stmt_id: 3 |
| 1600 |
} |
| 1601 |
|
| 1602 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1603 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1604 |
|
| 1605 |
# |
| 1606 |
# I.4 |
| 1607 |
send Mysqlx.Prepare.Prepare { |
| 1608 |
stmt_id: 4 |
| 1609 |
stmt { |
| 1610 |
type: INSERT |
| 1611 |
insert { |
| 1612 |
collection { |
| 1613 |
name: "xtable_with_pk" |
| 1614 |
} |
| 1615 |
data_model: TABLE |
| 1616 |
projection { |
| 1617 |
name: "description" |
| 1618 |
} |
| 1619 |
row { |
| 1620 |
field { |
| 1621 |
type: LITERAL |
| 1622 |
literal { |
| 1623 |
type: V_STRING |
| 1624 |
v_string { |
| 1625 |
value: "test" |
| 1626 |
} |
| 1627 |
} |
| 1628 |
} |
| 1629 |
} |
| 1630 |
upsert: false |
| 1631 |
} |
| 1632 |
} |
| 1633 |
} |
| 1634 |
|
| 1635 |
RUN recvok |
| 1636 |
send Mysqlx.Prepare.Execute { |
| 1637 |
stmt_id: 4 |
| 1638 |
} |
| 1639 |
|
| 1640 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1641 |
[ASSERT notice session state change - GENERATED_INSERT_ID, v_unsigned_int: 2] |
| 1642 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1643 |
|
| 1644 |
# |
| 1645 |
# I.5 |
| 1646 |
send Mysqlx.Prepare.Prepare { |
| 1647 |
stmt_id: 5 |
| 1648 |
stmt { |
| 1649 |
type: FIND |
| 1650 |
find { |
| 1651 |
collection { |
| 1652 |
name: "xtable" |
| 1653 |
} |
| 1654 |
data_model: TABLE |
| 1655 |
projection { |
| 1656 |
source { |
| 1657 |
type: IDENT |
| 1658 |
identifier { |
| 1659 |
name: "prio" |
| 1660 |
} |
| 1661 |
} |
| 1662 |
alias: "prio" |
| 1663 |
} |
| 1664 |
} |
| 1665 |
} |
| 1666 |
} |
| 1667 |
|
| 1668 |
RUN recvok |
| 1669 |
send Mysqlx.Prepare.Execute { |
| 1670 |
stmt_id: 5 |
| 1671 |
} |
| 1672 |
|
| 1673 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 1674 |
[ASSERT Mysqlx.Resultset.Row] |
| 1675 |
[ASSERT Mysqlx.Resultset.Row] |
| 1676 |
[ASSERT Mysqlx.Resultset.Row] |
| 1677 |
[ASSERT Mysqlx.Resultset.Row] |
| 1678 |
[ASSERT Mysqlx.Resultset.Row] |
| 1679 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 1680 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1681 |
|
| 1682 |
# |
| 1683 |
# II.1 |
| 1684 |
send Mysqlx.Prepare.Prepare { |
| 1685 |
stmt_id: 6 |
| 1686 |
stmt { |
| 1687 |
type: FIND |
| 1688 |
find { |
| 1689 |
collection { |
| 1690 |
name: "xtable" |
| 1691 |
} |
| 1692 |
data_model: TABLE |
| 1693 |
projection { |
| 1694 |
source { |
| 1695 |
type: OPERATOR |
| 1696 |
operator { |
| 1697 |
name: "/" |
| 1698 |
param { |
| 1699 |
type: LITERAL |
| 1700 |
literal { |
| 1701 |
type: V_SINT |
| 1702 |
v_signed_int: 1 |
| 1703 |
} |
| 1704 |
} |
| 1705 |
param { |
| 1706 |
type: IDENT |
| 1707 |
identifier { |
| 1708 |
name: "prio" |
| 1709 |
} |
| 1710 |
} |
| 1711 |
} |
| 1712 |
} |
| 1713 |
alias: "name" |
| 1714 |
} |
| 1715 |
} |
| 1716 |
} |
| 1717 |
} |
| 1718 |
|
| 1719 |
RUN recvok |
| 1720 |
send Mysqlx.Prepare.Execute { |
| 1721 |
stmt_id: 6 |
| 1722 |
} |
| 1723 |
|
| 1724 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 1725 |
[ASSERT Mysqlx.Resultset.Row] |
| 1726 |
[ASSERT Mysqlx.Resultset.Row] |
| 1727 |
[ASSERT Mysqlx.Resultset.Row] |
| 1728 |
[ASSERT Mysqlx.Resultset.Row] |
| 1729 |
[ASSERT Mysqlx.Resultset.Row] |
| 1730 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 1731 |
[ASSERT notice warning - WARNING, 1365] |
| 1732 |
[ASSERT notice warning - WARNING, 1365] |
| 1733 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1734 |
Mysqlx.Ok { |
| 1735 |
msg: "bye!" |
| 1736 |
} |
| 1737 |
ok |
| 1738 |
|
| 1739 |
## G. Execute the test using zstd/group |
| 1740 |
# |
| 1741 |
CALL recreate_tables(); |
| 1742 |
|
| 1743 |
|
| 1744 |
## Test setup |
| 1745 |
|
| 1746 |
|
| 1747 |
## I. Validate simple resultsets for CRUD messages |
| 1748 |
# |
| 1749 |
# 1. Assert resultset for CRUD-delete message |
| 1750 |
# 2. Assert resultset for CRUD-update message |
| 1751 |
# 3. Assert resultset for CRUD-create message (table with auto_inc column) |
| 1752 |
# 4. Assert resultset for CRUD-create message (table without auto_inc column) |
| 1753 |
# 5. Assert resultset for CRUD-read message |
| 1754 |
|
| 1755 |
## II. Validate simple resultset with warnings |
| 1756 |
# |
| 1757 |
# 1. Assert one resultsets for select queries |
| 1758 |
|
| 1759 |
# |
| 1760 |
# I.1 |
| 1761 |
send Mysqlx.Prepare.Prepare { |
| 1762 |
stmt_id: 1 |
| 1763 |
stmt { |
| 1764 |
type: DELETE |
| 1765 |
delete { |
| 1766 |
collection { |
| 1767 |
name: "xtable" |
| 1768 |
} |
| 1769 |
data_model: TABLE |
| 1770 |
criteria { |
| 1771 |
type: OPERATOR |
| 1772 |
operator { |
| 1773 |
name: "==" |
| 1774 |
param { |
| 1775 |
type: IDENT |
| 1776 |
identifier { |
| 1777 |
name: "prio" |
| 1778 |
} |
| 1779 |
} |
| 1780 |
param { |
| 1781 |
type: LITERAL |
| 1782 |
literal { |
| 1783 |
type: V_SINT |
| 1784 |
v_signed_int: 3 |
| 1785 |
} |
| 1786 |
} |
| 1787 |
} |
| 1788 |
} |
| 1789 |
} |
| 1790 |
} |
| 1791 |
} |
| 1792 |
|
| 1793 |
RUN recvok |
| 1794 |
send Mysqlx.Prepare.Execute { |
| 1795 |
stmt_id: 1 |
| 1796 |
} |
| 1797 |
|
| 1798 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1799 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1800 |
|
| 1801 |
# |
| 1802 |
# I.2 |
| 1803 |
send Mysqlx.Prepare.Prepare { |
| 1804 |
stmt_id: 2 |
| 1805 |
stmt { |
| 1806 |
type: UPDATE |
| 1807 |
update { |
| 1808 |
collection { |
| 1809 |
name: "xtable" |
| 1810 |
} |
| 1811 |
data_model: TABLE |
| 1812 |
operation { |
| 1813 |
source { |
| 1814 |
name: "prio" |
| 1815 |
} |
| 1816 |
operation: SET |
| 1817 |
value { |
| 1818 |
type: OPERATOR |
| 1819 |
operator { |
| 1820 |
name: "-" |
| 1821 |
param { |
| 1822 |
type: IDENT |
| 1823 |
identifier { |
| 1824 |
name: "prio" |
| 1825 |
} |
| 1826 |
} |
| 1827 |
param { |
| 1828 |
type: LITERAL |
| 1829 |
literal { |
| 1830 |
type: V_SINT |
| 1831 |
v_signed_int: 1 |
| 1832 |
} |
| 1833 |
} |
| 1834 |
} |
| 1835 |
} |
| 1836 |
} |
| 1837 |
} |
| 1838 |
} |
| 1839 |
} |
| 1840 |
|
| 1841 |
RUN recvok |
| 1842 |
send Mysqlx.Prepare.Execute { |
| 1843 |
stmt_id: 2 |
| 1844 |
} |
| 1845 |
|
| 1846 |
[ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING] |
| 1847 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:4] |
| 1848 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1849 |
|
| 1850 |
# |
| 1851 |
# I.3 |
| 1852 |
send Mysqlx.Prepare.Prepare { |
| 1853 |
stmt_id: 3 |
| 1854 |
stmt { |
| 1855 |
type: INSERT |
| 1856 |
insert { |
| 1857 |
collection { |
| 1858 |
name: "xtable" |
| 1859 |
} |
| 1860 |
data_model: TABLE |
| 1861 |
row { |
| 1862 |
field { |
| 1863 |
type: LITERAL |
| 1864 |
literal { |
| 1865 |
type: V_STRING |
| 1866 |
v_string { |
| 1867 |
value: "sixth" |
| 1868 |
} |
| 1869 |
} |
| 1870 |
} |
| 1871 |
field { |
| 1872 |
type: LITERAL |
| 1873 |
literal { |
| 1874 |
type: V_SINT |
| 1875 |
v_signed_int: 3 |
| 1876 |
} |
| 1877 |
} |
| 1878 |
} |
| 1879 |
upsert: false |
| 1880 |
} |
| 1881 |
} |
| 1882 |
} |
| 1883 |
|
| 1884 |
RUN recvok |
| 1885 |
send Mysqlx.Prepare.Execute { |
| 1886 |
stmt_id: 3 |
| 1887 |
} |
| 1888 |
|
| 1889 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1890 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1891 |
|
| 1892 |
# |
| 1893 |
# I.4 |
| 1894 |
send Mysqlx.Prepare.Prepare { |
| 1895 |
stmt_id: 4 |
| 1896 |
stmt { |
| 1897 |
type: INSERT |
| 1898 |
insert { |
| 1899 |
collection { |
| 1900 |
name: "xtable_with_pk" |
| 1901 |
} |
| 1902 |
data_model: TABLE |
| 1903 |
projection { |
| 1904 |
name: "description" |
| 1905 |
} |
| 1906 |
row { |
| 1907 |
field { |
| 1908 |
type: LITERAL |
| 1909 |
literal { |
| 1910 |
type: V_STRING |
| 1911 |
v_string { |
| 1912 |
value: "test" |
| 1913 |
} |
| 1914 |
} |
| 1915 |
} |
| 1916 |
} |
| 1917 |
upsert: false |
| 1918 |
} |
| 1919 |
} |
| 1920 |
} |
| 1921 |
|
| 1922 |
RUN recvok |
| 1923 |
send Mysqlx.Prepare.Execute { |
| 1924 |
stmt_id: 4 |
| 1925 |
} |
| 1926 |
|
| 1927 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 1928 |
[ASSERT notice session state change - GENERATED_INSERT_ID, v_unsigned_int: 2] |
| 1929 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1930 |
|
| 1931 |
# |
| 1932 |
# I.5 |
| 1933 |
send Mysqlx.Prepare.Prepare { |
| 1934 |
stmt_id: 5 |
| 1935 |
stmt { |
| 1936 |
type: FIND |
| 1937 |
find { |
| 1938 |
collection { |
| 1939 |
name: "xtable" |
| 1940 |
} |
| 1941 |
data_model: TABLE |
| 1942 |
projection { |
| 1943 |
source { |
| 1944 |
type: IDENT |
| 1945 |
identifier { |
| 1946 |
name: "prio" |
| 1947 |
} |
| 1948 |
} |
| 1949 |
alias: "prio" |
| 1950 |
} |
| 1951 |
} |
| 1952 |
} |
| 1953 |
} |
| 1954 |
|
| 1955 |
RUN recvok |
| 1956 |
send Mysqlx.Prepare.Execute { |
| 1957 |
stmt_id: 5 |
| 1958 |
} |
| 1959 |
|
| 1960 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 1961 |
[ASSERT Mysqlx.Resultset.Row] |
| 1962 |
[ASSERT Mysqlx.Resultset.Row] |
| 1963 |
[ASSERT Mysqlx.Resultset.Row] |
| 1964 |
[ASSERT Mysqlx.Resultset.Row] |
| 1965 |
[ASSERT Mysqlx.Resultset.Row] |
| 1966 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 1967 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 1968 |
|
| 1969 |
# |
| 1970 |
# II.1 |
| 1971 |
send Mysqlx.Prepare.Prepare { |
| 1972 |
stmt_id: 6 |
| 1973 |
stmt { |
| 1974 |
type: FIND |
| 1975 |
find { |
| 1976 |
collection { |
| 1977 |
name: "xtable" |
| 1978 |
} |
| 1979 |
data_model: TABLE |
| 1980 |
projection { |
| 1981 |
source { |
| 1982 |
type: OPERATOR |
| 1983 |
operator { |
| 1984 |
name: "/" |
| 1985 |
param { |
| 1986 |
type: LITERAL |
| 1987 |
literal { |
| 1988 |
type: V_SINT |
| 1989 |
v_signed_int: 1 |
| 1990 |
} |
| 1991 |
} |
| 1992 |
param { |
| 1993 |
type: IDENT |
| 1994 |
identifier { |
| 1995 |
name: "prio" |
| 1996 |
} |
| 1997 |
} |
| 1998 |
} |
| 1999 |
} |
| 2000 |
alias: "name" |
| 2001 |
} |
| 2002 |
} |
| 2003 |
} |
| 2004 |
} |
| 2005 |
|
| 2006 |
RUN recvok |
| 2007 |
send Mysqlx.Prepare.Execute { |
| 2008 |
stmt_id: 6 |
| 2009 |
} |
| 2010 |
|
| 2011 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 2012 |
[ASSERT Mysqlx.Resultset.Row] |
| 2013 |
[ASSERT Mysqlx.Resultset.Row] |
| 2014 |
[ASSERT Mysqlx.Resultset.Row] |
| 2015 |
[ASSERT Mysqlx.Resultset.Row] |
| 2016 |
[ASSERT Mysqlx.Resultset.Row] |
| 2017 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 2018 |
[ASSERT notice warning - WARNING, 1365] |
| 2019 |
[ASSERT notice warning - WARNING, 1365] |
| 2020 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2021 |
Mysqlx.Ok { |
| 2022 |
msg: "bye!" |
| 2023 |
} |
| 2024 |
ok |
| 2025 |
|
| 2026 |
## H. Execute the test using zstd/multiple |
| 2027 |
# |
| 2028 |
CALL recreate_tables(); |
| 2029 |
|
| 2030 |
|
| 2031 |
## Test setup |
| 2032 |
|
| 2033 |
|
| 2034 |
## I. Validate simple resultsets for CRUD messages |
| 2035 |
# |
| 2036 |
# 1. Assert resultset for CRUD-delete message |
| 2037 |
# 2. Assert resultset for CRUD-update message |
| 2038 |
# 3. Assert resultset for CRUD-create message (table with auto_inc column) |
| 2039 |
# 4. Assert resultset for CRUD-create message (table without auto_inc column) |
| 2040 |
# 5. Assert resultset for CRUD-read message |
| 2041 |
|
| 2042 |
## II. Validate simple resultset with warnings |
| 2043 |
# |
| 2044 |
# 1. Assert one resultsets for select queries |
| 2045 |
|
| 2046 |
# |
| 2047 |
# I.1 |
| 2048 |
send Mysqlx.Prepare.Prepare { |
| 2049 |
stmt_id: 1 |
| 2050 |
stmt { |
| 2051 |
type: DELETE |
| 2052 |
delete { |
| 2053 |
collection { |
| 2054 |
name: "xtable" |
| 2055 |
} |
| 2056 |
data_model: TABLE |
| 2057 |
criteria { |
| 2058 |
type: OPERATOR |
| 2059 |
operator { |
| 2060 |
name: "==" |
| 2061 |
param { |
| 2062 |
type: IDENT |
| 2063 |
identifier { |
| 2064 |
name: "prio" |
| 2065 |
} |
| 2066 |
} |
| 2067 |
param { |
| 2068 |
type: LITERAL |
| 2069 |
literal { |
| 2070 |
type: V_SINT |
| 2071 |
v_signed_int: 3 |
| 2072 |
} |
| 2073 |
} |
| 2074 |
} |
| 2075 |
} |
| 2076 |
} |
| 2077 |
} |
| 2078 |
} |
| 2079 |
|
| 2080 |
RUN recvok |
| 2081 |
send Mysqlx.Prepare.Execute { |
| 2082 |
stmt_id: 1 |
| 2083 |
} |
| 2084 |
|
| 2085 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 2086 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2087 |
|
| 2088 |
# |
| 2089 |
# I.2 |
| 2090 |
send Mysqlx.Prepare.Prepare { |
| 2091 |
stmt_id: 2 |
| 2092 |
stmt { |
| 2093 |
type: UPDATE |
| 2094 |
update { |
| 2095 |
collection { |
| 2096 |
name: "xtable" |
| 2097 |
} |
| 2098 |
data_model: TABLE |
| 2099 |
operation { |
| 2100 |
source { |
| 2101 |
name: "prio" |
| 2102 |
} |
| 2103 |
operation: SET |
| 2104 |
value { |
| 2105 |
type: OPERATOR |
| 2106 |
operator { |
| 2107 |
name: "-" |
| 2108 |
param { |
| 2109 |
type: IDENT |
| 2110 |
identifier { |
| 2111 |
name: "prio" |
| 2112 |
} |
| 2113 |
} |
| 2114 |
param { |
| 2115 |
type: LITERAL |
| 2116 |
literal { |
| 2117 |
type: V_SINT |
| 2118 |
v_signed_int: 1 |
| 2119 |
} |
| 2120 |
} |
| 2121 |
} |
| 2122 |
} |
| 2123 |
} |
| 2124 |
} |
| 2125 |
} |
| 2126 |
} |
| 2127 |
|
| 2128 |
RUN recvok |
| 2129 |
send Mysqlx.Prepare.Execute { |
| 2130 |
stmt_id: 2 |
| 2131 |
} |
| 2132 |
|
| 2133 |
[ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING] |
| 2134 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:4] |
| 2135 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2136 |
|
| 2137 |
# |
| 2138 |
# I.3 |
| 2139 |
send Mysqlx.Prepare.Prepare { |
| 2140 |
stmt_id: 3 |
| 2141 |
stmt { |
| 2142 |
type: INSERT |
| 2143 |
insert { |
| 2144 |
collection { |
| 2145 |
name: "xtable" |
| 2146 |
} |
| 2147 |
data_model: TABLE |
| 2148 |
row { |
| 2149 |
field { |
| 2150 |
type: LITERAL |
| 2151 |
literal { |
| 2152 |
type: V_STRING |
| 2153 |
v_string { |
| 2154 |
value: "sixth" |
| 2155 |
} |
| 2156 |
} |
| 2157 |
} |
| 2158 |
field { |
| 2159 |
type: LITERAL |
| 2160 |
literal { |
| 2161 |
type: V_SINT |
| 2162 |
v_signed_int: 3 |
| 2163 |
} |
| 2164 |
} |
| 2165 |
} |
| 2166 |
upsert: false |
| 2167 |
} |
| 2168 |
} |
| 2169 |
} |
| 2170 |
|
| 2171 |
RUN recvok |
| 2172 |
send Mysqlx.Prepare.Execute { |
| 2173 |
stmt_id: 3 |
| 2174 |
} |
| 2175 |
|
| 2176 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 2177 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2178 |
|
| 2179 |
# |
| 2180 |
# I.4 |
| 2181 |
send Mysqlx.Prepare.Prepare { |
| 2182 |
stmt_id: 4 |
| 2183 |
stmt { |
| 2184 |
type: INSERT |
| 2185 |
insert { |
| 2186 |
collection { |
| 2187 |
name: "xtable_with_pk" |
| 2188 |
} |
| 2189 |
data_model: TABLE |
| 2190 |
projection { |
| 2191 |
name: "description" |
| 2192 |
} |
| 2193 |
row { |
| 2194 |
field { |
| 2195 |
type: LITERAL |
| 2196 |
literal { |
| 2197 |
type: V_STRING |
| 2198 |
v_string { |
| 2199 |
value: "test" |
| 2200 |
} |
| 2201 |
} |
| 2202 |
} |
| 2203 |
} |
| 2204 |
upsert: false |
| 2205 |
} |
| 2206 |
} |
| 2207 |
} |
| 2208 |
|
| 2209 |
RUN recvok |
| 2210 |
send Mysqlx.Prepare.Execute { |
| 2211 |
stmt_id: 4 |
| 2212 |
} |
| 2213 |
|
| 2214 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 2215 |
[ASSERT notice session state change - GENERATED_INSERT_ID, v_unsigned_int: 2] |
| 2216 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2217 |
|
| 2218 |
# |
| 2219 |
# I.5 |
| 2220 |
send Mysqlx.Prepare.Prepare { |
| 2221 |
stmt_id: 5 |
| 2222 |
stmt { |
| 2223 |
type: FIND |
| 2224 |
find { |
| 2225 |
collection { |
| 2226 |
name: "xtable" |
| 2227 |
} |
| 2228 |
data_model: TABLE |
| 2229 |
projection { |
| 2230 |
source { |
| 2231 |
type: IDENT |
| 2232 |
identifier { |
| 2233 |
name: "prio" |
| 2234 |
} |
| 2235 |
} |
| 2236 |
alias: "prio" |
| 2237 |
} |
| 2238 |
} |
| 2239 |
} |
| 2240 |
} |
| 2241 |
|
| 2242 |
RUN recvok |
| 2243 |
send Mysqlx.Prepare.Execute { |
| 2244 |
stmt_id: 5 |
| 2245 |
} |
| 2246 |
|
| 2247 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 2248 |
[ASSERT Mysqlx.Resultset.Row] |
| 2249 |
[ASSERT Mysqlx.Resultset.Row] |
| 2250 |
[ASSERT Mysqlx.Resultset.Row] |
| 2251 |
[ASSERT Mysqlx.Resultset.Row] |
| 2252 |
[ASSERT Mysqlx.Resultset.Row] |
| 2253 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 2254 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2255 |
|
| 2256 |
# |
| 2257 |
# II.1 |
| 2258 |
send Mysqlx.Prepare.Prepare { |
| 2259 |
stmt_id: 6 |
| 2260 |
stmt { |
| 2261 |
type: FIND |
| 2262 |
find { |
| 2263 |
collection { |
| 2264 |
name: "xtable" |
| 2265 |
} |
| 2266 |
data_model: TABLE |
| 2267 |
projection { |
| 2268 |
source { |
| 2269 |
type: OPERATOR |
| 2270 |
operator { |
| 2271 |
name: "/" |
| 2272 |
param { |
| 2273 |
type: LITERAL |
| 2274 |
literal { |
| 2275 |
type: V_SINT |
| 2276 |
v_signed_int: 1 |
| 2277 |
} |
| 2278 |
} |
| 2279 |
param { |
| 2280 |
type: IDENT |
| 2281 |
identifier { |
| 2282 |
name: "prio" |
| 2283 |
} |
| 2284 |
} |
| 2285 |
} |
| 2286 |
} |
| 2287 |
alias: "name" |
| 2288 |
} |
| 2289 |
} |
| 2290 |
} |
| 2291 |
} |
| 2292 |
|
| 2293 |
RUN recvok |
| 2294 |
send Mysqlx.Prepare.Execute { |
| 2295 |
stmt_id: 6 |
| 2296 |
} |
| 2297 |
|
| 2298 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 2299 |
[ASSERT Mysqlx.Resultset.Row] |
| 2300 |
[ASSERT Mysqlx.Resultset.Row] |
| 2301 |
[ASSERT Mysqlx.Resultset.Row] |
| 2302 |
[ASSERT Mysqlx.Resultset.Row] |
| 2303 |
[ASSERT Mysqlx.Resultset.Row] |
| 2304 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 2305 |
[ASSERT notice warning - WARNING, 1365] |
| 2306 |
[ASSERT notice warning - WARNING, 1365] |
| 2307 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2308 |
Mysqlx.Ok { |
| 2309 |
msg: "bye!" |
| 2310 |
} |
| 2311 |
ok |
| 2312 |
|
| 2313 |
## I. Execute the test using zstd/single |
| 2314 |
# |
| 2315 |
CALL recreate_tables(); |
| 2316 |
|
| 2317 |
|
| 2318 |
## Test setup |
| 2319 |
|
| 2320 |
|
| 2321 |
## I. Validate simple resultsets for CRUD messages |
| 2322 |
# |
| 2323 |
# 1. Assert resultset for CRUD-delete message |
| 2324 |
# 2. Assert resultset for CRUD-update message |
| 2325 |
# 3. Assert resultset for CRUD-create message (table with auto_inc column) |
| 2326 |
# 4. Assert resultset for CRUD-create message (table without auto_inc column) |
| 2327 |
# 5. Assert resultset for CRUD-read message |
| 2328 |
|
| 2329 |
## II. Validate simple resultset with warnings |
| 2330 |
# |
| 2331 |
# 1. Assert one resultsets for select queries |
| 2332 |
|
| 2333 |
# |
| 2334 |
# I.1 |
| 2335 |
send Mysqlx.Prepare.Prepare { |
| 2336 |
stmt_id: 1 |
| 2337 |
stmt { |
| 2338 |
type: DELETE |
| 2339 |
delete { |
| 2340 |
collection { |
| 2341 |
name: "xtable" |
| 2342 |
} |
| 2343 |
data_model: TABLE |
| 2344 |
criteria { |
| 2345 |
type: OPERATOR |
| 2346 |
operator { |
| 2347 |
name: "==" |
| 2348 |
param { |
| 2349 |
type: IDENT |
| 2350 |
identifier { |
| 2351 |
name: "prio" |
| 2352 |
} |
| 2353 |
} |
| 2354 |
param { |
| 2355 |
type: LITERAL |
| 2356 |
literal { |
| 2357 |
type: V_SINT |
| 2358 |
v_signed_int: 3 |
| 2359 |
} |
| 2360 |
} |
| 2361 |
} |
| 2362 |
} |
| 2363 |
} |
| 2364 |
} |
| 2365 |
} |
| 2366 |
|
| 2367 |
RUN recvok |
| 2368 |
send Mysqlx.Prepare.Execute { |
| 2369 |
stmt_id: 1 |
| 2370 |
} |
| 2371 |
|
| 2372 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 2373 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2374 |
|
| 2375 |
# |
| 2376 |
# I.2 |
| 2377 |
send Mysqlx.Prepare.Prepare { |
| 2378 |
stmt_id: 2 |
| 2379 |
stmt { |
| 2380 |
type: UPDATE |
| 2381 |
update { |
| 2382 |
collection { |
| 2383 |
name: "xtable" |
| 2384 |
} |
| 2385 |
data_model: TABLE |
| 2386 |
operation { |
| 2387 |
source { |
| 2388 |
name: "prio" |
| 2389 |
} |
| 2390 |
operation: SET |
| 2391 |
value { |
| 2392 |
type: OPERATOR |
| 2393 |
operator { |
| 2394 |
name: "-" |
| 2395 |
param { |
| 2396 |
type: IDENT |
| 2397 |
identifier { |
| 2398 |
name: "prio" |
| 2399 |
} |
| 2400 |
} |
| 2401 |
param { |
| 2402 |
type: LITERAL |
| 2403 |
literal { |
| 2404 |
type: V_SINT |
| 2405 |
v_signed_int: 1 |
| 2406 |
} |
| 2407 |
} |
| 2408 |
} |
| 2409 |
} |
| 2410 |
} |
| 2411 |
} |
| 2412 |
} |
| 2413 |
} |
| 2414 |
|
| 2415 |
RUN recvok |
| 2416 |
send Mysqlx.Prepare.Execute { |
| 2417 |
stmt_id: 2 |
| 2418 |
} |
| 2419 |
|
| 2420 |
[ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING] |
| 2421 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:4] |
| 2422 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2423 |
|
| 2424 |
# |
| 2425 |
# I.3 |
| 2426 |
send Mysqlx.Prepare.Prepare { |
| 2427 |
stmt_id: 3 |
| 2428 |
stmt { |
| 2429 |
type: INSERT |
| 2430 |
insert { |
| 2431 |
collection { |
| 2432 |
name: "xtable" |
| 2433 |
} |
| 2434 |
data_model: TABLE |
| 2435 |
row { |
| 2436 |
field { |
| 2437 |
type: LITERAL |
| 2438 |
literal { |
| 2439 |
type: V_STRING |
| 2440 |
v_string { |
| 2441 |
value: "sixth" |
| 2442 |
} |
| 2443 |
} |
| 2444 |
} |
| 2445 |
field { |
| 2446 |
type: LITERAL |
| 2447 |
literal { |
| 2448 |
type: V_SINT |
| 2449 |
v_signed_int: 3 |
| 2450 |
} |
| 2451 |
} |
| 2452 |
} |
| 2453 |
upsert: false |
| 2454 |
} |
| 2455 |
} |
| 2456 |
} |
| 2457 |
|
| 2458 |
RUN recvok |
| 2459 |
send Mysqlx.Prepare.Execute { |
| 2460 |
stmt_id: 3 |
| 2461 |
} |
| 2462 |
|
| 2463 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 2464 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2465 |
|
| 2466 |
# |
| 2467 |
# I.4 |
| 2468 |
send Mysqlx.Prepare.Prepare { |
| 2469 |
stmt_id: 4 |
| 2470 |
stmt { |
| 2471 |
type: INSERT |
| 2472 |
insert { |
| 2473 |
collection { |
| 2474 |
name: "xtable_with_pk" |
| 2475 |
} |
| 2476 |
data_model: TABLE |
| 2477 |
projection { |
| 2478 |
name: "description" |
| 2479 |
} |
| 2480 |
row { |
| 2481 |
field { |
| 2482 |
type: LITERAL |
| 2483 |
literal { |
| 2484 |
type: V_STRING |
| 2485 |
v_string { |
| 2486 |
value: "test" |
| 2487 |
} |
| 2488 |
} |
| 2489 |
} |
| 2490 |
} |
| 2491 |
upsert: false |
| 2492 |
} |
| 2493 |
} |
| 2494 |
} |
| 2495 |
|
| 2496 |
RUN recvok |
| 2497 |
send Mysqlx.Prepare.Execute { |
| 2498 |
stmt_id: 4 |
| 2499 |
} |
| 2500 |
|
| 2501 |
[ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1] |
| 2502 |
[ASSERT notice session state change - GENERATED_INSERT_ID, v_unsigned_int: 2] |
| 2503 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2504 |
|
| 2505 |
# |
| 2506 |
# I.5 |
| 2507 |
send Mysqlx.Prepare.Prepare { |
| 2508 |
stmt_id: 5 |
| 2509 |
stmt { |
| 2510 |
type: FIND |
| 2511 |
find { |
| 2512 |
collection { |
| 2513 |
name: "xtable" |
| 2514 |
} |
| 2515 |
data_model: TABLE |
| 2516 |
projection { |
| 2517 |
source { |
| 2518 |
type: IDENT |
| 2519 |
identifier { |
| 2520 |
name: "prio" |
| 2521 |
} |
| 2522 |
} |
| 2523 |
alias: "prio" |
| 2524 |
} |
| 2525 |
} |
| 2526 |
} |
| 2527 |
} |
| 2528 |
|
| 2529 |
RUN recvok |
| 2530 |
send Mysqlx.Prepare.Execute { |
| 2531 |
stmt_id: 5 |
| 2532 |
} |
| 2533 |
|
| 2534 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 2535 |
[ASSERT Mysqlx.Resultset.Row] |
| 2536 |
[ASSERT Mysqlx.Resultset.Row] |
| 2537 |
[ASSERT Mysqlx.Resultset.Row] |
| 2538 |
[ASSERT Mysqlx.Resultset.Row] |
| 2539 |
[ASSERT Mysqlx.Resultset.Row] |
| 2540 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 2541 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2542 |
|
| 2543 |
# |
| 2544 |
# II.1 |
| 2545 |
send Mysqlx.Prepare.Prepare { |
| 2546 |
stmt_id: 6 |
| 2547 |
stmt { |
| 2548 |
type: FIND |
| 2549 |
find { |
| 2550 |
collection { |
| 2551 |
name: "xtable" |
| 2552 |
} |
| 2553 |
data_model: TABLE |
| 2554 |
projection { |
| 2555 |
source { |
| 2556 |
type: OPERATOR |
| 2557 |
operator { |
| 2558 |
name: "/" |
| 2559 |
param { |
| 2560 |
type: LITERAL |
| 2561 |
literal { |
| 2562 |
type: V_SINT |
| 2563 |
v_signed_int: 1 |
| 2564 |
} |
| 2565 |
} |
| 2566 |
param { |
| 2567 |
type: IDENT |
| 2568 |
identifier { |
| 2569 |
name: "prio" |
| 2570 |
} |
| 2571 |
} |
| 2572 |
} |
| 2573 |
} |
| 2574 |
alias: "name" |
| 2575 |
} |
| 2576 |
} |
| 2577 |
} |
| 2578 |
} |
| 2579 |
|
| 2580 |
RUN recvok |
| 2581 |
send Mysqlx.Prepare.Execute { |
| 2582 |
stmt_id: 6 |
| 2583 |
} |
| 2584 |
|
| 2585 |
[ASSERT Mysqlx.Resultset.ColumnMetaData] |
| 2586 |
[ASSERT Mysqlx.Resultset.Row] |
| 2587 |
[ASSERT Mysqlx.Resultset.Row] |
| 2588 |
[ASSERT Mysqlx.Resultset.Row] |
| 2589 |
[ASSERT Mysqlx.Resultset.Row] |
| 2590 |
[ASSERT Mysqlx.Resultset.Row] |
| 2591 |
[ASSERT Mysqlx.Resultset.FetchDone] |
| 2592 |
[ASSERT notice warning - WARNING, 1365] |
| 2593 |
[ASSERT notice warning - WARNING, 1365] |
| 2594 |
[ASSERT Mysqlx.Sql.StmtExecuteOk] |
| 2595 |
Mysqlx.Ok { |
| 2596 |
msg: "bye!" |
| 2597 |
} |
| 2598 |
ok |