| 1654 | |
| 1655 | |
| 1656 | bool Sql_cmd_analyze_table::execute(THD *thd) |
| 1657 | { |
| 1658 | LEX *m_lex= thd->lex; |
| 1659 | TABLE_LIST *first_table= m_lex->first_select_lex()->table_list.first; |
| 1660 | bool res= TRUE; |
| 1661 | thr_lock_type lock_type = TL_READ_NO_INSERT; |
| 1662 | DBUG_ENTER("Sql_cmd_analyze_table::execute"); |
| 1663 | |
| 1664 | if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table, |
| 1665 | FALSE, UINT_MAX, FALSE)) |
| 1666 | goto error; |
| 1667 | if (thd->has_read_only_protection()) |
| 1668 | goto error; |
| 1669 | |
| 1670 | WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table); |
| 1671 | res= mysql_admin_table(thd, first_table, &m_lex->check_opt, |
| 1672 | &msg_analyze, lock_type, 1, 0, 0, 0, |
| 1673 | &handler::ha_analyze, 0, true); |
| 1674 | m_lex->first_select_lex()->table_list.first= first_table; |
| 1675 | m_lex->query_tables= first_table; |
| 1676 | |
| 1677 | #ifdef WITH_WSREP |
| 1678 | wsrep_error_label: |
| 1679 | #endif /* WITH_WSREP */ |
| 1680 | error: |
| 1681 | DBUG_RETURN(res); |
| 1682 | } |
| 1683 | |
| 1684 | |
| 1685 | bool Sql_cmd_check_table::execute(THD *thd) |
nothing calls this directly
no test coverage detected