MySQL 8.4.0
Source Code Documentation
sp_instr_cfetch Class Reference

The instruction corresponds to the FETCH statement. More...

#include <sp_instr.h>

Inheritance diagram for sp_instr_cfetch:

Public Member Functions

 sp_instr_cfetch (uint ip, sp_pcontext *ctx, int cursor_idx)
void print (const THD *thd, String *str) override
bool execute (THD *thd, uint *nextp) override
 Execute this instruction. More...
void add_to_varlist (sp_variable *var)
PSI_statement_infoget_psi_info () override
- Public Member Functions inherited from sp_instr
 sp_instr (uint ip, sp_pcontext *ctx)
 ~sp_instr () override
uint get_ip () const
virtual uint get_cont_dest () const
 Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction. More...
sp_pcontextget_parsing_ctx () const
virtual uint opt_mark (sp_head *, List< sp_instr > *leads)
 Mark this instruction as reachable during optimization and return the index to the next instruction. More...
virtual uint opt_shortcut_jump (sp_head *, sp_instr *start)
 Short-cut jumps to jumps during optimization. More...
virtual void opt_move (uint dst, List< sp_branch_instr > *ibp)
 Inform the instruction that it has been moved during optimization. More...
bool opt_is_marked () const
virtual SQL_I_List< Item_trigger_field > * get_instr_trig_field_list ()
- Public Member Functions inherited from sp_printable
virtual ~sp_printable ()=default

Static Public Attributes

static PSI_statement_info psi_info

Private Attributes

List< sp_variablem_varlist
 List of SP-variables to store fetched values. More...
int m_cursor_idx
 Used to identify the cursor in the sp_rcontext. More...

Additional Inherited Members

- Public Attributes inherited from sp_instr
Query_arena m_arena
- Protected Member Functions inherited from sp_instr
void clear_da (THD *thd) const
 Clear diagnostics area. More...
- Protected Attributes inherited from sp_instr
bool m_marked
 Show if this instruction is reachable within the SP (used by SP-optimizer). More...
uint m_ip
 Instruction pointer. More...
 Instruction parsing context. More...

Detailed Description

The instruction corresponds to the FETCH statement.

It just forwards the close-call to the appropriate sp_cursor object in the sp_rcontext.

Constructor & Destructor Documentation

◆ sp_instr_cfetch()

sp_instr_cfetch::sp_instr_cfetch ( uint  ip,
sp_pcontext ctx,
int  cursor_idx 

Member Function Documentation

◆ add_to_varlist()

void sp_instr_cfetch::add_to_varlist ( sp_variable var)

◆ execute()

bool sp_instr_cfetch::execute ( THD thd,
uint *  nextp 

Execute this instruction.

thdThread context
[out]nextpindex of the next instruction to execute. (For most instructions this will be the instruction following this one). Note that this parameter is undefined in case of errors, use get_cont_dest() to find the continuation instruction for CONTINUE error handlers.
Error status.

Implements sp_instr.

◆ get_psi_info()

PSI_statement_info * sp_instr_cfetch::get_psi_info ( )

Implements sp_instr.

◆ print()

void sp_instr_cfetch::print ( const THD thd,
String str 

Implements sp_printable.

Member Data Documentation

◆ m_cursor_idx

int sp_instr_cfetch::m_cursor_idx

Used to identify the cursor in the sp_rcontext.

◆ m_varlist

List<sp_variable> sp_instr_cfetch::m_varlist

List of SP-variables to store fetched values.

◆ psi_info

PSI_statement_info sp_instr_cfetch::psi_info
Initial value:
= {
"Stored Program: FETCH cursor"}
Instrument is disabled by default.
Definition: psi_bits.h:146
Instrument is not timed by default.
Definition: psi_bits.h:151

The documentation for this class was generated from the following files: