MySQL 8.0.40
Source Code Documentation
sp_instr_error Class Reference

sp_instr_error just throws an SQL-condition if the execution flow comes to it. More...

#include <sp_instr.h>

Inheritance diagram for sp_instr_error:
[legend]

Public Member Functions

 sp_instr_error (uint ip, sp_pcontext *ctx, int errcode)
 
void print (const THD *thd, String *str) override
 
bool execute (THD *, uint *nextp) override
 Execute this instruction. More...
 
uint opt_mark (sp_head *, List< sp_instr > *) override
 Mark this instruction as reachable during optimization and return the index to the next instruction. More...
 
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_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

int m_errcode
 The error code, which should be raised by this instruction. 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...
 
sp_pcontextm_parsing_ctx
 Instruction parsing context. More...
 

Detailed Description

sp_instr_error just throws an SQL-condition if the execution flow comes to it.

It's used in the CASE implementation to perform runtime-check that the CASE-expression is handled by some WHEN/ELSE clause.

Constructor & Destructor Documentation

◆ sp_instr_error()

sp_instr_error::sp_instr_error ( uint  ip,
sp_pcontext ctx,
int  errcode 
)
inline

Member Function Documentation

◆ execute()

bool sp_instr_error::execute ( THD thd,
uint nextp 
)
inlineoverridevirtual

Execute this instruction.

Parameters
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.
Returns
Error status.

Implements sp_instr.

◆ get_psi_info()

PSI_statement_info * sp_instr_error::get_psi_info ( )
inlineoverridevirtual

Implements sp_instr.

◆ opt_mark()

uint sp_instr_error::opt_mark ( sp_head ,
List< sp_instr > *  leads 
)
inlineoverridevirtual

Mark this instruction as reachable during optimization and return the index to the next instruction.

Jump instruction will add their destination to the leads list.

Reimplemented from sp_instr.

◆ print()

void sp_instr_error::print ( const THD thd,
String str 
)
overridevirtual

Implements sp_printable.

Member Data Documentation

◆ m_errcode

int sp_instr_error::m_errcode
private

The error code, which should be raised by this instruction.

◆ psi_info

PSI_statement_info sp_instr_error::psi_info
static
Initial value:
= {
"Stored Program: CASE WHEN not found microcode instruction"}
#define PSI_FLAG_DISABLED
Instrument is disabled by default.
Definition: psi_bits.h:146
#define PSI_FLAG_UNTIMED
Instrument is not timed by default.
Definition: psi_bits.h:151

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