| 1 |
# |
| 2 |
# Setup |
| 3 |
# |
| 4 |
CREATE DATABASE mdev38550_db; |
| 5 |
# |
| 6 |
# Test 1: COM_CHANGE_USER with short password |
| 7 |
# Verify mysql_change_user() works correctly with database parameter |
| 8 |
# |
| 9 |
CREATE USER changeusertest IDENTIFIED VIA cleartext_plugin_server USING 'changepwd'; |
| 10 |
GRANT ALL ON *.* TO changeusertest; |
| 11 |
SELECT DATABASE() AS db; |
| 12 |
db |
| 13 |
mdev38550_db |
| 14 |
# |
| 15 |
# Test 2: COM_CHANGE_USER with long password (260 bytes) |
| 16 |
# This works because auth plugin switching sends password in a SECOND packet |
| 17 |
# (via ma_net_write), bypassing the 255-byte limit in send_change_user_packet() |
| 18 |
# |
| 19 |
# Note: If connection used cleartext directly (no auth switch), it would fail |
| 20 |
# due to libmariadb's 255-byte limit in send_change_user_packet() |
| 21 |
# |
| 22 |
CREATE USER changeuserlongpwd IDENTIFIED VIA cleartext_plugin_server USING 'cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'; |
| 23 |
GRANT ALL ON *.* TO changeuserlongpwd; |
| 24 |
SELECT DATABASE() AS db; |
| 25 |
db |
| 26 |
mdev38550_db |
| 27 |
# |
| 28 |
# Test 3: COM_CHANGE_USER with long password - no auth switch |
| 29 |
# Connection uses cleartext directly, password goes in first packet |
| 30 |
# Requires LENENC support in both client and server for COM_CHANGE_USER |
| 31 |
# |
| 32 |
connect cleartext_con, 127.0.0.1, changeuserlongpwd, $change_pwd, mdev38550_db, $MASTER_MYPORT, , , mysql_clear_password; |
| 33 |
SELECT DATABASE() AS db, CURRENT_USER() AS user; |
| 34 |
db user |
| 35 |
mdev38550_db changeuserlongpwd@% |
| 36 |
SELECT DATABASE() AS db, CURRENT_USER() AS user; |
| 37 |
db user |
| 38 |
mdev38550_db changeuserlongpwd@% |
| 39 |
connection default; |
| 40 |
disconnect cleartext_con; |
| 41 |
# |
| 42 |
# Cleanup |
| 43 |
# |
| 44 |
DROP USER changeusertest, changeuserlongpwd; |
| 45 |
DROP DATABASE mdev38550_db; |