diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-10-09 09:16:40 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-10-09 13:08:16 +0300 |
commit | f11d425a15e53d4b206146a9d52f5be324247826 (patch) | |
tree | fc722ee6e69a1a3e5e2cba774b67f17e758e49da /sql/log_event.cc | |
parent | 896b869685484beac11785f7d1099be0fe265c49 (diff) | |
download | mariadb-git-f11d425a15e53d4b206146a9d52f5be324247826.tar.gz |
MDEV-20591: Follow-up fix
calc_field_event_length(): For type=MYSQL_TYPE_BLOB and meta==0,
return 0 instead of *ptr+1. This was noted by -Wimplicit-fallthrough.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 369e9229d03..15523ba0c36 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -3423,16 +3423,18 @@ static size_t calc_field_event_length(const uchar *ptr, uint type, uint meta) case MYSQL_TYPE_SET: return meta & 0xFF; case MYSQL_TYPE_BLOB: - if (meta > 4 ) + switch (meta) { + default: return 0; - if (meta == 1) + case 1: return *ptr + 1; - if (meta == 2) + case 2: return uint2korr(ptr) + 2; - if (meta == 3) + case 3: return uint3korr(ptr) + 3; - if (meta == 4) + case 4: return uint4korr(ptr) + 4; + } case MYSQL_TYPE_VARCHAR: case MYSQL_TYPE_VAR_STRING: length= meta; |