The code in sp.sp, sp_head.cc, sql_acl.cc, sql_lex.cc, sql_show.cc, sql_yacc*.yy uses a lot of conditions on the routine type, e.g.
Oracle style packages (
MDEV-10591) will introduce new SP object types: TYPE_ENUM_PACKAGE_SPEC and TYPE_ENUM_PACKAGE_BODY.
The conditional type-related code will get more complex.
Under terms of this code we'll create a new class Sp_handler with a number of virtual methods, to simplify handling of SP objects of different types and therefore simplify adding packages.
We'll add the be the top level abstract class Sp_handler with this approximate set of virtual methods:
and will add instantiable sub-classes for certain SP object types:
MDEV-10591 will later add Sp_handler_package_spec and Sp_handler_package_body sub-classes.