MCPcopy Create free account
hub / github.com/MariaDB/server / mysql_test_handler_read

Function mysql_test_handler_read

sql/sql_prepare.cc:2185–2218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2183*/
2184
2185static 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/**

Callers 1

check_prepared_statementFunction · 0.85

Calls 6

mysql_ha_read_prepareFunction · 0.85
send_prep_stmtFunction · 0.85
first_select_lexMethod · 0.80
is_sql_prepareMethod · 0.80
flushMethod · 0.45

Tested by

no test coverage detected