|
| 1 | +call mtr.add_suppression('Corresponding entry in binary log used default authentication.*'); |
1 | 2 | include/master-slave.inc
|
2 | 3 | Warnings:
|
3 | 4 | Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
|
@@ -33,13 +34,130 @@ include/sync_slave_sql_with_master.inc
|
33 | 34 | include/show_binlog_events.inc
|
34 | 35 | Log_name Pos Event_type Server_id End_log_pos Info
|
35 | 36 | slave-bin.000001 # Query # # use `test`; CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password'
|
36 |
| -slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' |
| 37 | +slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password','u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' |
37 | 38 | slave-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u1'@'localhost' ACCOUNT LOCK
|
38 | 39 | slave-bin.000001 # Query # # use `test`; DROP USER u1@localhost
|
39 | 40 | slave-bin.000001 # Query # # use `test`; DROP USER IF EXISTS u2@localhost
|
40 | 41 | slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'b21807286'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*85D0F19E5598AC04AC7B3FCF5383247D28FB59EF'
|
| 42 | +slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'b21807286'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*CF18BC9B45678165F755356FBD148E0F84D19A63' |
41 | 43 | slave-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'b21807286'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*7B8BEAA4240FE1A214BFAEDD99FB3842E4234E5E'
|
| 44 | +slave-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'b21807286_not_exists'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*498D18FA98FB65CF8E71D1D9DA5721646499DBD1' |
42 | 45 | slave-bin.000001 # Query # # use `test`; DROP USER b21807286@localhost
|
| 46 | +# |
| 47 | +# Bug #25813089: "CREATE USER IF NOT EXISTS SHOULD ALWAYS |
| 48 | +# BE WRITTEN TO THE BINLOGS" |
| 49 | +# |
| 50 | +# ------ |
| 51 | +"Scenario 1: CREATE/ALTER USER IF[NOT]EXISTS FOR A SINGLE USER" |
| 52 | +# ------ |
| 53 | +CREATE USER u1@localhost IDENTIFIED BY 'pass1'; |
| 54 | +CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pass2'; |
| 55 | +Warnings: |
| 56 | +Note 3163 User 'u1'@'localhost' already exists. |
| 57 | +ALTER USER u1@localhost IDENTIFIED BY 'pass3'; |
| 58 | +ALTER USER IF EXISTS u1@localhost IDENTIFIED BY 'pass4'; |
| 59 | +ALTER USER IF EXISTS u1_not_exists@localhost IDENTIFIED BY 'pass5'; |
| 60 | +Warnings: |
| 61 | +Note 3162 User 'u1_not_exists'@'localhost' does not exist. |
| 62 | +DROP USER u1@localhost; |
| 63 | +[On Master] |
| 64 | +include/show_binlog_events.inc |
| 65 | +Log_name Pos Event_type Server_id End_log_pos Info |
| 66 | +master-bin.000001 # Query # # use `test`; CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*22A99BA288DB55E8E230679259740873101CD636' |
| 67 | +master-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*1B884EF334D678B0743C8CE0425F980669D8FBB6' |
| 68 | +master-bin.000001 # Query # # use `test`; ALTER USER 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*35B5E90BC4F5AE5D02ED515DF6B61141F24EDA02' |
| 69 | +master-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*B718D8767BBACFBCE02BA2669ECCEB05930FF7D7' |
| 70 | +master-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u1_not_exists'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*9D3D6FA96FA91117D387A4B990C41F5809A536EE' |
| 71 | +master-bin.000001 # Query # # use `test`; DROP USER u1@localhost |
| 72 | +include/sync_slave_sql_with_master.inc |
| 73 | +[On Slave] |
| 74 | +include/show_binlog_events.inc |
| 75 | +Log_name Pos Event_type Server_id End_log_pos Info |
| 76 | +slave-bin.000001 # Query # # use `test`; CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*22A99BA288DB55E8E230679259740873101CD636' |
| 77 | +slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*1B884EF334D678B0743C8CE0425F980669D8FBB6' |
| 78 | +slave-bin.000001 # Query # # use `test`; ALTER USER 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*35B5E90BC4F5AE5D02ED515DF6B61141F24EDA02' |
| 79 | +slave-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*B718D8767BBACFBCE02BA2669ECCEB05930FF7D7' |
| 80 | +slave-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u1_not_exists'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*9D3D6FA96FA91117D387A4B990C41F5809A536EE' |
| 81 | +slave-bin.000001 # Query # # use `test`; DROP USER u1@localhost |
| 82 | +"Creating a user only on slave" |
| 83 | +CREATE USER IF NOT EXISTS slave_user@localhost IDENTIFIED BY 'slave_pass'; |
| 84 | +# ------ |
| 85 | +"Scenario 2: CREATE/ALTER USER IF[NOT]EXISTS FOR MULTIPLE USERS" |
| 86 | +# ------ |
| 87 | +CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pass1', |
| 88 | +u2@localhost IDENTIFIED BY 'pass2'; |
| 89 | +CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED BY 'pass1', |
| 90 | +u2@localhost IDENTIFIED BY 'pass2', |
| 91 | +u3@localhost IDENTIFIED BY 'pass3'; |
| 92 | +Warnings: |
| 93 | +Note 3163 User 'u1'@'localhost' already exists. |
| 94 | +Note 3163 User 'u2'@'localhost' already exists. |
| 95 | +ALTER USER IF EXISTS u1@localhost IDENTIFIED BY 'pass4', |
| 96 | +u2@localhost IDENTIFIED BY 'pass5', |
| 97 | +u3@localhost IDENTIFIED BY 'pass6', |
| 98 | +u4_not_exists@localhost IDENTIFIED BY 'pass7', |
| 99 | +slave_user@localhost IDENTIFIED BY 'pass8'; |
| 100 | +Warnings: |
| 101 | +Note 3162 User 'u4_not_exists'@'localhost' does not exist. |
| 102 | +Note 3162 User 'slave_user'@'localhost' does not exist. |
| 103 | +DROP USER IF EXISTS u1@localhost, u2@localhost, u3@localhost, slave_user@localhost; |
| 104 | +Warnings: |
| 105 | +Note 3162 User 'slave_user'@'localhost' does not exist. |
| 106 | +[On Master] |
| 107 | +include/show_binlog_events.inc |
| 108 | +Log_name Pos Event_type Server_id End_log_pos Info |
| 109 | +master-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*22A99BA288DB55E8E230679259740873101CD636','u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*1B884EF334D678B0743C8CE0425F980669D8FBB6' |
| 110 | +master-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*22A99BA288DB55E8E230679259740873101CD636','u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*1B884EF334D678B0743C8CE0425F980669D8FBB6','u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*35B5E90BC4F5AE5D02ED515DF6B61141F24EDA02' |
| 111 | +master-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*B718D8767BBACFBCE02BA2669ECCEB05930FF7D7','u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*9D3D6FA96FA91117D387A4B990C41F5809A536EE','u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*E4744236E26ADD8C3C3D727C7851A097FBBB8A87','u4_not_exists'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*BEA19EBE4ACA6B1820BF580B4054EB6B5B0D198D','slave_user'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*F40D7E5342EC4960531243A96CC2E94079BC11B7' |
| 112 | +master-bin.000001 # Query # # use `test`; DROP USER IF EXISTS u1@localhost, u2@localhost, u3@localhost, slave_user@localhost |
| 113 | +include/sync_slave_sql_with_master.inc |
| 114 | +[On Slave] |
| 115 | +include/show_binlog_events.inc |
| 116 | +Log_name Pos Event_type Server_id End_log_pos Info |
| 117 | +slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'slave_user'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*A8204EFAFFB19DEF65BE70042A9D93F1971925BC' |
| 118 | +slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*22A99BA288DB55E8E230679259740873101CD636','u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*1B884EF334D678B0743C8CE0425F980669D8FBB6' |
| 119 | +slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*22A99BA288DB55E8E230679259740873101CD636','u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*1B884EF334D678B0743C8CE0425F980669D8FBB6','u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*35B5E90BC4F5AE5D02ED515DF6B61141F24EDA02' |
| 120 | +slave-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*B718D8767BBACFBCE02BA2669ECCEB05930FF7D7','u2'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*9D3D6FA96FA91117D387A4B990C41F5809A536EE','u3'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*E4744236E26ADD8C3C3D727C7851A097FBBB8A87','u4_not_exists'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*BEA19EBE4ACA6B1820BF580B4054EB6B5B0D198D','slave_user'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*F40D7E5342EC4960531243A96CC2E94079BC11B7' |
| 121 | +slave-bin.000001 # Query # # use `test`; DROP USER IF EXISTS u1@localhost, u2@localhost, u3@localhost, slave_user@localhost |
| 122 | +# ------ |
| 123 | +"Scenario 3: CREATE/ALTER USER IF[NOT]EXISTS WITH" |
| 124 | +"AUTHENTICATION PLUGIN PROVIDED EXPLICITLY" |
| 125 | +# ------ |
| 126 | +include/rpl_restart_server.inc [server_number=1 parameters: --default_authentication_plugin=sha256_password] |
| 127 | +include/rpl_reset.inc |
| 128 | +SHOW VARIABLES LIKE 'default_authentication_plugin'; |
| 129 | +Variable_name Value |
| 130 | +default_authentication_plugin sha256_password |
| 131 | +CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED WITH mysql_native_password by 'pass_native'; |
| 132 | +CREATE USER IF NOT EXISTS u1@localhost IDENTIFIED WITH mysql_native_password by 'pass_native2'; |
| 133 | +Warnings: |
| 134 | +Note 3163 User 'u1'@'localhost' already exists. |
| 135 | +ALTER USER IF EXISTS u1@localhost IDENTIFIED WITH mysql_native_password BY 'pass_native3'; |
| 136 | +ALTER USER IF EXISTS u2_not_exists@localhost IDENTIFIED WITH mysql_native_password BY 'pass_native4'; |
| 137 | +Warnings: |
| 138 | +Note 3162 User 'u2_not_exists'@'localhost' does not exist. |
| 139 | +SELECT user,authentication_string FROM mysql.user WHERE user='u1'; |
| 140 | +user authentication_string |
| 141 | +u1 *52BA180A884483D54A3CEB45FB50D4E5B8071399 |
| 142 | +DROP USER u1@localhost; |
| 143 | +[On Master] |
| 144 | +include/show_binlog_events.inc |
| 145 | +Log_name Pos Event_type Server_id End_log_pos Info |
| 146 | +master-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*6DD89A65903AC3BCC4873BA43D17EFFB912C67EE' |
| 147 | +master-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*AD3E6D897B165BF1FA7D3583FA1FF6AF31FA3C4B' |
| 148 | +master-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*52BA180A884483D54A3CEB45FB50D4E5B8071399' |
| 149 | +master-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u2_not_exists'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*53ED7183CBBC6D9995663DD96EFFA60E2CE2C96E' |
| 150 | +master-bin.000001 # Query # # use `test`; DROP USER u1@localhost |
| 151 | +include/sync_slave_sql_with_master.inc |
| 152 | +[On Slave] |
| 153 | +include/show_binlog_events.inc |
| 154 | +Log_name Pos Event_type Server_id End_log_pos Info |
| 155 | +slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*6DD89A65903AC3BCC4873BA43D17EFFB912C67EE' |
| 156 | +slave-bin.000001 # Query # # use `test`; CREATE USER IF NOT EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*AD3E6D897B165BF1FA7D3583FA1FF6AF31FA3C4B' |
| 157 | +slave-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u1'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*52BA180A884483D54A3CEB45FB50D4E5B8071399' |
| 158 | +slave-bin.000001 # Query # # use `test`; ALTER USER IF EXISTS 'u2_not_exists'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS '*53ED7183CBBC6D9995663DD96EFFA60E2CE2C96E' |
| 159 | +slave-bin.000001 # Query # # use `test`; DROP USER u1@localhost |
| 160 | +# Search warnings in the server log |
43 | 161 | include/rpl_end.inc
|
44 | 162 |
|
45 | 163 | End of 5.7 tests!
|
|
0 commit comments