| 35043 | */ |
| 35044 | |
| 35045 | bool Sql_cmd_dml::execute_inner(THD *thd) |
| 35046 | { |
| 35047 | SELECT_LEX_UNIT *unit = &lex->unit; |
| 35048 | SELECT_LEX *select_lex= unit->first_select(); |
| 35049 | JOIN *join= select_lex->join; |
| 35050 | |
| 35051 | // look for select_handler provided by engines |
| 35052 | select_lex->pushdown_select= find_single_select_handler(thd, select_lex); |
| 35053 | |
| 35054 | if (join->optimize()) |
| 35055 | goto err; |
| 35056 | |
| 35057 | if (thd->lex->describe & DESCRIBE_EXTENDED) |
| 35058 | { |
| 35059 | join->conds_history= join->conds; |
| 35060 | join->having_history= (join->having?join->having:join->tmp_having); |
| 35061 | } |
| 35062 | |
| 35063 | if (unlikely(thd->is_error())) |
| 35064 | goto err; |
| 35065 | |
| 35066 | if (join->exec()) |
| 35067 | goto err; |
| 35068 | |
| 35069 | if (thd->lex->describe & DESCRIBE_EXTENDED) |
| 35070 | { |
| 35071 | select_lex->where= join->conds_history; |
| 35072 | select_lex->having= join->having_history; |
| 35073 | } |
| 35074 | |
| 35075 | err: |
| 35076 | return join->error; |
| 35077 | } |
| 35078 | |
| 35079 | |
| 35080 | /** |
nothing calls this directly
no test coverage detected