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
b4ffce10
Commit
b4ffce10
authored
May 18, 2012
by
Rohit Kalhans
Browse files
Options
Browse Files
Download
Plain Diff
upmerge from mysql-5.1 -> mysql-5.5.
parents
0581d1c4
781137c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
16 deletions
+34
-16
sql/log_event.cc
sql/log_event.cc
+34
-16
No files found.
sql/log_event.cc
View file @
b4ffce10
...
...
@@ -2909,24 +2909,34 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
pos
=
(
const
uchar
*
)
end
;
// Break loop
}
}
/**
Layout for the data buffer is as follows
+--------+-----------+------+------+---------+----+-------+
| catlog | time_zone | user | host | db name | \0 | Query |
+--------+-----------+------+------+---------+----+-------+
To support the query cache we append the following buffer to the above
+-------+----------------------------------------+-------+
|db len | uninitiatlized space of size of db len | FLAGS |
+-------+----------------------------------------+-------+
The area of buffer starting from Query field all the way to the end belongs
to the Query buffer and its structure is described in alloc_query() in
sql_parse.cc
*/
if
(
!
(
start
=
data_buf
=
(
Log_event
::
Byte
*
)
my_malloc
(
catalog_len
+
1
+
time_zone_len
+
1
+
user
.
length
+
1
+
host
.
length
+
1
+
data_len
+
1
#if !defined(MYSQL_CLIENT) && defined(HAVE_QUERY_CACHE)
if
(
!
(
start
=
data_buf
=
(
Log_event
::
Byte
*
)
my_malloc
(
catalog_len
+
1
+
time_zone_len
+
1
+
data_len
+
1
+
QUERY_CACHE_FLAGS_SIZE
+
user
.
length
+
1
+
host
.
length
+
1
+
db_len
+
1
,
MYF
(
MY_WME
))))
#else
if
(
!
(
start
=
data_buf
=
(
Log_event
::
Byte
*
)
my_malloc
(
catalog_len
+
1
+
time_zone_len
+
1
+
data_len
+
1
+
user
.
length
+
1
+
host
.
length
+
1
,
MYF
(
MY_WME
))))
+
sizeof
(
size_t
)
//for db_len
+
db_len
+
1
+
QUERY_CACHE_FLAGS_SIZE
#endif
,
MYF
(
MY_WME
))))
DBUG_VOID_RETURN
;
if
(
catalog_len
)
// If catalog is given
{
...
...
@@ -2965,6 +2975,14 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
db
=
(
char
*
)
start
;
query
=
(
char
*
)(
start
+
db_len
+
1
);
q_len
=
data_len
-
db_len
-
1
;
/**
Append the db length at the end of the buffer. This will be used by
Query_cache::send_result_to_client() in case the query cache is On.
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_QUERY_CACHE)
size_t
db_length
=
(
size_t
)
db_len
;
memcpy
(
start
+
data_len
+
1
,
&
db_length
,
sizeof
(
size_t
));
#endif
DBUG_VOID_RETURN
;
}
...
...
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