1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

A cleanup for MDEV-13415 Wrap the code in sp.cc into a class Sp_handler

Fixing mysql_execute_command() and store_schema_proc() not to use
stored object type codes TYPE_ENUM_PROCEDURE and TYPE_ENUM_FUNCTION.
Using pointers to Sp_handler instead, to make the code symmetric across
existing (function,procedure) and future (e.g package) SP object types.
This commit is contained in:
Alexander Barkov
2017-10-20 18:44:28 +04:00
parent 211f9eea60
commit edfdf0d0a3
2 changed files with 4 additions and 8 deletions

View File

@ -6031,10 +6031,7 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
check_some_routine_access(thd, db.str, name.str, sph))
return 0;
if ((lex->sql_command == SQLCOM_SHOW_STATUS_PROC &&
sph->type() == TYPE_ENUM_PROCEDURE) ||
(lex->sql_command == SQLCOM_SHOW_STATUS_FUNC &&
sph->type() == TYPE_ENUM_FUNCTION) ||
if (sph == Sp_handler::handler(lex->sql_command)||
(sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0)
{
restore_record(table, s->default_values);