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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
42d39e6e
Commit
42d39e6e
authored
Oct 19, 2011
by
Tatjana Azundris Nuernberg
Browse files
Options
Browse Files
Download
Plain Diff
Bug12589870 post merge fixes - manual merge
parents
d6d11c8e
8444b6a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
sql/sp_head.cc
sql/sp_head.cc
+1
-1
sql/sql_cache.cc
sql/sql_cache.cc
+3
-2
sql/sql_parse.cc
sql/sql_parse.cc
+4
-2
No files found.
sql/sp_head.cc
View file @
42d39e6e
...
...
@@ -1053,7 +1053,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
{
memcpy
(
pbuf
,
qbuf
.
ptr
(),
qbuf
.
length
());
pbuf
[
qbuf
.
length
()]
=
0
;
*
(
size_t
*
)(
pbuf
+
qbuf
.
length
()
+
1
)
=
thd
->
db_length
;
memcpy
(
pbuf
+
qbuf
.
length
()
+
1
,
(
char
*
)
&
thd
->
db_length
,
sizeof
(
size_t
))
;
}
else
DBUG_RETURN
(
TRUE
);
...
...
sql/sql_cache.cc
View file @
42d39e6e
...
...
@@ -1515,8 +1515,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
sure the new current database has a name with the same length
as the previous one.
*/
size_t
*
db_len
=
(
size_t
*
)
(
sql
+
query_length
+
1
);
if
(
thd
->
db_length
!=
*
db_len
)
size_t
db_len
;
memcpy
((
char
*
)
&
db_len
,
(
sql
+
query_length
+
1
),
sizeof
(
size_t
));
if
(
thd
->
db_length
!=
db_len
)
{
/*
We should probably reallocate the buffer in this case,
...
...
sql/sql_parse.cc
View file @
42d39e6e
...
...
@@ -536,6 +536,8 @@ static void handle_bootstrap_impl(THD *thd)
query
=
(
char
*
)
thd
->
memdup_w_gap
(
buff
,
length
+
1
,
thd
->
db_length
+
1
+
QUERY_CACHE_FLAGS_SIZE
);
size_t
db_len
=
0
;
memcpy
(
query
+
length
+
1
,
(
char
*
)
&
db_len
,
sizeof
(
size_t
));
thd
->
set_query_and_id
(
query
,
length
,
thd
->
charset
(),
next_query_id
());
DBUG_PRINT
(
"query"
,(
"%-.4096s"
,
thd
->
query
()));
#if defined(ENABLED_PROFILING)
...
...
@@ -1658,8 +1660,8 @@ bool alloc_query(THD *thd, const char *packet, uint packet_length)
also store this length, in case current database is changed during
execution. We might need to reallocate the 'query' buffer
*/
size_t
*
len
=
(
size_t
*
)
(
query
+
packet_length
+
1
);
*
len
=
thd
->
db_length
;
char
*
len_pos
=
(
query
+
packet_length
+
1
);
memcpy
(
len_pos
,
(
char
*
)
&
thd
->
db_length
,
sizeof
(
size_t
))
;
thd
->
set_query
(
query
,
packet_length
);
...
...
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