diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-03-06 17:36:30 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-03-07 18:48:15 +0400 |
commit | 5f34513c2a2dd5f8431cf03f6ba083c42f233dca (patch) | |
tree | a4314e0b0762a0401de604a5e23fa20d3a8551b8 /sql/sp_head.h | |
parent | a71d185a9a84c4c5f5d251e43aaaaf6efa0aa8d9 (diff) | |
download | mariadb-git-5f34513c2a2dd5f8431cf03f6ba083c42f233dca.tar.gz |
MDEV-18813 PROCEDURE and anonymous blocks silently ignore FETCH GROUP NEXT ROW
Part#2 (final): rewritting the code to pass the correct enum_sp_aggregate_type
to the sp_head constructor, so sp_head never changes its aggregation type
later on. The grammar has been simplified and defragmented.
This allowed to check aggregate specific instructions right after
a routine body has been scanned, by calling new LEX methods:
sp_body_finalize_{procedure|function|trigger|event}()
Moving some C++ code from *.yy to a few new helper methods in LEX.
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r-- | sql/sp_head.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h index cec9347d6f1..3365bf4883f 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -183,6 +183,11 @@ private: set_chistics() makes sure this. */ Sp_chistics m_chistics; + 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; + } public: sql_mode_t m_sql_mode; ///< For SHOW CREATE and execution bool m_explicit_name; /**< Prepend the db name? */ @@ -319,7 +324,8 @@ public: static void operator delete(void *ptr, size_t size) throw (); - sp_head(sp_package *parent, const Sp_handler *handler); + sp_head(sp_package *parent, const Sp_handler *handler, + enum_sp_aggregate_type); /// Initialize after we have reset mem_root void @@ -413,6 +419,9 @@ public: Item *val, LEX *lex); bool check_package_routine_end_name(const LEX_CSTRING &end_name) const; bool check_standalone_routine_end_name(const sp_name *end_name) const; + bool check_group_aggregate_instructions_function() const; + bool check_group_aggregate_instructions_forbid() const; + bool check_group_aggregate_instructions_require() const; private: /** Generate a code to set a single cursor parameter variable. @@ -730,11 +739,7 @@ public: const LEX_CSTRING &db, 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_c_chistics(const st_sp_chistics &chistics); void set_info(longlong created, longlong modified, const st_sp_chistics &chistics, sql_mode_t sql_mode); |