Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
3.3.18, 3.4.8
-
None
Description
mariadb_rpl_extract_rows() reads too many bytes from the event image for MYSQL_TYPE_TIMESTAMP2 values.
|
mariadb_rpl.c |
MARIADB_RPL_ROW * STDCALL
|
mariadb_rpl_extract_rows(MARIADB_RPL *rpl,
|
MARIADB_RPL_EVENT *tm_event,
|
MARIADB_RPL_EVENT *row_event)
|
...
|
case MYSQL_TYPE_TIMESTAMP2: |
{
|
char tmp[20]; |
uint32_t p1= uint4korr(pos);
|
uint8_t f_len= *metadata++;
|
uint32_t p2;
|
pos+= 4;
|
p2= (uint32_t)uintNkorr(f_len, pos);
|
pos+= f_len;
|
Here it reads the metadata byte and then reads as many bytes from the event image.
This differs from ma_rpl_get_second_part() that reads, for example, 3 bytes when the metadata byte says 5 or 6. This latter behavior matches what the server does:
|
compat56.c |
uint my_timestamp_binary_length(uint dec)
|
{
|
DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
|
return 4 + (dec + 1) / 2; |
}
|
This was reported by Asim Viladi Oglu Manizada