| 1 |
# Should be off by default |
| 2 |
SELECT @@GLOBAL.print_identified_with_as_hex, @@SESSION.print_identified_with_as_hex; |
| 3 |
@@GLOBAL.print_identified_with_as_hex @@SESSION.print_identified_with_as_hex |
| 4 |
0 0 |
| 5 |
SET GLOBAL print_identified_with_as_hex=1; |
| 6 |
SELECT @@GLOBAL.print_identified_with_as_hex, @@SESSION.print_identified_with_as_hex; |
| 7 |
@@GLOBAL.print_identified_with_as_hex @@SESSION.print_identified_with_as_hex |
| 8 |
1 0 |
| 9 |
SET SESSION print_identified_with_as_hex=1; |
| 10 |
SELECT @GLOBAL.print_identified_with_as_hex, @@SESSION.print_identified_with_as_hex; |
| 11 |
@GLOBAL.print_identified_with_as_hex @@SESSION.print_identified_with_as_hex |
| 12 |
NULL 1 |
| 13 |
# This corresponds to CREATE USER foo@localhost IDENTIFIED BY 'bar' |
| 14 |
# But because of the salt we peg the whole hash instead. |
| 15 |
CREATE USER 'foo'@'localhost' IDENTIFIED WITH 'caching_sha2_password' AS 0x244124303035240C4D7A6D25436F2C0A08515310644615383E2A123961484C6276734178425A446172436B58446A582F6178544A692E6F644E4F2F4E596E666276454B563336 REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT; |
| 16 |
CREATE USER oldfoo@localhost IDENTIFIED WITH 'mysql_native_password' BY 'bar'; |
| 17 |
# Should display hex: unprintable symbols |
| 18 |
SHOW CREATE USER foo@localhost; |
| 19 |
CREATE USER for foo@localhost |
| 20 |
CREATE USER `foo`@`localhost` IDENTIFIED WITH 'caching_sha2_password' AS 0x244124303035240C4D7A6D25436F2C0A08515310644615383E2A123961484C6276734178425A446172436B58446A582F6178544A692E6F644E4F2F4E596E666276454B563336 REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT |
| 21 |
# Should not display hex: native passwords not having non-printable bytes |
| 22 |
SHOW CREATE USER oldfoo@localhost; |
| 23 |
CREATE USER for oldfoo@localhost |
| 24 |
CREATE USER `oldfoo`@`localhost` IDENTIFIED WITH 'mysql_native_password' AS '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT |
| 25 |
SET SESSION print_identified_with_as_hex=0; |
| 26 |
# Should not display hex: turned off |
| 27 |
SHOW CREATE USER foo@localhost; |
| 28 |
CREATE USER for foo@localhost |
| 29 |
CREATE USER `foo`@`localhost` IDENTIFIED WITH 'caching_sha2_password' AS '$A$005$Mzm%Co,\nQSdF8>*9aHLbvsAxBZDarCkXDjX/axTJi.odNO/NYnfbvEKV36' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT |
| 30 |
# Should not display hex: turned off |
| 31 |
SHOW CREATE USER oldfoo@localhost; |
| 32 |
CREATE USER for oldfoo@localhost |
| 33 |
CREATE USER `oldfoo`@`localhost` IDENTIFIED WITH 'mysql_native_password' AS '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT |
| 34 |
# Now try to reply the statement produced by SHOW CREATE |
| 35 |
DROP USER foo@localhost; |
| 36 |
# Replaying the collected statement |
| 37 |
# Connecting as foo: should work |
| 38 |
SELECT 1; |
| 39 |
1 |
| 40 |
1 |
| 41 |
# back to default connection |
| 42 |
# Cleanup |
| 43 |
DROP USER foo@localhost,oldfoo@localhost; |
| 44 |
SET GLOBAL print_identified_with_as_hex=default; |