mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
Merge branch '12.2' into 12.3
This commit is contained in:
@@ -3242,6 +3242,24 @@ static bool prepare_db_action(THD *thd, privilege_t want_access,
|
||||
}
|
||||
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
bool Sql_cmd_show_routine_code::execute(THD *thd)
|
||||
{
|
||||
sp_head *sp;
|
||||
if (m_handler->sp_cache_routine(thd, m_name, &sp))
|
||||
return true;
|
||||
if (!sp || sp->show_routine_code(thd))
|
||||
{
|
||||
/* We don't distinguish between errors for now */
|
||||
my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
|
||||
m_handler->type_str(), m_name->m_name.str);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // DBUG_OFF
|
||||
|
||||
|
||||
bool Sql_cmd_call::execute(THD *thd)
|
||||
{
|
||||
TABLE_LIST *all_tables= thd->lex->query_tables;
|
||||
@@ -5668,34 +5686,6 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt)
|
||||
goto error;
|
||||
break;
|
||||
}
|
||||
case SQLCOM_SHOW_PROC_CODE:
|
||||
case SQLCOM_SHOW_FUNC_CODE:
|
||||
case SQLCOM_SHOW_PACKAGE_BODY_CODE:
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
Database_qualified_name pkgname;
|
||||
sp_head *sp;
|
||||
const Sp_handler *sph= Sp_handler::handler(lex->sql_command);
|
||||
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
|
||||
if (sph->sp_resolve_package_routine(thd, thd->lex->sphead,
|
||||
lex->spname, &sph, &pkgname))
|
||||
return true;
|
||||
if (sph->sp_cache_routine(thd, lex->spname, &sp))
|
||||
goto error;
|
||||
if (!sp || sp->show_routine_code(thd))
|
||||
{
|
||||
/* We don't distinguish between errors for now */
|
||||
my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
|
||||
sph->type_str(), lex->spname->m_name.str);
|
||||
goto error;
|
||||
}
|
||||
break;
|
||||
#else
|
||||
my_error(ER_FEATURE_DISABLED, MYF(0),
|
||||
"SHOW PROCEDURE|FUNCTION CODE", "--with-debug");
|
||||
goto error;
|
||||
#endif // ifndef DBUG_OFF
|
||||
}
|
||||
case SQLCOM_SHOW_CREATE_TRIGGER:
|
||||
{
|
||||
if (check_ident_length(&lex->spname->m_name))
|
||||
@@ -5899,6 +5889,9 @@ mysql_execute_command(THD *thd, bool is_called_from_prepared_stmt)
|
||||
case SQLCOM_SIGNAL:
|
||||
case SQLCOM_RESIGNAL:
|
||||
case SQLCOM_GET_DIAGNOSTICS:
|
||||
case SQLCOM_SHOW_PROC_CODE:
|
||||
case SQLCOM_SHOW_FUNC_CODE:
|
||||
case SQLCOM_SHOW_PACKAGE_BODY_CODE:
|
||||
case SQLCOM_CALL:
|
||||
case SQLCOM_REVOKE:
|
||||
case SQLCOM_GRANT:
|
||||
@@ -8244,7 +8237,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
|
||||
lex->add_to_query_tables(ptr);
|
||||
|
||||
// Pure table aliases do not need to be locked:
|
||||
if (ptr->db.str && !(table_options & TL_OPTION_ALIAS))
|
||||
if (!ptr->is_pure_alias())
|
||||
{
|
||||
MDL_REQUEST_INIT(&ptr->mdl_request, MDL_key::TABLE, ptr->db.str,
|
||||
ptr->table_name.str, mdl_type, MDL_TRANSACTION);
|
||||
|
||||
Reference in New Issue
Block a user