| 6256 | */ |
| 6257 | |
| 6258 | static bool __attribute__ ((noinline)) |
| 6259 | execute_show_status(THD *thd, TABLE_LIST *all_tables) |
| 6260 | { |
| 6261 | bool res; |
| 6262 | system_status_var old_status_var= thd->status_var; |
| 6263 | thd->initial_status_var= &old_status_var; |
| 6264 | WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); |
| 6265 | if (!(res= check_table_access(thd, SELECT_ACL, all_tables, FALSE, |
| 6266 | UINT_MAX, FALSE))) |
| 6267 | res= execute_sqlcom_select(thd, all_tables); |
| 6268 | |
| 6269 | thd->initial_status_var= NULL; |
| 6270 | /* Don't log SHOW STATUS commands to slow query log */ |
| 6271 | thd->server_status&= ~(SERVER_QUERY_NO_INDEX_USED | |
| 6272 | SERVER_QUERY_NO_GOOD_INDEX_USED); |
| 6273 | /* |
| 6274 | restore status variables, as we don't want 'show status' to cause |
| 6275 | changes |
| 6276 | */ |
| 6277 | mysql_mutex_lock(&LOCK_status); |
| 6278 | add_diff_to_status(&global_status_var, &thd->status_var, |
| 6279 | &old_status_var); |
| 6280 | memcpy(&thd->status_var, &old_status_var, last_restored_status_var); |
| 6281 | mysql_mutex_unlock(&LOCK_status); |
| 6282 | thd->initial_status_var= NULL; |
| 6283 | return res; |
| 6284 | #ifdef WITH_WSREP |
| 6285 | wsrep_error_label: /* see WSREP_SYNC_WAIT() macro above */ |
| 6286 | thd->initial_status_var= NULL; |
| 6287 | return true; |
| 6288 | #endif /* WITH_WSREP */ |
| 6289 | } |
| 6290 | |
| 6291 | |
| 6292 | /* |
no test coverage detected