24#ifndef _SP_RCONTEXT_H_
25#define _SP_RCONTEXT_H_
90 Field *return_value_fld);
303 Item **case_expr_item_ptr);
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Element_type * array() const
Definition: sql_array.h:165
Stores status of the currently executed statement.
Definition: sql_error.h:269
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
Definition: sql_list.h:467
A typesafe replacement for DYNAMIC_ARRAY.
Definition: prealloced_array.h:71
Definition: sql_class.h:348
This class represents a query expression (one query block or several query blocks combined with UNION...
Definition: sql_lex.h:626
Definition: query_result.h:181
Server_side_cursor – an interface for materialized implementation of cursors.
Definition: sql_cursor.h:51
Representation of a SQL condition.
Definition: sql_error.h:58
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4571
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:111
An interceptor of cursor result set used to implement FETCH <cname> INTO <varlist>.
Definition: sp_rcontext.h:407
bool send_eof(THD *) override
Definition: sp_rcontext.h:416
uint field_count
Definition: sp_rcontext.h:409
List< sp_variable > * spvar_list
Definition: sp_rcontext.h:408
void set_spvar_list(List< sp_variable > *vars)
Definition: sp_rcontext.h:414
bool send_data(THD *thd, const mem_root_deque< Item * > &items) override
Definition: sp_rcontext.cc:537
uint get_field_count()
Definition: sp_rcontext.h:413
bool prepare(THD *thd, const mem_root_deque< Item * > &list, Query_expression *u) override
Perform preparation specific to the query expression or DML statement.
Definition: sp_rcontext.cc:527
Query_fetch_into_spvars()
Definition: sp_rcontext.h:412
Definition: sp_rcontext.h:401
sp_instr_cpush * m_push_instr
Definition: sp_rcontext.h:442
bool is_open() const
Definition: sp_rcontext.h:432
bool open(THD *thd)
Open an SP cursor.
Definition: sp_rcontext.cc:459
bool fetch(List< sp_variable > *vars)
Definition: sp_rcontext.cc:488
sp_instr_cpush * get_push_instr()
Definition: sp_rcontext.h:436
bool close()
Definition: sp_rcontext.cc:475
virtual ~sp_cursor()
Definition: sp_rcontext.h:426
sp_cursor(sp_instr_cpush *i)
Definition: sp_rcontext.h:423
Server_side_cursor * m_server_side_cursor
Definition: sp_rcontext.h:441
void destroy()
Definition: sp_rcontext.cc:486
Query_fetch_into_spvars m_result
Definition: sp_rcontext.h:439
This class represents 'DECLARE HANDLER' statement.
Definition: sp_pcontext.h:193
sp_head represents one instance of a stored program.
Definition: sp_head.h:383
sp_instr_cpush corresponds to DECLARE CURSOR, implements DECLARE CURSOR and OPEN.
Definition: sp_instr.h:1230
Base class for every SP-instruction.
Definition: sp_instr.h:105
The class represents parse-time context, which keeps track of declared variables/parameters,...
Definition: sp_pcontext.h:252
This class represents a call frame of SQL-handler (one invocation of a handler).
Definition: sp_rcontext.h:125
Handler_call_frame(const sp_handler *_handler, Sql_condition *_sql_condition, uint _continue_ip)
The constructor.
Definition: sp_rcontext.h:146
Diagnostics_area handler_da
The Diagnostics Area which will be pushed when the handler activates and popped when the handler comp...
Definition: sp_rcontext.h:139
uint continue_ip
Continue-instruction-pointer for CONTINUE-handlers.
Definition: sp_rcontext.h:135
Sql_condition * sql_condition
SQL-condition, triggered handler activation.
Definition: sp_rcontext.h:131
const sp_handler * handler
Handler definition (from parsing context).
Definition: sp_rcontext.h:128
This is an auxiliary class to store entering instruction pointer for an SQL-handler.
Definition: sp_rcontext.h:105
uint first_ip
Instruction pointer to the first instruction.
Definition: sp_rcontext.h:111
sp_handler_entry(const sp_handler *_handler, uint _first_ip)
The constructor.
Definition: sp_rcontext.h:117
const sp_handler * handler
Handler definition (from parsing context).
Definition: sp_rcontext.h:108
Definition: sp_rcontext.h:77
Query_arena * callers_arena
Arena used to (re) allocate items on.
Definition: sp_rcontext.h:158
uint get_last_handler_continue_ip() const
Definition: sp_rcontext.h:245
bool m_return_value_set
Indicates whether the return value (in m_return_value_fld) has been set during execution.
Definition: sp_rcontext.h:374
sp_cursor * get_cursor(uint i) const
Definition: sp_rcontext.h:272
void pop_handlers(sp_pcontext *current_scope)
Pop and delete given number of sp_handler_entry instances from the handler call stack.
Definition: sp_rcontext.cc:206
bool init_var_items(THD *thd)
Create and initialize an Item-adapter (Item_field) for each SP-var field.
Definition: sp_rcontext.cc:133
Item * get_case_expr(int case_expr_id) const
Definition: sp_rcontext.h:305
Bounds_checked_array< Item * > m_var_items
Collection of Item_field proxies, each of them points to the corresponding field in m_var_table.
Definition: sp_rcontext.h:366
bool init_var_table(THD *thd)
Create and initialize a table to store SP-variables.
Definition: sp_rcontext.cc:115
Field * get_return_field() const
Definition: sp_rcontext.h:182
~sp_rcontext()
Definition: sp_rcontext.cc:68
void pop_all_cursors()
Definition: sp_rcontext.h:270
Prealloced_array< sp_handler_entry *, 16 > m_visible_handlers
Stack of visible handlers.
Definition: sp_rcontext.h:380
void pop_handler_frame(THD *thd)
Pop the Handler_call_frame on top of the stack of active handlers.
Definition: sp_rcontext.cc:217
bool handle_sql_condition(THD *thd, uint *ip, const sp_instr *cur_spi)
Handle current SQL condition (if any).
Definition: sp_rcontext.cc:260
bool push_handler(sp_handler *handler, uint first_ip)
Create a new sp_handler_entry instance and push it to the handler call stack.
Definition: sp_rcontext.cc:187
sp_head * sp
The stored program for which this runtime context is created.
Definition: sp_rcontext.h:166
Bounds_checked_array< Item_cache * > m_case_expr_holders
Array of CASE expression holders.
Definition: sp_rcontext.h:392
void exit_handler(THD *thd, sp_pcontext *target_scope)
Handle return from SQL-handler.
Definition: sp_rcontext.cc:231
Bounds_checked_array< sp_cursor * > m_cstack
Stack of cursors.
Definition: sp_rcontext.h:386
void operator=(sp_rcontext &)
Handler_call_frame * current_handler_frame() const
Get the Handler_call_frame representing the currently active handler.
Definition: sp_rcontext.h:210
sp_rcontext(const sp_pcontext *root_parsing_ctx, Field *return_value_fld, bool in_sub_stmt)
Definition: sp_rcontext.cc:56
bool alloc_arrays(THD *thd)
Internal function to allocate memory for arrays.
Definition: sp_rcontext.cc:98
TABLE * m_var_table
Virtual table for storing SP-variables.
Definition: sp_rcontext.h:362
Item ** get_item_addr(uint var_idx) const
Definition: sp_rcontext.h:178
void pop_cursors(uint count)
Pop and delete given number of sp_cursor instance from the cursor stack.
Definition: sp_rcontext.cc:177
uint m_ccount
Current number of cursors in m_cstack.
Definition: sp_rcontext.h:389
Field * m_return_value_fld
This is a pointer to a field, which should contain return value for stored functions (only).
Definition: sp_rcontext.h:370
sp_rcontext(const sp_rcontext &)
bool set_case_expr(THD *thd, bool standalone, int case_expr_id, Item **case_expr_item_ptr)
Set CASE expression to the specified value.
Definition: sp_rcontext.cc:429
Item * get_item(uint var_idx) const
Definition: sp_rcontext.h:176
Item ** get_case_expr_addr(int case_expr_id) const
Definition: sp_rcontext.h:309
bool end_partial_result_set
Flag to end an open result set before start executing an SQL-handler (if one is found).
Definition: sp_rcontext.h:163
bool m_in_sub_stmt
Flag to tell if the runtime context is created for a sub-statement.
Definition: sp_rcontext.h:377
bool is_return_value_set() const
Definition: sp_rcontext.h:186
Item_cache * create_case_expr_holder(THD *thd, const Item *item) const
Create an instance of appropriate Item_cache class depending on the specified type in the callers are...
Definition: sp_rcontext.cc:415
bool push_cursor(sp_instr_cpush *i)
Create a new sp_cursor instance and push it to the cursor stack.
Definition: sp_rcontext.cc:158
bool set_variable(THD *thd, bool standalone, uint var_idx, Item **value)
Definition: sp_rcontext.h:172
Prealloced_array< Handler_call_frame *, 16 > m_activated_handlers
Stack of caught SQL conditions.
Definition: sp_rcontext.h:383
const sp_pcontext * m_root_parsing_ctx
Top-level (root) parsing context for this runtime context.
Definition: sp_rcontext.h:359
bool set_return_value(THD *thd, bool standalone, Item **return_value_item)
Definition: sp_rcontext.cc:149
static sp_rcontext * create(THD *thd, const sp_pcontext *root_parsing_ctx, Field *return_value_fld)
Construct and properly initialize a new sp_rcontext instance.
Definition: sp_rcontext.cc:82
This class represents a stored program variable or a parameter (also referenced as 'SP-variable').
Definition: sp_pcontext.h:49
Some integer typedefs for easier portability.
static int count
Definition: myisam_ftdump.cc:45
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2879
Field ** field
Definition: table.h:1449