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

Function find_prepared_statement

sql/sql_prepare.cc:399–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397*/
398
399static Prepared_statement *
400find_prepared_statement(THD *thd, ulong id)
401{
402 /*
403 To strictly separate namespaces of SQL prepared statements and C API
404 prepared statements find() will return 0 if there is a named prepared
405 statement with such id.
406
407 LAST_STMT_ID is special value which mean last prepared statement ID
408 (it was made for COM_MULTI to allow prepare and execute a statement
409 in the same command but usage is not limited by COM_MULTI only).
410 */
411 Statement *stmt= ((id == LAST_STMT_ID) ?
412 thd->last_stmt :
413 thd->stmt_map.find(id));
414
415 if (stmt == 0 || stmt->type() != Query_arena::PREPARED_STATEMENT)
416 return NULL;
417
418 return (Prepared_statement *) stmt;
419}
420
421
422/**

Callers 5

mysqld_stmt_fetchFunction · 0.85
mysqld_stmt_resetFunction · 0.85
mysqld_stmt_closeFunction · 0.85
mysql_stmt_get_longdataFunction · 0.85

Calls 2

findMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected