SHOW EXPLAIN testing: wait for, and serve n_calls APC requests. */
| 381 | SHOW EXPLAIN testing: wait for, and serve n_calls APC requests. |
| 382 | */ |
| 383 | void dbug_serve_apcs(THD *thd, int n_calls) |
| 384 | { |
| 385 | const char *save_proc_info= thd->proc_info; |
| 386 | |
| 387 | /* Busy-wait for n_calls APC requests to arrive and be processed */ |
| 388 | int n_apcs= thd->apc_target.n_calls_processed + n_calls; |
| 389 | while (thd->apc_target.n_calls_processed < n_apcs) |
| 390 | { |
| 391 | /* This is so that mysqltest knows we're ready to serve requests: */ |
| 392 | thd_proc_info(thd, "show_explain_trap"); |
| 393 | my_sleep(30000); |
| 394 | thd_proc_info(thd, save_proc_info); |
| 395 | if (unlikely(thd->check_killed(1))) |
| 396 | break; |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | |
| 401 | /* |
no test coverage detected