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
d10e839a
Commit
d10e839a
authored
Dec 01, 2012
by
Libing Song
Browse files
Options
Browse Files
Download
Plain Diff
Auto Merge
parents
d1923690
e7e9fa59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
sql/log_event.cc
sql/log_event.cc
+14
-4
sql/log_event.h
sql/log_event.h
+16
-2
No files found.
sql/log_event.cc
View file @
d10e839a
...
...
@@ -4307,7 +4307,6 @@ Format_description_log_event::do_shall_skip(Relay_log_info *rli)
into 'server_version_split':
X.Y.Zabc (X,Y,Z numbers, a not a digit) -> {X,Y,Z}
X.Yabc -> {X,Y,0}
Xabc -> {X,0,0}
'server_version_split' is then used for lookups to find if the server which
created this event has some known bug.
*/
...
...
@@ -4318,10 +4317,21 @@ void Format_description_log_event::calc_server_version_split()
for
(
uint
i
=
0
;
i
<=
2
;
i
++
)
{
number
=
strtoul
(
p
,
&
r
,
10
);
server_version_split
[
i
]
=
(
uchar
)
number
;
DBUG_ASSERT
(
number
<
256
);
// fit in uchar
/*
It is an invalid version if any version number greater than 255 or
first number is not followed by '.'.
*/
if
(
number
<
256
&&
(
*
r
==
'.'
||
i
!=
0
))
server_version_split
[
i
]
=
(
uchar
)
number
;
else
{
server_version_split
[
0
]
=
0
;
server_version_split
[
1
]
=
0
;
server_version_split
[
2
]
=
0
;
break
;
}
p
=
r
;
DBUG_ASSERT
(
!
((
i
==
0
)
&&
(
*
r
!=
'.'
)));
// should be true in practice
if
(
*
r
==
'.'
)
p
++
;
// skip the dot
}
...
...
sql/log_event.h
View file @
d10e839a
...
...
@@ -1021,7 +1021,7 @@ public:
return
thd
?
thd
->
db
:
0
;
}
#else
Log_event
()
:
temp_buf
(
0
)
{}
Log_event
()
:
temp_buf
(
0
)
,
flags
(
0
)
{}
/* avoid having to link mysqlbinlog against libpthread */
static
Log_event
*
read_log_event
(
IO_CACHE
*
file
,
const
Format_description_log_event
...
...
@@ -2320,12 +2320,26 @@ public:
#ifdef MYSQL_SERVER
bool
write
(
IO_CACHE
*
file
);
#endif
bool
is_valid
()
const
bool
header_
is_valid
()
const
{
return
((
common_header_len
>=
((
binlog_version
==
1
)
?
OLD_HEADER_LEN
:
LOG_EVENT_MINIMAL_HEADER_LEN
))
&&
(
post_header_len
!=
NULL
));
}
bool
version_is_valid
()
const
{
/* It is invalid only when all version numbers are 0 */
return
!
(
server_version_split
[
0
]
==
0
&&
server_version_split
[
1
]
==
0
&&
server_version_split
[
2
]
==
0
);
}
bool
is_valid
()
const
{
return
header_is_valid
()
&&
version_is_valid
();
}
int
get_data_size
()
{
/*
...
...
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