#include"sql_plugin.h" #include"sql_class.h"// class THD #include"sp_head.h"// class sp_name #include"lex_ident.h" #include"sql_db.h" #include"sql_path.h"
if (pkg_routine_hndlr)
{
*sph= pkg_routine_hndlr; returnfalse;
}
}
}
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(); returnfalse;
}
schema= resolve_current_schema(thd, caller, i); if (!schema.str) continue; // CURRENT_SCHEMA resolution failed, skip this entry /* recursive calls */ if (caller && name->eq_routine_name(caller)) returnfalse;
} else
schema= m_schemas[i];
// Validate if (Lex_ident_db::check_name_with_error(dbn)) goto err;
if (!is_quoted && cur_schema.streq(dbn))
{ for (size_t i = 0; i < m_count; i++) // Check for duplicates if (is_cur_schema(i)) goto err;
m_schemas[m_count].length= 0;
} else
{ for (size_t i = 0; i < m_count; i++) if (!is_cur_schema(i) && dbn.streq(m_schemas[i])) goto err;
}
m_count++; returnfalse;
err: returntrue;
}
void Sql_path::set(const Sql_path &rhs)
{
free();
if ((m_count= rhs.m_count))
{ auto rbuf= rhs.m_schemas[0].str; auto rend= rhs.m_schemas[m_count-1].str + rhs.m_schemas[m_count-1].length; auto buf= (constchar*)my_memdup(key_memory_Sys_var_charptr_value, rbuf,
rend - rbuf + 1, MYF(MY_WME)); for (size_t i= 0; i < rhs.m_count; i++)
m_schemas[i]= { rhs.m_schemas[i].str - rbuf + buf, rhs.m_schemas[i].length };
}
}
free(); while (curr < end)
{ auto len = cs->charlen(curr, end);
DBUG_ASSERT(len > 0); // We have a well-formed utf8mb3
switch (state)
{ case START: if (*curr == ',' || my_isspace(cs, (uchar) *curr))
curr++; else
{ if (m_count >= array_elements(m_schemas))
{
my_error(ER_VALUE_TOO_LONG, MYF(0), "PATH"); goto err;
}
m_schemas[m_count].str= to; if (*curr == '`' || (*curr == '"' && ansi_quotes))
state= (tokenize_state) *curr++; elseif (*curr == '"') goto err_bad_val; else
{
state= UNQUOTED_TOKEN; while (len--)
*to++= *curr++;
}
} break; case QUOTED_TOKEN_BACKTICK: case QUOTED_TOKEN_DOUBLE: if (*curr == state)
{
curr++; if (curr >= end || *curr != state)
{
state= END; if (add_schema(&to, true)) goto err_bad_val; break;
}
} while (len--)
*to++= *curr++; break; case UNQUOTED_TOKEN: if (*curr == ',' || my_isspace(cs, (uchar) *curr))
{
state= *curr++ == ',' ? START : END; if (add_schema(&to, false)) goto err_bad_val; break;
} elseif (*curr == '`' || *curr == '"') goto err_bad_val; else while (len--)
*to++= *curr++; break; case END: if (*curr == ',')
state= START; elseif (!my_isspace(cs, (uchar) *curr)) goto err_bad_val;
curr++; break;
}
}
switch (state)
{ case START: case END: break; case QUOTED_TOKEN_BACKTICK: case QUOTED_TOKEN_DOUBLE: goto err_bad_val; case UNQUOTED_TOKEN: if (add_schema(&to, false)) goto err_bad_val; break;
} if (!m_count)
my_free(buf); returnfalse;
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.2Bemerkung:
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.