Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3f7f0c6a
Commit
3f7f0c6a
authored
Aug 15, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13531 Add Database_qualified_name::copy()
parent
4d50594d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
sql/sp_head.cc
sql/sp_head.cc
+1
-8
sql/sql_class.cc
sql/sql_class.cc
+11
-0
sql/sql_class.h
sql/sql_class.h
+2
-0
No files found.
sql/sp_head.cc
View file @
3f7f0c6a
...
@@ -619,14 +619,7 @@ sp_head::init_sp_name(THD *thd, const sp_name *spname)
...
@@ -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
);
DBUG_ASSERT
(
spname
&&
spname
->
m_db
.
str
&&
spname
->
m_db
.
length
);
/* We have to copy strings to get them into the right memroot. */
/* We have to copy strings to get them into the right memroot. */
Database_qualified_name
::
copy
(
mem_root
,
spname
->
m_db
,
spname
->
m_name
);
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
);
m_explicit_name
=
spname
->
m_explicit_name
;
m_explicit_name
=
spname
->
m_explicit_name
;
spname
->
make_qname
(
thd
,
&
m_qname
);
spname
->
make_qname
(
thd
,
&
m_qname
);
...
...
sql/sql_class.cc
View file @
3f7f0c6a
...
@@ -7505,4 +7505,15 @@ void AUTHID::parse(const char *str, size_t length)
...
@@ -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) */
#endif
/* !defined(MYSQL_CLIENT) */
sql/sql_class.h
View file @
3f7f0c6a
...
@@ -5974,6 +5974,8 @@ class Database_qualified_name
...
@@ -5974,6 +5974,8 @@ class Database_qualified_name
(
const
uchar
*
)
m_name
.
str
,
m_name
.
length
,
(
const
uchar
*
)
m_name
.
str
,
m_name
.
length
,
(
const
uchar
*
)
other
->
m_name
.
str
,
other
->
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'
// Export db and name as a qualified name string: 'db.name'
size_t
make_qname
(
char
*
dst
,
size_t
dstlen
)
const
size_t
make_qname
(
char
*
dst
,
size_t
dstlen
)
const
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment