mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +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:
@ -5404,12 +5404,11 @@ end_with_restore_list:
|
||||
}
|
||||
}
|
||||
if (first_table)
|
||||
{
|
||||
if (lex->type == TYPE_ENUM_PROCEDURE ||
|
||||
lex->type == TYPE_ENUM_FUNCTION)
|
||||
{
|
||||
const Sp_handler *sph= Sp_handler::handler((stored_procedure_type)
|
||||
lex->type);
|
||||
if (sph)
|
||||
{
|
||||
uint grants= lex->all_privileges
|
||||
? (PROC_ACLS & ~GRANT_ACL) | (lex->grant & GRANT_ACL)
|
||||
: lex->grant;
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user