| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# wl#14019: Automatic connection failover for Async Replication Channels |
| 4 |
# - Step II: Automatic senders list |
| 5 |
# |
| 6 |
# It tests add and delete managed sender configuration UDF's. |
| 7 |
# |
| 8 |
# ==== Implementation ==== |
| 9 |
# |
| 10 |
# 0. The test requires 2 servers: |
| 11 |
# server1: source |
| 12 |
# server2: replica |
| 13 |
# |
| 14 |
# For asynchronous_connection_failover_add_managed: |
| 15 |
# 1. Check that the parameter count is equal to 8. |
| 16 |
# 2. Check that the channel name is provided. |
| 17 |
# 3. Check that host parameters values is provided and not empty. |
| 18 |
# 4. Check that port parameters values is provided. |
| 19 |
# 5. Check that the primary_weight parameter value is integer value between |
| 20 |
# 1-100. |
| 21 |
# 6. Check that the secondary_weight parameter value is integer value between |
| 22 |
# 1-100. |
| 23 |
# 7. Check that the default value of weight parameter is secondary_weight. |
| 24 |
# 8. Check that correct string value is provided for network_namespace. |
| 25 |
# |
| 26 |
# For asynchronous_connection_failover_delete_managed: |
| 27 |
# 9. Check that the parameter count is equal to 2. |
| 28 |
# i.e. channel_name, managed_name must be provided. |
| 29 |
# 10. Check that the channel name is provided. |
| 30 |
# 11. Check that managed_name parameter value is provided and not empty. |
| 31 |
# 12. Verify user without SUPER or REPLICATION_SLAVE_ADMIN fails with |
| 32 |
# ER_SPECIFIC_ACCESS_DENIED_ERROR error when execute |
| 33 |
# asynchronous_connection_failover_add_managed and |
| 34 |
# asynchronous_connection_failover_delete_managed UDF. |
| 35 |
# 13. Verify user with REPLICATION_SLAVE_ADMIN privilege can execute |
| 36 |
# asynchronous_connection_failover_add_source and |
| 37 |
# asynchronous_connection_failover_delete_source UDF. |
| 38 |
# 14. Cleanup. |
| 39 |
# |
| 40 |
|
| 41 |
--let $rpl_skip_start_slave= 1 |
| 42 |
--source include/master-slave.inc |
| 43 |
|
| 44 |
# Checks for add managed sender configuration UDF |
| 45 |
# i.e. asynchronous_connection_failover_add_managed() |
| 46 |
|
| 47 |
--echo # |
| 48 |
--echo # 1. Check that the parameter count is equal to 8. |
| 49 |
--echo # |
| 50 |
|
| 51 |
--error ER_CANT_INITIALIZE_UDF |
| 52 |
SELECT asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310); |
| 53 |
|
| 54 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 55 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 56 |
--source include/assert.inc |
| 57 |
|
| 58 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 59 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 60 |
--source include/assert.inc |
| 61 |
|
| 62 |
|
| 63 |
--error ER_CANT_INITIALIZE_UDF |
| 64 |
SELECT asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310, '', 80, 60, 11); |
| 65 |
|
| 66 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 67 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 68 |
--source include/assert.inc |
| 69 |
|
| 70 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 71 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 72 |
--source include/assert.inc |
| 73 |
|
| 74 |
|
| 75 |
--echo # |
| 76 |
--echo # 2. Check that the channel name is provided. |
| 77 |
--echo # |
| 78 |
|
| 79 |
--error ER_CANT_INITIALIZE_UDF |
| 80 |
SELECT asynchronous_connection_failover_add_managed(9, 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310, '', 80, 60); |
| 81 |
|
| 82 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 83 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 84 |
--source include/assert.inc |
| 85 |
|
| 86 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 87 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 88 |
--source include/assert.inc |
| 89 |
|
| 90 |
|
| 91 |
--echo # |
| 92 |
--echo # 3. Check that host parameters values is provided and not empty. |
| 93 |
--echo # |
| 94 |
|
| 95 |
--error ER_CANT_INITIALIZE_UDF |
| 96 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '', 3310, '', 80, 60); |
| 97 |
|
| 98 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 99 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 100 |
--source include/assert.inc |
| 101 |
|
| 102 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 103 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 104 |
--source include/assert.inc |
| 105 |
|
| 106 |
|
| 107 |
--echo # |
| 108 |
--echo # 4. Check that port parameters values is provided. |
| 109 |
--echo # |
| 110 |
|
| 111 |
--error ER_CANT_INITIALIZE_UDF |
| 112 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', '3310', '', 80, 60); |
| 113 |
|
| 114 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 115 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 116 |
--source include/assert.inc |
| 117 |
|
| 118 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 119 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 120 |
--source include/assert.inc |
| 121 |
|
| 122 |
|
| 123 |
--echo # |
| 124 |
--echo # 5. Check that the primary_weight parameter value is integer value |
| 125 |
--echo # between 1-100. |
| 126 |
--echo # |
| 127 |
|
| 128 |
--error ER_CANT_INITIALIZE_UDF |
| 129 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310, '', 0, 60); |
| 130 |
|
| 131 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 132 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 133 |
--source include/assert.inc |
| 134 |
|
| 135 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 136 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 137 |
--source include/assert.inc |
| 138 |
|
| 139 |
|
| 140 |
--error ER_CANT_INITIALIZE_UDF |
| 141 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310, '', 180, 60); |
| 142 |
|
| 143 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 144 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 145 |
--source include/assert.inc |
| 146 |
|
| 147 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 148 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 149 |
--source include/assert.inc |
| 150 |
|
| 151 |
|
| 152 |
--error ER_CANT_INITIALIZE_UDF |
| 153 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310, '', '80', 60); |
| 154 |
|
| 155 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 156 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 157 |
--source include/assert.inc |
| 158 |
|
| 159 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 160 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 161 |
--source include/assert.inc |
| 162 |
|
| 163 |
|
| 164 |
--echo # |
| 165 |
--echo # 6. Check that the secondary_weight parameter value is integer value |
| 166 |
--echo # between 1-100. |
| 167 |
--echo # |
| 168 |
|
| 169 |
--error ER_CANT_INITIALIZE_UDF |
| 170 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310, '', 80, 0); |
| 171 |
|
| 172 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 173 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 174 |
--source include/assert.inc |
| 175 |
|
| 176 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 177 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 178 |
--source include/assert.inc |
| 179 |
|
| 180 |
|
| 181 |
--error ER_CANT_INITIALIZE_UDF |
| 182 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310, '', 80, 160); |
| 183 |
|
| 184 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 185 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 186 |
--source include/assert.inc |
| 187 |
|
| 188 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 189 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 190 |
--source include/assert.inc |
| 191 |
|
| 192 |
|
| 193 |
--error ER_CANT_INITIALIZE_UDF |
| 194 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310, '', 80, '60'); |
| 195 |
|
| 196 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 197 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 198 |
--source include/assert.inc |
| 199 |
|
| 200 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 201 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 202 |
--source include/assert.inc |
| 203 |
|
| 204 |
|
| 205 |
--echo # |
| 206 |
--echo # 7. Check that the default value of weight parameter is |
| 207 |
--echo # secondary_weight. |
| 208 |
--echo # |
| 209 |
|
| 210 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3310, '', 80, 60); |
| 211 |
|
| 212 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover' |
| 213 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 1 |
| 214 |
--source include/assert.inc |
| 215 |
|
| 216 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover with weight=60' |
| 217 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover WHERE weight=60, count, 1] = 1 |
| 218 |
--source include/assert.inc |
| 219 |
|
| 220 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover_managed' |
| 221 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 222 |
--source include/assert.inc |
| 223 |
|
| 224 |
|
| 225 |
--echo # |
| 226 |
--echo # 8. Check correct string value is provided for network_namespace. |
| 227 |
--echo # |
| 228 |
|
| 229 |
--error ER_CANT_INITIALIZE_UDF |
| 230 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaabb', '127.0.0.1', 3310, 100, 80, 60); |
| 231 |
|
| 232 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover' |
| 233 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 1 |
| 234 |
--source include/assert.inc |
| 235 |
|
| 236 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover_managed' |
| 237 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 238 |
--source include/assert.inc |
| 239 |
|
| 240 |
SELECT * FROM performance_schema.replication_asynchronous_connection_failover; |
| 241 |
SELECT * FROM performance_schema.replication_asynchronous_connection_failover_managed; |
| 242 |
|
| 243 |
|
| 244 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaabb', '10.0.0.10', 1111, 'nets', 20, 10); |
| 245 |
|
| 246 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover' |
| 247 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 2 |
| 248 |
--source include/assert.inc |
| 249 |
|
| 250 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover_managed' |
| 251 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 2 |
| 252 |
--source include/assert.inc |
| 253 |
|
| 254 |
SELECT * FROM performance_schema.replication_asynchronous_connection_failover; |
| 255 |
SELECT * FROM performance_schema.replication_asynchronous_connection_failover_managed; |
| 256 |
|
| 257 |
# Adding a different managed channel does work. |
| 258 |
SELECT asynchronous_connection_failover_add_managed('ch1', 'GroupReplication', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaabb', '10.0.0.11', 2222, 'blue', 25, 15); |
| 259 |
|
| 260 |
--let $assert_text= 'There are 2 rows in performance_schema.replication_asynchronous_connection_failover' |
| 261 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 3 |
| 262 |
--source include/assert.inc |
| 263 |
|
| 264 |
--let $assert_text= 'There are 2 rows in performance_schema.replication_asynchronous_connection_failover_managed' |
| 265 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 3 |
| 266 |
--source include/assert.inc |
| 267 |
|
| 268 |
SELECT * FROM performance_schema.replication_asynchronous_connection_failover; |
| 269 |
SELECT * FROM performance_schema.replication_asynchronous_connection_failover_managed; |
| 270 |
|
| 271 |
SELECT asynchronous_connection_failover_delete_managed('', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaabb'); |
| 272 |
SELECT asynchronous_connection_failover_delete_managed('ch1', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaabb'); |
| 273 |
|
| 274 |
|
| 275 |
# Checks for delete managed sender configuration UDF |
| 276 |
# i.e. asynchronous_connection_failover_delete_managed() |
| 277 |
|
| 278 |
--echo # |
| 279 |
--echo # 9. Check that the parameter count is equal to 2. |
| 280 |
--echo # i.e. channel_name, managed_name must be provided. |
| 281 |
--echo # |
| 282 |
|
| 283 |
--error ER_CANT_INITIALIZE_UDF |
| 284 |
SELECT asynchronous_connection_failover_delete_managed(''); |
| 285 |
|
| 286 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover' |
| 287 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 1 |
| 288 |
--source include/assert.inc |
| 289 |
|
| 290 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 291 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 292 |
--source include/assert.inc |
| 293 |
|
| 294 |
|
| 295 |
--error ER_CANT_INITIALIZE_UDF |
| 296 |
SELECT asynchronous_connection_failover_delete_managed('', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 3); |
| 297 |
|
| 298 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover' |
| 299 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 1 |
| 300 |
--source include/assert.inc |
| 301 |
|
| 302 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 303 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 304 |
--source include/assert.inc |
| 305 |
|
| 306 |
|
| 307 |
--echo # |
| 308 |
--echo # 10. Check that the channel name is provided. |
| 309 |
--echo # |
| 310 |
|
| 311 |
--error ER_CANT_INITIALIZE_UDF |
| 312 |
SELECT asynchronous_connection_failover_delete_managed(9, 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); |
| 313 |
|
| 314 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover' |
| 315 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 1 |
| 316 |
--source include/assert.inc |
| 317 |
|
| 318 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 319 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 320 |
--source include/assert.inc |
| 321 |
|
| 322 |
|
| 323 |
--echo # |
| 324 |
--echo # 11. Check that managed_name parameter value is provided and not empty. |
| 325 |
--echo # |
| 326 |
|
| 327 |
--error ER_CANT_INITIALIZE_UDF |
| 328 |
SELECT asynchronous_connection_failover_delete_managed('', ''); |
| 329 |
|
| 330 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover' |
| 331 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 1 |
| 332 |
--source include/assert.inc |
| 333 |
|
| 334 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 335 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 1 |
| 336 |
--source include/assert.inc |
| 337 |
|
| 338 |
|
| 339 |
SELECT asynchronous_connection_failover_delete_managed('', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'); |
| 340 |
|
| 341 |
--let $assert_text= 'There is one row in performance_schema.replication_asynchronous_connection_failover' |
| 342 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 343 |
--source include/assert.inc |
| 344 |
|
| 345 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 346 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 347 |
--source include/assert.inc |
| 348 |
|
| 349 |
|
| 350 |
--echo # |
| 351 |
--echo # 12. Verify user without SUPER or REPLICATION_SLAVE_ADMIN fails with |
| 352 |
--echo # ER_SPECIFIC_ACCESS_DENIED_ERROR error when execute |
| 353 |
--echo # asynchronous_connection_failover_add_managed and |
| 354 |
--echo # asynchronous_connection_failover_delete_managed UDF. |
| 355 |
--echo # |
| 356 |
|
| 357 |
CREATE USER 'async_user' IDENTIFIED BY 'pass'; |
| 358 |
|
| 359 |
--echo [connection connect_async] |
| 360 |
connect(connect_async, localhost, async_user, pass); |
| 361 |
|
| 362 |
--error ER_SPECIFIC_ACCESS_DENIED_ERROR |
| 363 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-bbbb-aaaa-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3100, '', 80, 60); |
| 364 |
|
| 365 |
--error ER_SPECIFIC_ACCESS_DENIED_ERROR |
| 366 |
SELECT asynchronous_connection_failover_delete_managed('', 'aaaaaaaa-bbbb-aaaa-aaaa-aaaaaaaaaaaa'); |
| 367 |
|
| 368 |
--error ER_TABLEACCESS_DENIED_ERROR |
| 369 |
SELECT * FROM mysql.replication_asynchronous_connection_failover; |
| 370 |
|
| 371 |
--error ER_TABLEACCESS_DENIED_ERROR |
| 372 |
SELECT * FROM mysql.replication_asynchronous_connection_failover_managed; |
| 373 |
|
| 374 |
--disconnect connect_async |
| 375 |
|
| 376 |
|
| 377 |
--echo # |
| 378 |
--echo # 13. Verify user with REPLICATION_SLAVE_ADMIN privilege can execute |
| 379 |
--echo # asynchronous_connection_failover_add_source and |
| 380 |
--echo # asynchronous_connection_failover_delete_source UDF. |
| 381 |
--echo # |
| 382 |
|
| 383 |
--source include/rpl_connection_master.inc |
| 384 |
|
| 385 |
GRANT REPLICATION_SLAVE_ADMIN ON *.* TO 'async_user'; |
| 386 |
|
| 387 |
--echo [connection connect_async] |
| 388 |
connect(connect_async, localhost, async_user, pass); |
| 389 |
|
| 390 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-bbbb-bbbb-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3100, '', 80, 60); |
| 391 |
|
| 392 |
--error ER_UDF_ERROR |
| 393 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'aaaaaaaa-bbbb-bbbb-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3100, '', 80, 60); |
| 394 |
|
| 395 |
--error ER_CANT_INITIALIZE_UDF |
| 396 |
SELECT asynchronous_connection_failover_add_managed('', 'AsyncReplication', 'aaaaaaaa-bbbb-bbbb-aaaa-aaaaaaaaaaaa', '127.0.0.1', 3100, '', 80, 60); |
| 397 |
|
| 398 |
--error ER_CANT_INITIALIZE_UDF |
| 399 |
SELECT asynchronous_connection_failover_add_managed('', 'GroupReplication', 'UUID', '127.0.0.1', 3100, '', 80, 60); |
| 400 |
|
| 401 |
SELECT asynchronous_connection_failover_delete_managed('', 'aaaaaaaa-bbbb-bbbb-aaaa-aaaaaaaaaaaa'); |
| 402 |
|
| 403 |
--error ER_UDF_ERROR |
| 404 |
SELECT asynchronous_connection_failover_delete_managed('', 'aaaaaaaa-bbbb-bbbb-aaaa-aaaaaaaaaaaa'); |
| 405 |
|
| 406 |
--error ER_CANT_INITIALIZE_UDF |
| 407 |
SELECT asynchronous_connection_failover_delete_managed('', 'UUID'); |
| 408 |
|
| 409 |
--disconnect connect_async |
| 410 |
--source include/rpl_connection_master.inc |
| 411 |
|
| 412 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover table is empty' |
| 413 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover, count, 1] = 0 |
| 414 |
--source include/assert.inc |
| 415 |
|
| 416 |
--let $assert_text= 'The performance_schema.replication_asynchronous_connection_failover_managed table is empty' |
| 417 |
--let $assert_cond= [SELECT COUNT(*) count FROM performance_schema.replication_asynchronous_connection_failover_managed, count, 1] = 0 |
| 418 |
--source include/assert.inc |
| 419 |
|
| 420 |
|
| 421 |
--echo # |
| 422 |
--echo # 14. Cleanup. |
| 423 |
--echo # |
| 424 |
DROP USER 'async_user'; |
| 425 |
|
| 426 |
SET SESSION sql_log_bin = 0; |
| 427 |
call mtr.add_suppression("The source .* for channel '.*' has joined the group .*, and so added its entry into replication_asynchronous_connection_failover table."); |
| 428 |
call mtr.add_suppression("The group .* for the channel .* has been removed, and so removed its entry from replication_asynchronous_connection_failover_managed and all the group members from replication_asynchronous_connection_failover table."); |
| 429 |
call mtr.add_suppression("The group .* for the channel .* has been added, and so added its entry in replication_asynchronous_connection_failover_managed and source to replication_asynchronous_connection_failover table."); |
| 430 |
SET SESSION sql_log_bin = 1; |
| 431 |
|
| 432 |
--let $rpl_only_running_threads= 1 |
| 433 |
--source include/rpl_end.inc |