| 2183 | */ |
| 2184 | |
| 2185 | static int mysql_test_handler_read(Prepared_statement *stmt, |
| 2186 | TABLE_LIST *tables) |
| 2187 | { |
| 2188 | THD *thd= stmt->thd; |
| 2189 | LEX *lex= stmt->lex; |
| 2190 | SQL_HANDLER *ha_table; |
| 2191 | DBUG_ENTER("mysql_test_handler_read"); |
| 2192 | |
| 2193 | lex->first_select_lex()->context.resolve_in_select_list= TRUE; |
| 2194 | |
| 2195 | /* |
| 2196 | We don't have to test for permissions as this is already done during |
| 2197 | HANDLER OPEN |
| 2198 | */ |
| 2199 | if (!(ha_table= mysql_ha_read_prepare(thd, tables, lex->ha_read_mode, |
| 2200 | lex->ident.str, |
| 2201 | lex->insert_list, |
| 2202 | lex->ha_rkey_mode, |
| 2203 | lex->first_select_lex()->where))) |
| 2204 | DBUG_RETURN(1); |
| 2205 | |
| 2206 | if (!stmt->is_sql_prepare()) |
| 2207 | { |
| 2208 | if (!lex->result && !(lex->result= new (stmt->mem_root) select_send(thd))) |
| 2209 | DBUG_RETURN(1); |
| 2210 | |
| 2211 | if (send_prep_stmt(stmt, ha_table->fields.elements) || |
| 2212 | lex->result->send_result_set_metadata(ha_table->fields, Protocol::SEND_EOF) || |
| 2213 | thd->protocol->flush()) |
| 2214 | DBUG_RETURN(1); |
| 2215 | DBUG_RETURN(2); |
| 2216 | } |
| 2217 | DBUG_RETURN(0); |
| 2218 | } |
| 2219 | |
| 2220 | |
| 2221 | /** |
no test coverage detected