mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Refactor parts of Item_func_sp into Item_sp
In preparation for implementing custom aggregate functions, refactor the common code between regular stored functions and aggregate stored functions. This includes: * initialising SP result field * executing a SP * access checks In addition, refactor sp_head::execute_function to take two extra parameters, a function rcontext and a Query_arena. These two paremeters were initially initialised and destroyed within sp_head::execute_function, but for aggregate stored functions we will require control over their lifetime. The owner of these objects now becomes Item_sp. Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
This commit is contained in:
committed by
Vicențiu Ciorbaru
parent
b213f57dc3
commit
c12d1ed48e
@@ -2732,26 +2732,12 @@ public:
|
||||
*
|
||||
*/
|
||||
|
||||
class sp_head;
|
||||
class sp_name;
|
||||
struct st_sp_security_context;
|
||||
|
||||
class Item_func_sp :public Item_func
|
||||
class Item_func_sp :public Item_func,
|
||||
public Item_sp
|
||||
{
|
||||
private:
|
||||
Name_resolution_context *context;
|
||||
sp_name *m_name;
|
||||
mutable sp_head *m_sp;
|
||||
TABLE *dummy_table;
|
||||
uchar result_buf[64];
|
||||
/*
|
||||
The result field of the concrete stored function.
|
||||
*/
|
||||
Field *sp_result_field;
|
||||
|
||||
bool execute();
|
||||
bool execute_impl(THD *thd);
|
||||
bool init_result_field(THD *thd, sp_head *sp);
|
||||
|
||||
protected:
|
||||
bool is_expensive_processor(void *arg)
|
||||
@@ -2843,7 +2829,6 @@ public:
|
||||
virtual bool change_context_processor(void *cntx)
|
||||
{ context= (Name_resolution_context *)cntx; return FALSE; }
|
||||
|
||||
bool sp_check_access(THD * thd);
|
||||
virtual enum Functype functype() const { return FUNC_SP; }
|
||||
|
||||
bool fix_fields(THD *thd, Item **ref);
|
||||
|
Reference in New Issue
Block a user