MCPcopy Create free account
hub / github.com/MariaDB/server / alter_routine

Function alter_routine

sql/sql_parse.cc:6446–6476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6444*/
6445
6446static bool __attribute__ ((noinline))
6447alter_routine(THD *thd, LEX *lex)
6448{
6449 int sp_result;
6450 const Sp_handler *sph= Sp_handler::handler(lex->sql_command);
6451 if (check_routine_access(thd, ALTER_PROC_ACL, &lex->spname->m_db,
6452 &lex->spname->m_name, sph, 0))
6453 return 1;
6454 /*
6455 Note that if you implement the capability of ALTER FUNCTION to
6456 alter the body of the function, this command should be made to
6457 follow the restrictions that log-bin-trust-function-creators=0
6458 already puts on CREATE FUNCTION.
6459 */
6460 /* Conditionally writes to binlog */
6461 sp_result= sph->sp_update_routine(thd, lex->spname, &lex->sp_chistics);
6462 switch (sp_result) {
6463 case SP_OK:
6464 my_ok(thd);
6465 return 0;
6466 case SP_KEY_NOT_FOUND:
6467 my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
6468 sph->type_str(), ErrConvDQName(lex->spname).ptr());
6469 return 1;
6470 default:
6471 my_error(ER_SP_CANT_ALTER, MYF(0),
6472 sph->type_str(), ErrConvDQName(lex->spname).ptr());
6473 return 1;
6474 }
6475 return 0; /* purecov: deadcode */
6476}
6477
6478
6479static bool __attribute__ ((noinline))

Callers 1

sql_parse.ccFile · 0.85

Calls 8

my_okFunction · 0.85
my_errorFunction · 0.85
ErrConvDQNameClass · 0.85
sp_update_routineMethod · 0.80
type_strMethod · 0.80
handlerClass · 0.70
check_routine_accessFunction · 0.70
ptrMethod · 0.45

Tested by

no test coverage detected