Commit f11d425a authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 896b8696
...@@ -3423,16 +3423,18 @@ static size_t calc_field_event_length(const uchar *ptr, uint type, uint meta) ...@@ -3423,16 +3423,18 @@ static size_t calc_field_event_length(const uchar *ptr, uint type, uint meta)
case MYSQL_TYPE_SET: case MYSQL_TYPE_SET:
return meta & 0xFF; return meta & 0xFF;
case MYSQL_TYPE_BLOB: case MYSQL_TYPE_BLOB:
if (meta > 4 ) switch (meta) {
default:
return 0; return 0;
if (meta == 1) case 1:
return *ptr + 1; return *ptr + 1;
if (meta == 2) case 2:
return uint2korr(ptr) + 2; return uint2korr(ptr) + 2;
if (meta == 3) case 3:
return uint3korr(ptr) + 3; return uint3korr(ptr) + 3;
if (meta == 4) case 4:
return uint4korr(ptr) + 4; return uint4korr(ptr) + 4;
}
case MYSQL_TYPE_VARCHAR: case MYSQL_TYPE_VARCHAR:
case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_VAR_STRING:
length= meta; length= meta;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment