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

Function emb_stmt_execute

libmysqld/lib_sql.cc:337–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337static int emb_stmt_execute(MYSQL_STMT *stmt)
338{
339 DBUG_ENTER("emb_stmt_execute");
340 uchar header[9];
341 THD *thd;
342 my_bool res;
343
344 if (stmt->param_count && !stmt->bind_param_done)
345 {
346 set_stmt_error(stmt, CR_PARAMS_NOT_BOUND, unknown_sqlstate, NULL);
347 DBUG_RETURN(1);
348 }
349
350 int4store(header, stmt->stmt_id);
351 header[4]= (uchar) stmt->flags;
352 header[5]= header[6]= header[7]= header[8]= 0; // safety
353 thd= (THD*)stmt->mysql->thd;
354 thd->client_param_count= stmt->param_count;
355 thd->client_params= stmt->params;
356
357 res= MY_TEST(emb_advanced_command(stmt->mysql, COM_STMT_EXECUTE, 0, 0,
358 header, sizeof(header), 1, stmt) ||
359 emb_read_query_result(stmt->mysql));
360 stmt->affected_rows= stmt->mysql->affected_rows;
361 stmt->insert_id= stmt->mysql->insert_id;
362 stmt->server_status= stmt->mysql->server_status;
363 if (res)
364 {
365 NET *net= &stmt->mysql->net;
366 set_stmt_errmsg(stmt, net);
367 DBUG_RETURN(1);
368 }
369 else if (stmt->mysql->status == MYSQL_STATUS_GET_RESULT)
370 stmt->mysql->status= MYSQL_STATUS_STATEMENT_GET_RESULT;
371 DBUG_RETURN(0);
372}
373
374int emb_read_binary_rows(MYSQL_STMT *stmt)
375{

Callers

nothing calls this directly

Calls 5

set_stmt_errorFunction · 0.85
int4storeFunction · 0.85
emb_advanced_commandFunction · 0.85
emb_read_query_resultFunction · 0.85
set_stmt_errmsgFunction · 0.85

Tested by

no test coverage detected