1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

Don't implicitly search in CURRENT_SCHEMA

the intention was not to, but some code paths weren't fixed yet
This commit is contained in:
Sergei Golubchik
2026-01-15 21:38:31 +01:00
parent 13c5cab5cf
commit be67aff19b
10 changed files with 52 additions and 28 deletions

View File

@@ -130,17 +130,21 @@ bool Sql_path::resolve(THD *thd, sp_head *caller, sp_name *name,
}
}
// If PATH contains only CURRENT_SCHEMA (default), skip PATH resolution
// to avoid extra table operations that affect performance
if (!name->m_explicit_name && m_count == 1 && is_cur_schema(0))
return false;
bool resolved= false;
for (size_t i= 0; i < m_count; i++)
{
Lex_ident_db schema;
if (is_cur_schema(i))
{
// If PATH contains only CURRENT_SCHEMA (default), skip PATH resolution
// to avoid extra table operations that affect performance
if (m_count== 1 && !name->m_explicit_name)
{
if (!name->m_db.str && thd->db.str)
name->m_db= thd->copy_db_normalized();
return false;
}
schema= resolve_current_schema(thd, caller, i);
if (!schema.str)
continue; // CURRENT_SCHEMA resolution failed, skip this entry