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:
@ -5405,11 +5405,10 @@ end_with_restore_list:
|
|||||||
}
|
}
|
||||||
if (first_table)
|
if (first_table)
|
||||||
{
|
{
|
||||||
if (lex->type == TYPE_ENUM_PROCEDURE ||
|
const Sp_handler *sph= Sp_handler::handler((stored_procedure_type)
|
||||||
lex->type == TYPE_ENUM_FUNCTION)
|
lex->type);
|
||||||
|
if (sph)
|
||||||
{
|
{
|
||||||
const Sp_handler *sph= Sp_handler::handler((stored_procedure_type)
|
|
||||||
lex->type);
|
|
||||||
uint grants= lex->all_privileges
|
uint grants= lex->all_privileges
|
||||||
? (PROC_ACLS & ~GRANT_ACL) | (lex->grant & GRANT_ACL)
|
? (PROC_ACLS & ~GRANT_ACL) | (lex->grant & GRANT_ACL)
|
||||||
: lex->grant;
|
: 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))
|
check_some_routine_access(thd, db.str, name.str, sph))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ((lex->sql_command == SQLCOM_SHOW_STATUS_PROC &&
|
if (sph == Sp_handler::handler(lex->sql_command)||
|
||||||
sph->type() == TYPE_ENUM_PROCEDURE) ||
|
|
||||||
(lex->sql_command == SQLCOM_SHOW_STATUS_FUNC &&
|
|
||||||
sph->type() == TYPE_ENUM_FUNCTION) ||
|
|
||||||
(sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0)
|
(sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0)
|
||||||
{
|
{
|
||||||
restore_record(table, s->default_values);
|
restore_record(table, s->default_values);
|
||||||
|
Reference in New Issue
Block a user