Commit cbbd10b
committed
fix(test/tap): skip native_password backend fixtures on MySQL 9.x in test_sqlite3_pass_exts-t
Fixes #5631.
The test has three logical phases:
Phase 1 Admin SQLite3 extension validation for MYSQL_NATIVE_PASSWORD()
and CACHING_SHA2_PASSWORD() — pure hash computation inside
ProxySQL, does not touch the backend.
Phase 2 MySQL/Admin hash compatibility — creates USER_GEN_COUNT (100)
users on the backend, half with mysql_native_password and half
with caching_sha2_password, then compares the backend's
authentication_string with the hash that ProxySQL's Admin
SQLite3 function produces.
Phase 3 End-to-end connection test — creates RAND_USERS_GEN (100)
users with the same 50/50 split and attempts to connect
through ProxySQL.
On MySQL 9.0+ the mysql_native_password plugin is not loadable, so the
first CREATE USER IDENTIFIED WITH 'mysql_native_password' in Phase 2
fails with ER_PLUGIN_IS_NOT_LOADED and the test bails after only 10
assertions (all of Phase 1 passes — ProxySQL's internal hash extensions
work fine on 9.x; this was a good green signal).
Fix:
- Add g_mysql_supports_native_password; set to false on server_version
>= 9.0.
- Adjust actual_test_count so plan() matches reality:
if (has_native) {
count += USER_GEN_COUNT + RAND_USERS_GEN;
} else {
count += USER_GEN_COUNT / 2 + RAND_USERS_GEN / 2;
}
- Wrap the Phase 2 native_password loop in 'if (has_native)'.
- Phase 3 uses 'for (i = 0 .. RAND_USERS_GEN)' with 'i < 50 ? native
: sha2'. Skip the native half by starting the loop at
RAND_USERS_GEN/2 when has_native is false.
Phase 1 coverage is fully preserved — the ProxySQL Admin SQLite3 hash
functions (including MYSQL_NATIVE_PASSWORD()) still work on 9.x; only
the backend-side CREATE USER path is skipped.1 parent 5bb19a9 commit cbbd10b
1 file changed
Lines changed: 45 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
| |||
454 | 461 | | |
455 | 462 | | |
456 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
457 | 474 | | |
458 | 475 | | |
459 | 476 | | |
460 | | - | |
| 477 | + | |
461 | 478 | | |
462 | 479 | | |
463 | 480 | | |
464 | | - | |
465 | | - | |
466 | | - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
467 | 490 | | |
468 | 491 | | |
469 | 492 | | |
470 | 493 | | |
| 494 | + | |
471 | 495 | | |
472 | 496 | | |
473 | 497 | | |
| |||
502 | 526 | | |
503 | 527 | | |
504 | 528 | | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
516 | 542 | | |
517 | 543 | | |
518 | 544 | | |
| |||
594 | 620 | | |
595 | 621 | | |
596 | 622 | | |
597 | | - | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
598 | 627 | | |
599 | 628 | | |
600 | 629 | | |
| |||
0 commit comments