summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-11-23 10:38:04 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-12-04 13:22:29 +0200
commitc12d1ed48ee0708b85fbdbe149d15f6fea2c1e31 (patch)
treeedc7283e665d576945f85267e70c45ae22fd27cb /sql/item_func.h
parentb213f57dc3f9da93ce444805f7581d982bde9f75 (diff)
downloadmariadb-git-c12d1ed48ee0708b85fbdbe149d15f6fea2c1e31.tar.gz
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>
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index ed6f800fd17..07c6b5bb8d3 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -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);