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.
This commit is contained in:
Marko Mäkelä 2019-10-09 09:16:40 +03:00
parent 896b869685
commit f11d425a15

View file

@ -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;