summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorLibing Song <libing.song@oracle.com>2012-12-01 08:06:45 +0800
committerLibing Song <libing.song@oracle.com>2012-12-01 08:06:45 +0800
commitd10e839afb9d9594cb74c10430bc7a13d5c92e5d (patch)
tree24b6def08560a4095fa67a45b793930d5340a46d /sql/log_event.cc
parentd19236906a685a271d9b3cda4ab80aaf439c519a (diff)
parente7e9fa599ac8323c7c00d1376cb13c32f4b62303 (diff)
downloadmariadb-git-d10e839afb9d9594cb74c10430bc7a13d5c92e5d.tar.gz
Auto Merge
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 766c079d3a6..f0e2d36c6c6 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -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
}