diff --git a/sql/sql_show.cc b/sql/sql_show.cc index e05c7558f28..939db979804 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2933,7 +2933,7 @@ make_table_name_list(THD *thd, List *table_names, LEX *lex, */ if (res == FIND_FILES_DIR) { - if (lex->sql_command != SQLCOM_SELECT) + if (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) return 1; thd->clear_error(); return 2;