summaryrefslogtreecommitdiff
path: root/sql/sp_head.h
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2017-12-11 15:43:41 +0300
committerAleksey Midenkov <midenok@gmail.com>2017-12-11 15:43:41 +0300
commit79dd77e6aebc861b82e4895941224bbbad441650 (patch)
tree8c22b54de7964a89358415b5380c2bc734f162a1 /sql/sp_head.h
parentb7cd18289639b30fafc7f623c1187e442608727c (diff)
parent8f581e8bf1d400be08995b1cf8c11e3b0f7ae283 (diff)
downloadmariadb-git-79dd77e6aebc861b82e4895941224bbbad441650.tar.gz
System Versioning 1.0 pre3
Merge branch '10.3' into trunk
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r--sql/sp_head.h44
1 files changed, 40 insertions, 4 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 815a68c922f..04b67941226 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -164,7 +164,10 @@ public:
/*
Marks routines that have column type references: DECLARE a t1.a%TYPE;
*/
- HAS_COLUMN_TYPE_REFS= 8192
+ HAS_COLUMN_TYPE_REFS= 8192,
+ /* Set if has FETCH GROUP NEXT ROW instr. Used to ensure that only
+ functions with AGGREGATE keyword use the instr. */
+ HAS_AGGREGATE_INSTR= 16384
};
const Sp_handler *m_handler;
@@ -197,6 +200,7 @@ public:
enum_sp_suid_behaviour suid() const { return m_chistics.suid; }
bool detistic() const { return m_chistics.detistic; }
enum_sp_data_access daccess() const { return m_chistics.daccess; }
+ enum_sp_aggregate_type agg_type() const { return m_chistics.agg_type; }
/**
Is this routine being executed?
*/
@@ -343,7 +347,8 @@ public:
GRANT_INFO *grant_info);
bool
- execute_function(THD *thd, Item **args, uint argcount, Field *return_fld);
+ execute_function(THD *thd, Item **args, uint argcount, Field *return_fld,
+ sp_rcontext **nctx, Query_arena *call_arena);
bool
execute_procedure(THD *thd, List<Item> *args);
@@ -719,6 +724,10 @@ public:
const LEX_CSTRING &table);
void set_chistics(const st_sp_chistics &chistics);
+ inline void set_chistics_agg_type(enum enum_sp_aggregate_type type)
+ {
+ m_chistics.agg_type= type;
+ }
void set_info(longlong created, longlong modified,
const st_sp_chistics &chistics, sql_mode_t sql_mode);
@@ -1795,8 +1804,8 @@ class sp_instr_cfetch : public sp_instr
public:
- sp_instr_cfetch(uint ip, sp_pcontext *ctx, uint c)
- : sp_instr(ip, ctx), m_cursor(c)
+ sp_instr_cfetch(uint ip, sp_pcontext *ctx, uint c, bool error_on_no_data)
+ : sp_instr(ip, ctx), m_cursor(c), m_error_on_no_data(error_on_no_data)
{
m_varlist.empty();
}
@@ -1817,9 +1826,36 @@ private:
uint m_cursor;
List<sp_variable> m_varlist;
+ bool m_error_on_no_data;
}; // class sp_instr_cfetch : public sp_instr
+/*
+This class is created for the special fetch instruction
+FETCH GROUP NEXT ROW, used in the user-defined aggregate
+functions
+*/
+
+class sp_instr_agg_cfetch : public sp_instr
+{
+ sp_instr_agg_cfetch(const sp_instr_cfetch &); /**< Prevent use of these */
+ void operator=(sp_instr_cfetch &);
+
+public:
+
+ sp_instr_agg_cfetch(uint ip, sp_pcontext *ctx)
+ : sp_instr(ip, ctx){}
+
+ virtual ~sp_instr_agg_cfetch()
+ {}
+
+ virtual int execute(THD *thd, uint *nextp);
+
+ virtual void print(String *str){};
+}; // class sp_instr_agg_cfetch : public sp_instr
+
+
+
class sp_instr_error : public sp_instr
{