mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-13531 Add Database_qualified_name::copy()
This commit is contained in:
parent
4d50594dfc
commit
3f7f0c6a29
3 changed files with 14 additions and 8 deletions
|
@ -619,14 +619,7 @@ sp_head::init_sp_name(THD *thd, const sp_name *spname)
|
|||
DBUG_ASSERT(spname && spname->m_db.str && spname->m_db.length);
|
||||
|
||||
/* We have to copy strings to get them into the right memroot. */
|
||||
|
||||
m_db.length= spname->m_db.length;
|
||||
m_db.str= strmake_root(thd->mem_root, spname->m_db.str, spname->m_db.length);
|
||||
|
||||
m_name.length= spname->m_name.length;
|
||||
m_name.str= strmake_root(thd->mem_root, spname->m_name.str,
|
||||
spname->m_name.length);
|
||||
|
||||
Database_qualified_name::copy(mem_root, spname->m_db, spname->m_name);
|
||||
m_explicit_name= spname->m_explicit_name;
|
||||
|
||||
spname->make_qname(thd, &m_qname);
|
||||
|
|
|
@ -7505,4 +7505,15 @@ void AUTHID::parse(const char *str, size_t length)
|
|||
}
|
||||
|
||||
|
||||
void Database_qualified_name::copy(MEM_ROOT *mem_root,
|
||||
const LEX_CSTRING &db,
|
||||
const LEX_CSTRING &name)
|
||||
{
|
||||
m_db.length= db.length;
|
||||
m_db.str= strmake_root(mem_root, db.str, db.length);
|
||||
m_name.length= name.length;
|
||||
m_name.str= strmake_root(mem_root, name.str, name.length);
|
||||
}
|
||||
|
||||
|
||||
#endif /* !defined(MYSQL_CLIENT) */
|
||||
|
|
|
@ -5974,6 +5974,8 @@ public:
|
|||
(const uchar *) m_name.str, m_name.length,
|
||||
(const uchar *) other->m_name.str, other->m_name.length);
|
||||
}
|
||||
void copy(MEM_ROOT *mem_root, const LEX_CSTRING &db,
|
||||
const LEX_CSTRING &name);
|
||||
// Export db and name as a qualified name string: 'db.name'
|
||||
size_t make_qname(char *dst, size_t dstlen) const
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue