diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-03-02 11:31:27 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-03-02 11:31:27 +0400 |
commit | 88a9d4ab42d370dedc9b1d90c75bee53fd8fb8c0 (patch) | |
tree | 47948f0c01e1cc409e44f7aa16997d3c203493d5 /sql/sp.h | |
parent | 4025cfaec038594bfc97bea48aa2cfe139930cc2 (diff) | |
download | mariadb-git-88a9d4ab42d370dedc9b1d90c75bee53fd8fb8c0.tar.gz |
MDEV-15444 Querying I_S.PARAMETERS can crash with a corrupted mysql.proc
Diffstat (limited to 'sql/sp.h')
-rw-r--r-- | sql/sp.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -122,6 +122,16 @@ public: static const Sp_handler *handler(enum enum_sql_command cmd); static const Sp_handler *handler(stored_procedure_type type); static const Sp_handler *handler(MDL_key::enum_mdl_namespace ns); + /* + Return a handler only those SP objects that store + definitions in the mysql.proc system table + */ + static const Sp_handler *handler_mysql_proc(stored_procedure_type type) + { + const Sp_handler *sph= handler(type); + return sph ? sph->sp_handler_mysql_proc() : NULL; + } + static bool eq_routine_name(const LEX_CSTRING &name1, const LEX_CSTRING &name2) { @@ -153,6 +163,7 @@ public: return m_empty_body; } virtual MDL_key::enum_mdl_namespace get_mdl_type() const= 0; + virtual const Sp_handler *sp_handler_mysql_proc() const { return this; } virtual sp_cache **get_cache(THD *) const { return NULL; } #ifndef NO_EMBEDDED_ACCESS_CHECKS virtual HASH *get_priv_hash() const { return NULL; } @@ -434,6 +445,7 @@ public: DBUG_ASSERT(0); return MDL_key::TRIGGER; } + const Sp_handler *sp_handler_mysql_proc() const { return NULL; } }; |