| 1 |
# ----------------------------------------------------------------------- |
| 2 |
# Setup |
| 3 |
# Saving initial values |
| 4 |
SET @global_start_value = @@global.transaction_isolation; |
| 5 |
SELECT @global_start_value; |
| 6 |
@global_start_value |
| 7 |
REPEATABLE-READ |
| 8 |
SET @session_start_value = @@session.transaction_isolation; |
| 9 |
SELECT @session_start_value; |
| 10 |
@session_start_value |
| 11 |
REPEATABLE-READ |
| 12 |
# Setting transaction isolation to 'READ-UNCOMMITTED' |
| 13 |
SET GLOBAL transaction_isolation = 'READ-UNCOMMITTED'; |
| 14 |
# ----------------------------------------------------------------------- |
| 15 |
# Case 1: FLUSH PRIVILEGES + ACL DDLs |
| 16 |
# ------------------------------- |
| 17 |
# Case 1.1: FLUSH PRIVILEGES + CREATE USER |
| 18 |
connect conn_attempt, localhost, root,,,,; |
| 19 |
SET @@lock_wait_timeout=1; |
| 20 |
connect conn_execute, localhost, root,,,,; |
| 21 |
connection conn_attempt; |
| 22 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 23 |
CREATE USER u1, u2; |
| 24 |
connection conn_execute; |
| 25 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 26 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 27 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 28 |
FLUSH PRIVILEGES; |
| 29 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 30 |
connection conn_attempt; |
| 31 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 32 |
connection default; |
| 33 |
SET DEBUG_SYNC="RESET"; |
| 34 |
disconnect conn_attempt; |
| 35 |
disconnect conn_execute; |
| 36 |
# ------------------------------- |
| 37 |
# Case 1.2: FLUSH PRIVILEGES + ALTER USER |
| 38 |
connect conn_attempt, localhost, root,,,,; |
| 39 |
SET @@lock_wait_timeout=1; |
| 40 |
connect conn_execute, localhost, root,,,,; |
| 41 |
connection conn_attempt; |
| 42 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 43 |
ALTER USER u1 IDENTIFIED BY 'abcd'; |
| 44 |
connection conn_execute; |
| 45 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 46 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 47 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 48 |
FLUSH PRIVILEGES; |
| 49 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 50 |
connection conn_attempt; |
| 51 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 52 |
connection default; |
| 53 |
SET DEBUG_SYNC="RESET"; |
| 54 |
disconnect conn_attempt; |
| 55 |
disconnect conn_execute; |
| 56 |
# ------------------------------- |
| 57 |
# Case 1.3: FLUSH PRIVILEGES + DROP USER |
| 58 |
connect conn_attempt, localhost, root,,,,; |
| 59 |
SET @@lock_wait_timeout=1; |
| 60 |
connect conn_execute, localhost, root,,,,; |
| 61 |
connection conn_attempt; |
| 62 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 63 |
DROP USER u1; |
| 64 |
connection conn_execute; |
| 65 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 66 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 67 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 68 |
FLUSH PRIVILEGES; |
| 69 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 70 |
connection conn_attempt; |
| 71 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 72 |
connection default; |
| 73 |
SET DEBUG_SYNC="RESET"; |
| 74 |
disconnect conn_attempt; |
| 75 |
disconnect conn_execute; |
| 76 |
# ------------------------------- |
| 77 |
# Case 1.4: FLUSH PRIVILEGES + RENAME USER |
| 78 |
connect conn_attempt, localhost, root,,,,; |
| 79 |
SET @@lock_wait_timeout=1; |
| 80 |
connect conn_execute, localhost, root,,,,; |
| 81 |
connection conn_attempt; |
| 82 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 83 |
RENAME USER u1 TO u2; |
| 84 |
connection conn_execute; |
| 85 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 86 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 87 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 88 |
FLUSH PRIVILEGES; |
| 89 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 90 |
connection conn_attempt; |
| 91 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 92 |
connection default; |
| 93 |
SET DEBUG_SYNC="RESET"; |
| 94 |
disconnect conn_attempt; |
| 95 |
disconnect conn_execute; |
| 96 |
# ------------------------------- |
| 97 |
# Case 1.5: FLUSH PRIVILEGES + CREATE ROLE |
| 98 |
connect conn_attempt, localhost, root,,,,; |
| 99 |
SET @@lock_wait_timeout=1; |
| 100 |
connect conn_execute, localhost, root,,,,; |
| 101 |
connection conn_attempt; |
| 102 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 103 |
CREATE ROLE r1; |
| 104 |
connection conn_execute; |
| 105 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 106 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 107 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 108 |
FLUSH PRIVILEGES; |
| 109 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 110 |
connection conn_attempt; |
| 111 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 112 |
connection default; |
| 113 |
SET DEBUG_SYNC="RESET"; |
| 114 |
disconnect conn_attempt; |
| 115 |
disconnect conn_execute; |
| 116 |
# ------------------------------- |
| 117 |
# Case 1.6: FLUSH PRIVILEGES + DROP ROLE |
| 118 |
connect conn_attempt, localhost, root,,,,; |
| 119 |
SET @@lock_wait_timeout=1; |
| 120 |
connect conn_execute, localhost, root,,,,; |
| 121 |
connection conn_attempt; |
| 122 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 123 |
DROP ROLE r1; |
| 124 |
connection conn_execute; |
| 125 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 126 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 127 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 128 |
FLUSH PRIVILEGES; |
| 129 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 130 |
connection conn_attempt; |
| 131 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 132 |
connection default; |
| 133 |
SET DEBUG_SYNC="RESET"; |
| 134 |
disconnect conn_attempt; |
| 135 |
disconnect conn_execute; |
| 136 |
# ------------------------------- |
| 137 |
# Case 1.7: FLUSH PRIVILEGES + GRANT privilege |
| 138 |
connect conn_attempt, localhost, root,,,,; |
| 139 |
SET @@lock_wait_timeout=1; |
| 140 |
connect conn_execute, localhost, root,,,,; |
| 141 |
connection conn_attempt; |
| 142 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 143 |
GRANT SELECT ON *.* TO u1; |
| 144 |
connection conn_execute; |
| 145 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 146 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 147 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 148 |
FLUSH PRIVILEGES; |
| 149 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 150 |
connection conn_attempt; |
| 151 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 152 |
connection default; |
| 153 |
SET DEBUG_SYNC="RESET"; |
| 154 |
disconnect conn_attempt; |
| 155 |
disconnect conn_execute; |
| 156 |
# ------------------------------- |
| 157 |
# Case 1.8: FLUSH PRIVILEGES + REVOKE privilege |
| 158 |
connect conn_attempt, localhost, root,,,,; |
| 159 |
SET @@lock_wait_timeout=1; |
| 160 |
connect conn_execute, localhost, root,,,,; |
| 161 |
connection conn_attempt; |
| 162 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 163 |
REVOKE SELECT ON *.* FROM u1; |
| 164 |
connection conn_execute; |
| 165 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 166 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 167 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 168 |
FLUSH PRIVILEGES; |
| 169 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 170 |
connection conn_attempt; |
| 171 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 172 |
connection default; |
| 173 |
SET DEBUG_SYNC="RESET"; |
| 174 |
disconnect conn_attempt; |
| 175 |
disconnect conn_execute; |
| 176 |
# ------------------------------- |
| 177 |
# Case 1.9: FLUSH PRIVILEGES + GRANT role |
| 178 |
connect conn_attempt, localhost, root,,,,; |
| 179 |
SET @@lock_wait_timeout=1; |
| 180 |
connect conn_execute, localhost, root,,,,; |
| 181 |
connection conn_attempt; |
| 182 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 183 |
GRANT r1 TO u1; |
| 184 |
connection conn_execute; |
| 185 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 186 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 187 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 188 |
FLUSH PRIVILEGES; |
| 189 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 190 |
connection conn_attempt; |
| 191 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 192 |
connection default; |
| 193 |
SET DEBUG_SYNC="RESET"; |
| 194 |
disconnect conn_attempt; |
| 195 |
disconnect conn_execute; |
| 196 |
# ------------------------------- |
| 197 |
# Case 1.10: FLUSH PRIVILEGES + REVOKE role |
| 198 |
connect conn_attempt, localhost, root,,,,; |
| 199 |
SET @@lock_wait_timeout=1; |
| 200 |
connect conn_execute, localhost, root,,,,; |
| 201 |
connection conn_attempt; |
| 202 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 203 |
REVOKE r1 FROM u1; |
| 204 |
connection conn_execute; |
| 205 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 206 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 207 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 208 |
FLUSH PRIVILEGES; |
| 209 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 210 |
connection conn_attempt; |
| 211 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 212 |
connection default; |
| 213 |
SET DEBUG_SYNC="RESET"; |
| 214 |
disconnect conn_attempt; |
| 215 |
disconnect conn_execute; |
| 216 |
# ------------------------------- |
| 217 |
# Case 1.11: FLUSH PRIVILEGES + SET PASSWORD |
| 218 |
connect conn_attempt, localhost, root,,,,; |
| 219 |
SET @@lock_wait_timeout=1; |
| 220 |
connect conn_execute, localhost, root,,,,; |
| 221 |
connection conn_attempt; |
| 222 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 223 |
SET PASSWORD FOR u1 = 'abcd'; |
| 224 |
connection conn_execute; |
| 225 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 226 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 227 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 228 |
FLUSH PRIVILEGES; |
| 229 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 230 |
connection conn_attempt; |
| 231 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 232 |
connection default; |
| 233 |
SET DEBUG_SYNC="RESET"; |
| 234 |
disconnect conn_attempt; |
| 235 |
disconnect conn_execute; |
| 236 |
# ------------------------------- |
| 237 |
# Case 1.12: FLUSH PRIVILEGES + SET DEFAULT ROLE |
| 238 |
connect conn_attempt, localhost, root,,,,; |
| 239 |
SET @@lock_wait_timeout=1; |
| 240 |
connect conn_execute, localhost, root,,,,; |
| 241 |
connection conn_attempt; |
| 242 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 243 |
SET DEFAULT ROLE r1 to u1; |
| 244 |
connection conn_execute; |
| 245 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 246 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 247 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 248 |
FLUSH PRIVILEGES; |
| 249 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 250 |
connection conn_attempt; |
| 251 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 252 |
connection default; |
| 253 |
SET DEBUG_SYNC="RESET"; |
| 254 |
disconnect conn_attempt; |
| 255 |
disconnect conn_execute; |
| 256 |
# ----------------------------------------------------------------------- |
| 257 |
# Cleanup |
| 258 |
# Restore initial values |
| 259 |
SET @@global.transaction_isolation = @global_start_value; |
| 260 |
SELECT @@global.transaction_isolation; |
| 261 |
@@global.transaction_isolation |
| 262 |
REPEATABLE-READ |
| 263 |
SET @@session.transaction_isolation = @session_start_value; |
| 264 |
SELECT @@session.transaction_isolation; |
| 265 |
@@session.transaction_isolation |
| 266 |
REPEATABLE-READ |
| 267 |
# ----------------------------------------------------------------------- |
| 268 |
# Setup |
| 269 |
# Saving initial values |
| 270 |
SET @global_start_value = @@global.transaction_isolation; |
| 271 |
SELECT @global_start_value; |
| 272 |
@global_start_value |
| 273 |
REPEATABLE-READ |
| 274 |
SET @session_start_value = @@session.transaction_isolation; |
| 275 |
SELECT @session_start_value; |
| 276 |
@session_start_value |
| 277 |
REPEATABLE-READ |
| 278 |
# Setting transaction isolation to 'READ-COMMITTED' |
| 279 |
SET GLOBAL transaction_isolation = 'READ-COMMITTED'; |
| 280 |
# ----------------------------------------------------------------------- |
| 281 |
# Case 1: FLUSH PRIVILEGES + ACL DDLs |
| 282 |
# ------------------------------- |
| 283 |
# Case 1.1: FLUSH PRIVILEGES + CREATE USER |
| 284 |
connect conn_attempt, localhost, root,,,,; |
| 285 |
SET @@lock_wait_timeout=1; |
| 286 |
connect conn_execute, localhost, root,,,,; |
| 287 |
connection conn_attempt; |
| 288 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 289 |
CREATE USER u1, u2; |
| 290 |
connection conn_execute; |
| 291 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 292 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 293 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 294 |
FLUSH PRIVILEGES; |
| 295 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 296 |
connection conn_attempt; |
| 297 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 298 |
connection default; |
| 299 |
SET DEBUG_SYNC="RESET"; |
| 300 |
disconnect conn_attempt; |
| 301 |
disconnect conn_execute; |
| 302 |
# ------------------------------- |
| 303 |
# Case 1.2: FLUSH PRIVILEGES + ALTER USER |
| 304 |
connect conn_attempt, localhost, root,,,,; |
| 305 |
SET @@lock_wait_timeout=1; |
| 306 |
connect conn_execute, localhost, root,,,,; |
| 307 |
connection conn_attempt; |
| 308 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 309 |
ALTER USER u1 IDENTIFIED BY 'abcd'; |
| 310 |
connection conn_execute; |
| 311 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 312 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 313 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 314 |
FLUSH PRIVILEGES; |
| 315 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 316 |
connection conn_attempt; |
| 317 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 318 |
connection default; |
| 319 |
SET DEBUG_SYNC="RESET"; |
| 320 |
disconnect conn_attempt; |
| 321 |
disconnect conn_execute; |
| 322 |
# ------------------------------- |
| 323 |
# Case 1.3: FLUSH PRIVILEGES + DROP USER |
| 324 |
connect conn_attempt, localhost, root,,,,; |
| 325 |
SET @@lock_wait_timeout=1; |
| 326 |
connect conn_execute, localhost, root,,,,; |
| 327 |
connection conn_attempt; |
| 328 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 329 |
DROP USER u1; |
| 330 |
connection conn_execute; |
| 331 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 332 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 333 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 334 |
FLUSH PRIVILEGES; |
| 335 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 336 |
connection conn_attempt; |
| 337 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 338 |
connection default; |
| 339 |
SET DEBUG_SYNC="RESET"; |
| 340 |
disconnect conn_attempt; |
| 341 |
disconnect conn_execute; |
| 342 |
# ------------------------------- |
| 343 |
# Case 1.4: FLUSH PRIVILEGES + RENAME USER |
| 344 |
connect conn_attempt, localhost, root,,,,; |
| 345 |
SET @@lock_wait_timeout=1; |
| 346 |
connect conn_execute, localhost, root,,,,; |
| 347 |
connection conn_attempt; |
| 348 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 349 |
RENAME USER u1 TO u2; |
| 350 |
connection conn_execute; |
| 351 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 352 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 353 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 354 |
FLUSH PRIVILEGES; |
| 355 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 356 |
connection conn_attempt; |
| 357 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 358 |
connection default; |
| 359 |
SET DEBUG_SYNC="RESET"; |
| 360 |
disconnect conn_attempt; |
| 361 |
disconnect conn_execute; |
| 362 |
# ------------------------------- |
| 363 |
# Case 1.5: FLUSH PRIVILEGES + CREATE ROLE |
| 364 |
connect conn_attempt, localhost, root,,,,; |
| 365 |
SET @@lock_wait_timeout=1; |
| 366 |
connect conn_execute, localhost, root,,,,; |
| 367 |
connection conn_attempt; |
| 368 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 369 |
CREATE ROLE r1; |
| 370 |
connection conn_execute; |
| 371 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 372 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 373 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 374 |
FLUSH PRIVILEGES; |
| 375 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 376 |
connection conn_attempt; |
| 377 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 378 |
connection default; |
| 379 |
SET DEBUG_SYNC="RESET"; |
| 380 |
disconnect conn_attempt; |
| 381 |
disconnect conn_execute; |
| 382 |
# ------------------------------- |
| 383 |
# Case 1.6: FLUSH PRIVILEGES + DROP ROLE |
| 384 |
connect conn_attempt, localhost, root,,,,; |
| 385 |
SET @@lock_wait_timeout=1; |
| 386 |
connect conn_execute, localhost, root,,,,; |
| 387 |
connection conn_attempt; |
| 388 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 389 |
DROP ROLE r1; |
| 390 |
connection conn_execute; |
| 391 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 392 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 393 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 394 |
FLUSH PRIVILEGES; |
| 395 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 396 |
connection conn_attempt; |
| 397 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 398 |
connection default; |
| 399 |
SET DEBUG_SYNC="RESET"; |
| 400 |
disconnect conn_attempt; |
| 401 |
disconnect conn_execute; |
| 402 |
# ------------------------------- |
| 403 |
# Case 1.7: FLUSH PRIVILEGES + GRANT privilege |
| 404 |
connect conn_attempt, localhost, root,,,,; |
| 405 |
SET @@lock_wait_timeout=1; |
| 406 |
connect conn_execute, localhost, root,,,,; |
| 407 |
connection conn_attempt; |
| 408 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 409 |
GRANT SELECT ON *.* TO u1; |
| 410 |
connection conn_execute; |
| 411 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 412 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 413 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 414 |
FLUSH PRIVILEGES; |
| 415 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 416 |
connection conn_attempt; |
| 417 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 418 |
connection default; |
| 419 |
SET DEBUG_SYNC="RESET"; |
| 420 |
disconnect conn_attempt; |
| 421 |
disconnect conn_execute; |
| 422 |
# ------------------------------- |
| 423 |
# Case 1.8: FLUSH PRIVILEGES + REVOKE privilege |
| 424 |
connect conn_attempt, localhost, root,,,,; |
| 425 |
SET @@lock_wait_timeout=1; |
| 426 |
connect conn_execute, localhost, root,,,,; |
| 427 |
connection conn_attempt; |
| 428 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 429 |
REVOKE SELECT ON *.* FROM u1; |
| 430 |
connection conn_execute; |
| 431 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 432 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 433 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 434 |
FLUSH PRIVILEGES; |
| 435 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 436 |
connection conn_attempt; |
| 437 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 438 |
connection default; |
| 439 |
SET DEBUG_SYNC="RESET"; |
| 440 |
disconnect conn_attempt; |
| 441 |
disconnect conn_execute; |
| 442 |
# ------------------------------- |
| 443 |
# Case 1.9: FLUSH PRIVILEGES + GRANT role |
| 444 |
connect conn_attempt, localhost, root,,,,; |
| 445 |
SET @@lock_wait_timeout=1; |
| 446 |
connect conn_execute, localhost, root,,,,; |
| 447 |
connection conn_attempt; |
| 448 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 449 |
GRANT r1 TO u1; |
| 450 |
connection conn_execute; |
| 451 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 452 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 453 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 454 |
FLUSH PRIVILEGES; |
| 455 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 456 |
connection conn_attempt; |
| 457 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 458 |
connection default; |
| 459 |
SET DEBUG_SYNC="RESET"; |
| 460 |
disconnect conn_attempt; |
| 461 |
disconnect conn_execute; |
| 462 |
# ------------------------------- |
| 463 |
# Case 1.10: FLUSH PRIVILEGES + REVOKE role |
| 464 |
connect conn_attempt, localhost, root,,,,; |
| 465 |
SET @@lock_wait_timeout=1; |
| 466 |
connect conn_execute, localhost, root,,,,; |
| 467 |
connection conn_attempt; |
| 468 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 469 |
REVOKE r1 FROM u1; |
| 470 |
connection conn_execute; |
| 471 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 472 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 473 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 474 |
FLUSH PRIVILEGES; |
| 475 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 476 |
connection conn_attempt; |
| 477 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 478 |
connection default; |
| 479 |
SET DEBUG_SYNC="RESET"; |
| 480 |
disconnect conn_attempt; |
| 481 |
disconnect conn_execute; |
| 482 |
# ------------------------------- |
| 483 |
# Case 1.11: FLUSH PRIVILEGES + SET PASSWORD |
| 484 |
connect conn_attempt, localhost, root,,,,; |
| 485 |
SET @@lock_wait_timeout=1; |
| 486 |
connect conn_execute, localhost, root,,,,; |
| 487 |
connection conn_attempt; |
| 488 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 489 |
SET PASSWORD FOR u1 = 'abcd'; |
| 490 |
connection conn_execute; |
| 491 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 492 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 493 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 494 |
FLUSH PRIVILEGES; |
| 495 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 496 |
connection conn_attempt; |
| 497 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 498 |
connection default; |
| 499 |
SET DEBUG_SYNC="RESET"; |
| 500 |
disconnect conn_attempt; |
| 501 |
disconnect conn_execute; |
| 502 |
# ------------------------------- |
| 503 |
# Case 1.12: FLUSH PRIVILEGES + SET DEFAULT ROLE |
| 504 |
connect conn_attempt, localhost, root,,,,; |
| 505 |
SET @@lock_wait_timeout=1; |
| 506 |
connect conn_execute, localhost, root,,,,; |
| 507 |
connection conn_attempt; |
| 508 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 509 |
SET DEFAULT ROLE r1 to u1; |
| 510 |
connection conn_execute; |
| 511 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 512 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 513 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 514 |
FLUSH PRIVILEGES; |
| 515 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 516 |
connection conn_attempt; |
| 517 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 518 |
connection default; |
| 519 |
SET DEBUG_SYNC="RESET"; |
| 520 |
disconnect conn_attempt; |
| 521 |
disconnect conn_execute; |
| 522 |
# ----------------------------------------------------------------------- |
| 523 |
# Cleanup |
| 524 |
# Restore initial values |
| 525 |
SET @@global.transaction_isolation = @global_start_value; |
| 526 |
SELECT @@global.transaction_isolation; |
| 527 |
@@global.transaction_isolation |
| 528 |
REPEATABLE-READ |
| 529 |
SET @@session.transaction_isolation = @session_start_value; |
| 530 |
SELECT @@session.transaction_isolation; |
| 531 |
@@session.transaction_isolation |
| 532 |
REPEATABLE-READ |
| 533 |
# ----------------------------------------------------------------------- |
| 534 |
# Setup |
| 535 |
# Saving initial values |
| 536 |
SET @global_start_value = @@global.transaction_isolation; |
| 537 |
SELECT @global_start_value; |
| 538 |
@global_start_value |
| 539 |
REPEATABLE-READ |
| 540 |
SET @session_start_value = @@session.transaction_isolation; |
| 541 |
SELECT @session_start_value; |
| 542 |
@session_start_value |
| 543 |
REPEATABLE-READ |
| 544 |
# Setting transaction isolation to 'REPEATABLE-READ' |
| 545 |
SET GLOBAL transaction_isolation = 'REPEATABLE-READ'; |
| 546 |
# ----------------------------------------------------------------------- |
| 547 |
# Case 1: FLUSH PRIVILEGES + ACL DDLs |
| 548 |
# ------------------------------- |
| 549 |
# Case 1.1: FLUSH PRIVILEGES + CREATE USER |
| 550 |
connect conn_attempt, localhost, root,,,,; |
| 551 |
SET @@lock_wait_timeout=1; |
| 552 |
connect conn_execute, localhost, root,,,,; |
| 553 |
connection conn_attempt; |
| 554 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 555 |
CREATE USER u1, u2; |
| 556 |
connection conn_execute; |
| 557 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 558 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 559 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 560 |
FLUSH PRIVILEGES; |
| 561 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 562 |
connection conn_attempt; |
| 563 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 564 |
connection default; |
| 565 |
SET DEBUG_SYNC="RESET"; |
| 566 |
disconnect conn_attempt; |
| 567 |
disconnect conn_execute; |
| 568 |
# ------------------------------- |
| 569 |
# Case 1.2: FLUSH PRIVILEGES + ALTER USER |
| 570 |
connect conn_attempt, localhost, root,,,,; |
| 571 |
SET @@lock_wait_timeout=1; |
| 572 |
connect conn_execute, localhost, root,,,,; |
| 573 |
connection conn_attempt; |
| 574 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 575 |
ALTER USER u1 IDENTIFIED BY 'abcd'; |
| 576 |
connection conn_execute; |
| 577 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 578 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 579 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 580 |
FLUSH PRIVILEGES; |
| 581 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 582 |
connection conn_attempt; |
| 583 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 584 |
connection default; |
| 585 |
SET DEBUG_SYNC="RESET"; |
| 586 |
disconnect conn_attempt; |
| 587 |
disconnect conn_execute; |
| 588 |
# ------------------------------- |
| 589 |
# Case 1.3: FLUSH PRIVILEGES + DROP USER |
| 590 |
connect conn_attempt, localhost, root,,,,; |
| 591 |
SET @@lock_wait_timeout=1; |
| 592 |
connect conn_execute, localhost, root,,,,; |
| 593 |
connection conn_attempt; |
| 594 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 595 |
DROP USER u1; |
| 596 |
connection conn_execute; |
| 597 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 598 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 599 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 600 |
FLUSH PRIVILEGES; |
| 601 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 602 |
connection conn_attempt; |
| 603 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 604 |
connection default; |
| 605 |
SET DEBUG_SYNC="RESET"; |
| 606 |
disconnect conn_attempt; |
| 607 |
disconnect conn_execute; |
| 608 |
# ------------------------------- |
| 609 |
# Case 1.4: FLUSH PRIVILEGES + RENAME USER |
| 610 |
connect conn_attempt, localhost, root,,,,; |
| 611 |
SET @@lock_wait_timeout=1; |
| 612 |
connect conn_execute, localhost, root,,,,; |
| 613 |
connection conn_attempt; |
| 614 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 615 |
RENAME USER u1 TO u2; |
| 616 |
connection conn_execute; |
| 617 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 618 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 619 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 620 |
FLUSH PRIVILEGES; |
| 621 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 622 |
connection conn_attempt; |
| 623 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 624 |
connection default; |
| 625 |
SET DEBUG_SYNC="RESET"; |
| 626 |
disconnect conn_attempt; |
| 627 |
disconnect conn_execute; |
| 628 |
# ------------------------------- |
| 629 |
# Case 1.5: FLUSH PRIVILEGES + CREATE ROLE |
| 630 |
connect conn_attempt, localhost, root,,,,; |
| 631 |
SET @@lock_wait_timeout=1; |
| 632 |
connect conn_execute, localhost, root,,,,; |
| 633 |
connection conn_attempt; |
| 634 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 635 |
CREATE ROLE r1; |
| 636 |
connection conn_execute; |
| 637 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 638 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 639 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 640 |
FLUSH PRIVILEGES; |
| 641 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 642 |
connection conn_attempt; |
| 643 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 644 |
connection default; |
| 645 |
SET DEBUG_SYNC="RESET"; |
| 646 |
disconnect conn_attempt; |
| 647 |
disconnect conn_execute; |
| 648 |
# ------------------------------- |
| 649 |
# Case 1.6: FLUSH PRIVILEGES + DROP ROLE |
| 650 |
connect conn_attempt, localhost, root,,,,; |
| 651 |
SET @@lock_wait_timeout=1; |
| 652 |
connect conn_execute, localhost, root,,,,; |
| 653 |
connection conn_attempt; |
| 654 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 655 |
DROP ROLE r1; |
| 656 |
connection conn_execute; |
| 657 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 658 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 659 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 660 |
FLUSH PRIVILEGES; |
| 661 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 662 |
connection conn_attempt; |
| 663 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 664 |
connection default; |
| 665 |
SET DEBUG_SYNC="RESET"; |
| 666 |
disconnect conn_attempt; |
| 667 |
disconnect conn_execute; |
| 668 |
# ------------------------------- |
| 669 |
# Case 1.7: FLUSH PRIVILEGES + GRANT privilege |
| 670 |
connect conn_attempt, localhost, root,,,,; |
| 671 |
SET @@lock_wait_timeout=1; |
| 672 |
connect conn_execute, localhost, root,,,,; |
| 673 |
connection conn_attempt; |
| 674 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 675 |
GRANT SELECT ON *.* TO u1; |
| 676 |
connection conn_execute; |
| 677 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 678 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 679 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 680 |
FLUSH PRIVILEGES; |
| 681 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 682 |
connection conn_attempt; |
| 683 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 684 |
connection default; |
| 685 |
SET DEBUG_SYNC="RESET"; |
| 686 |
disconnect conn_attempt; |
| 687 |
disconnect conn_execute; |
| 688 |
# ------------------------------- |
| 689 |
# Case 1.8: FLUSH PRIVILEGES + REVOKE privilege |
| 690 |
connect conn_attempt, localhost, root,,,,; |
| 691 |
SET @@lock_wait_timeout=1; |
| 692 |
connect conn_execute, localhost, root,,,,; |
| 693 |
connection conn_attempt; |
| 694 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 695 |
REVOKE SELECT ON *.* FROM u1; |
| 696 |
connection conn_execute; |
| 697 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 698 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 699 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 700 |
FLUSH PRIVILEGES; |
| 701 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 702 |
connection conn_attempt; |
| 703 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 704 |
connection default; |
| 705 |
SET DEBUG_SYNC="RESET"; |
| 706 |
disconnect conn_attempt; |
| 707 |
disconnect conn_execute; |
| 708 |
# ------------------------------- |
| 709 |
# Case 1.9: FLUSH PRIVILEGES + GRANT role |
| 710 |
connect conn_attempt, localhost, root,,,,; |
| 711 |
SET @@lock_wait_timeout=1; |
| 712 |
connect conn_execute, localhost, root,,,,; |
| 713 |
connection conn_attempt; |
| 714 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 715 |
GRANT r1 TO u1; |
| 716 |
connection conn_execute; |
| 717 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 718 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 719 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 720 |
FLUSH PRIVILEGES; |
| 721 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 722 |
connection conn_attempt; |
| 723 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 724 |
connection default; |
| 725 |
SET DEBUG_SYNC="RESET"; |
| 726 |
disconnect conn_attempt; |
| 727 |
disconnect conn_execute; |
| 728 |
# ------------------------------- |
| 729 |
# Case 1.10: FLUSH PRIVILEGES + REVOKE role |
| 730 |
connect conn_attempt, localhost, root,,,,; |
| 731 |
SET @@lock_wait_timeout=1; |
| 732 |
connect conn_execute, localhost, root,,,,; |
| 733 |
connection conn_attempt; |
| 734 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 735 |
REVOKE r1 FROM u1; |
| 736 |
connection conn_execute; |
| 737 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 738 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 739 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 740 |
FLUSH PRIVILEGES; |
| 741 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 742 |
connection conn_attempt; |
| 743 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 744 |
connection default; |
| 745 |
SET DEBUG_SYNC="RESET"; |
| 746 |
disconnect conn_attempt; |
| 747 |
disconnect conn_execute; |
| 748 |
# ------------------------------- |
| 749 |
# Case 1.11: FLUSH PRIVILEGES + SET PASSWORD |
| 750 |
connect conn_attempt, localhost, root,,,,; |
| 751 |
SET @@lock_wait_timeout=1; |
| 752 |
connect conn_execute, localhost, root,,,,; |
| 753 |
connection conn_attempt; |
| 754 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 755 |
SET PASSWORD FOR u1 = 'abcd'; |
| 756 |
connection conn_execute; |
| 757 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 758 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 759 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 760 |
FLUSH PRIVILEGES; |
| 761 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 762 |
connection conn_attempt; |
| 763 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 764 |
connection default; |
| 765 |
SET DEBUG_SYNC="RESET"; |
| 766 |
disconnect conn_attempt; |
| 767 |
disconnect conn_execute; |
| 768 |
# ------------------------------- |
| 769 |
# Case 1.12: FLUSH PRIVILEGES + SET DEFAULT ROLE |
| 770 |
connect conn_attempt, localhost, root,,,,; |
| 771 |
SET @@lock_wait_timeout=1; |
| 772 |
connect conn_execute, localhost, root,,,,; |
| 773 |
connection conn_attempt; |
| 774 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 775 |
SET DEFAULT ROLE r1 to u1; |
| 776 |
connection conn_execute; |
| 777 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 778 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 779 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 780 |
FLUSH PRIVILEGES; |
| 781 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 782 |
connection conn_attempt; |
| 783 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 784 |
connection default; |
| 785 |
SET DEBUG_SYNC="RESET"; |
| 786 |
disconnect conn_attempt; |
| 787 |
disconnect conn_execute; |
| 788 |
# ----------------------------------------------------------------------- |
| 789 |
# Cleanup |
| 790 |
# Restore initial values |
| 791 |
SET @@global.transaction_isolation = @global_start_value; |
| 792 |
SELECT @@global.transaction_isolation; |
| 793 |
@@global.transaction_isolation |
| 794 |
REPEATABLE-READ |
| 795 |
SET @@session.transaction_isolation = @session_start_value; |
| 796 |
SELECT @@session.transaction_isolation; |
| 797 |
@@session.transaction_isolation |
| 798 |
REPEATABLE-READ |
| 799 |
# ----------------------------------------------------------------------- |
| 800 |
# Setup |
| 801 |
# Saving initial values |
| 802 |
SET @global_start_value = @@global.transaction_isolation; |
| 803 |
SELECT @global_start_value; |
| 804 |
@global_start_value |
| 805 |
REPEATABLE-READ |
| 806 |
SET @session_start_value = @@session.transaction_isolation; |
| 807 |
SELECT @session_start_value; |
| 808 |
@session_start_value |
| 809 |
REPEATABLE-READ |
| 810 |
# Setting transaction isolation to 'SERIALIZABLE' |
| 811 |
SET GLOBAL transaction_isolation = 'SERIALIZABLE'; |
| 812 |
# ----------------------------------------------------------------------- |
| 813 |
# Case 1: FLUSH PRIVILEGES + ACL DDLs |
| 814 |
# ------------------------------- |
| 815 |
# Case 1.1: FLUSH PRIVILEGES + CREATE USER |
| 816 |
connect conn_attempt, localhost, root,,,,; |
| 817 |
SET @@lock_wait_timeout=1; |
| 818 |
connect conn_execute, localhost, root,,,,; |
| 819 |
connection conn_attempt; |
| 820 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 821 |
CREATE USER u1, u2; |
| 822 |
connection conn_execute; |
| 823 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 824 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 825 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 826 |
FLUSH PRIVILEGES; |
| 827 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 828 |
connection conn_attempt; |
| 829 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 830 |
connection default; |
| 831 |
SET DEBUG_SYNC="RESET"; |
| 832 |
disconnect conn_attempt; |
| 833 |
disconnect conn_execute; |
| 834 |
# ------------------------------- |
| 835 |
# Case 1.2: FLUSH PRIVILEGES + ALTER USER |
| 836 |
connect conn_attempt, localhost, root,,,,; |
| 837 |
SET @@lock_wait_timeout=1; |
| 838 |
connect conn_execute, localhost, root,,,,; |
| 839 |
connection conn_attempt; |
| 840 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 841 |
ALTER USER u1 IDENTIFIED BY 'abcd'; |
| 842 |
connection conn_execute; |
| 843 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 844 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 845 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 846 |
FLUSH PRIVILEGES; |
| 847 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 848 |
connection conn_attempt; |
| 849 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 850 |
connection default; |
| 851 |
SET DEBUG_SYNC="RESET"; |
| 852 |
disconnect conn_attempt; |
| 853 |
disconnect conn_execute; |
| 854 |
# ------------------------------- |
| 855 |
# Case 1.3: FLUSH PRIVILEGES + DROP USER |
| 856 |
connect conn_attempt, localhost, root,,,,; |
| 857 |
SET @@lock_wait_timeout=1; |
| 858 |
connect conn_execute, localhost, root,,,,; |
| 859 |
connection conn_attempt; |
| 860 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 861 |
DROP USER u1; |
| 862 |
connection conn_execute; |
| 863 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 864 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 865 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 866 |
FLUSH PRIVILEGES; |
| 867 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 868 |
connection conn_attempt; |
| 869 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 870 |
connection default; |
| 871 |
SET DEBUG_SYNC="RESET"; |
| 872 |
disconnect conn_attempt; |
| 873 |
disconnect conn_execute; |
| 874 |
# ------------------------------- |
| 875 |
# Case 1.4: FLUSH PRIVILEGES + RENAME USER |
| 876 |
connect conn_attempt, localhost, root,,,,; |
| 877 |
SET @@lock_wait_timeout=1; |
| 878 |
connect conn_execute, localhost, root,,,,; |
| 879 |
connection conn_attempt; |
| 880 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 881 |
RENAME USER u1 TO u2; |
| 882 |
connection conn_execute; |
| 883 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 884 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 885 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 886 |
FLUSH PRIVILEGES; |
| 887 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 888 |
connection conn_attempt; |
| 889 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 890 |
connection default; |
| 891 |
SET DEBUG_SYNC="RESET"; |
| 892 |
disconnect conn_attempt; |
| 893 |
disconnect conn_execute; |
| 894 |
# ------------------------------- |
| 895 |
# Case 1.5: FLUSH PRIVILEGES + CREATE ROLE |
| 896 |
connect conn_attempt, localhost, root,,,,; |
| 897 |
SET @@lock_wait_timeout=1; |
| 898 |
connect conn_execute, localhost, root,,,,; |
| 899 |
connection conn_attempt; |
| 900 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 901 |
CREATE ROLE r1; |
| 902 |
connection conn_execute; |
| 903 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 904 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 905 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 906 |
FLUSH PRIVILEGES; |
| 907 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 908 |
connection conn_attempt; |
| 909 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 910 |
connection default; |
| 911 |
SET DEBUG_SYNC="RESET"; |
| 912 |
disconnect conn_attempt; |
| 913 |
disconnect conn_execute; |
| 914 |
# ------------------------------- |
| 915 |
# Case 1.6: FLUSH PRIVILEGES + DROP ROLE |
| 916 |
connect conn_attempt, localhost, root,,,,; |
| 917 |
SET @@lock_wait_timeout=1; |
| 918 |
connect conn_execute, localhost, root,,,,; |
| 919 |
connection conn_attempt; |
| 920 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 921 |
DROP ROLE r1; |
| 922 |
connection conn_execute; |
| 923 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 924 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 925 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 926 |
FLUSH PRIVILEGES; |
| 927 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 928 |
connection conn_attempt; |
| 929 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 930 |
connection default; |
| 931 |
SET DEBUG_SYNC="RESET"; |
| 932 |
disconnect conn_attempt; |
| 933 |
disconnect conn_execute; |
| 934 |
# ------------------------------- |
| 935 |
# Case 1.7: FLUSH PRIVILEGES + GRANT privilege |
| 936 |
connect conn_attempt, localhost, root,,,,; |
| 937 |
SET @@lock_wait_timeout=1; |
| 938 |
connect conn_execute, localhost, root,,,,; |
| 939 |
connection conn_attempt; |
| 940 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 941 |
GRANT SELECT ON *.* TO u1; |
| 942 |
connection conn_execute; |
| 943 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 944 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 945 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 946 |
FLUSH PRIVILEGES; |
| 947 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 948 |
connection conn_attempt; |
| 949 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 950 |
connection default; |
| 951 |
SET DEBUG_SYNC="RESET"; |
| 952 |
disconnect conn_attempt; |
| 953 |
disconnect conn_execute; |
| 954 |
# ------------------------------- |
| 955 |
# Case 1.8: FLUSH PRIVILEGES + REVOKE privilege |
| 956 |
connect conn_attempt, localhost, root,,,,; |
| 957 |
SET @@lock_wait_timeout=1; |
| 958 |
connect conn_execute, localhost, root,,,,; |
| 959 |
connection conn_attempt; |
| 960 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 961 |
REVOKE SELECT ON *.* FROM u1; |
| 962 |
connection conn_execute; |
| 963 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 964 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 965 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 966 |
FLUSH PRIVILEGES; |
| 967 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 968 |
connection conn_attempt; |
| 969 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 970 |
connection default; |
| 971 |
SET DEBUG_SYNC="RESET"; |
| 972 |
disconnect conn_attempt; |
| 973 |
disconnect conn_execute; |
| 974 |
# ------------------------------- |
| 975 |
# Case 1.9: FLUSH PRIVILEGES + GRANT role |
| 976 |
connect conn_attempt, localhost, root,,,,; |
| 977 |
SET @@lock_wait_timeout=1; |
| 978 |
connect conn_execute, localhost, root,,,,; |
| 979 |
connection conn_attempt; |
| 980 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 981 |
GRANT r1 TO u1; |
| 982 |
connection conn_execute; |
| 983 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 984 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 985 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 986 |
FLUSH PRIVILEGES; |
| 987 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 988 |
connection conn_attempt; |
| 989 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 990 |
connection default; |
| 991 |
SET DEBUG_SYNC="RESET"; |
| 992 |
disconnect conn_attempt; |
| 993 |
disconnect conn_execute; |
| 994 |
# ------------------------------- |
| 995 |
# Case 1.10: FLUSH PRIVILEGES + REVOKE role |
| 996 |
connect conn_attempt, localhost, root,,,,; |
| 997 |
SET @@lock_wait_timeout=1; |
| 998 |
connect conn_execute, localhost, root,,,,; |
| 999 |
connection conn_attempt; |
| 1000 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 1001 |
REVOKE r1 FROM u1; |
| 1002 |
connection conn_execute; |
| 1003 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 1004 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 1005 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 1006 |
FLUSH PRIVILEGES; |
| 1007 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 1008 |
connection conn_attempt; |
| 1009 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 1010 |
connection default; |
| 1011 |
SET DEBUG_SYNC="RESET"; |
| 1012 |
disconnect conn_attempt; |
| 1013 |
disconnect conn_execute; |
| 1014 |
# ------------------------------- |
| 1015 |
# Case 1.11: FLUSH PRIVILEGES + SET PASSWORD |
| 1016 |
connect conn_attempt, localhost, root,,,,; |
| 1017 |
SET @@lock_wait_timeout=1; |
| 1018 |
connect conn_execute, localhost, root,,,,; |
| 1019 |
connection conn_attempt; |
| 1020 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 1021 |
SET PASSWORD FOR u1 = 'abcd'; |
| 1022 |
connection conn_execute; |
| 1023 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 1024 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 1025 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 1026 |
FLUSH PRIVILEGES; |
| 1027 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 1028 |
connection conn_attempt; |
| 1029 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 1030 |
connection default; |
| 1031 |
SET DEBUG_SYNC="RESET"; |
| 1032 |
disconnect conn_attempt; |
| 1033 |
disconnect conn_execute; |
| 1034 |
# ------------------------------- |
| 1035 |
# Case 1.12: FLUSH PRIVILEGES + SET DEFAULT ROLE |
| 1036 |
connect conn_attempt, localhost, root,,,,; |
| 1037 |
SET @@lock_wait_timeout=1; |
| 1038 |
connect conn_execute, localhost, root,,,,; |
| 1039 |
connection conn_attempt; |
| 1040 |
SET DEBUG_SYNC="wl14084_acl_ddl_before_mdl_acquisition SIGNAL flush_now WAIT_FOR proceed_with_acl_ddl"; |
| 1041 |
SET DEFAULT ROLE r1 to u1; |
| 1042 |
connection conn_execute; |
| 1043 |
SET DEBUG="+d, wl14084_trigger_acl_ddl_timeout"; |
| 1044 |
SET DEBUG_SYNC="now WAIT_FOR flush_now"; |
| 1045 |
SET DEBUG_SYNC="wl14084_flush_privileges_after_table_locks SIGNAL proceed_with_acl_ddl"; |
| 1046 |
FLUSH PRIVILEGES; |
| 1047 |
SET DEBUG="-d, wl14084_trigger_acl_ddl_timeout"; |
| 1048 |
connection conn_attempt; |
| 1049 |
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
| 1050 |
connection default; |
| 1051 |
SET DEBUG_SYNC="RESET"; |
| 1052 |
disconnect conn_attempt; |
| 1053 |
disconnect conn_execute; |
| 1054 |
# ----------------------------------------------------------------------- |
| 1055 |
# Cleanup |
| 1056 |
# Restore initial values |
| 1057 |
SET @@global.transaction_isolation = @global_start_value; |
| 1058 |
SELECT @@global.transaction_isolation; |
| 1059 |
@@global.transaction_isolation |
| 1060 |
REPEATABLE-READ |
| 1061 |
SET @@session.transaction_isolation = @session_start_value; |
| 1062 |
SELECT @@session.transaction_isolation; |
| 1063 |
@@session.transaction_isolation |
| 1064 |
REPEATABLE-READ |