Details
-
Bug
-
Status: Open (View Workflow)
-
Critical
-
Resolution: Unresolved
-
3.4.5
-
None
-
None
-
ubuntu 22.04 minimal arm64
Description
Hi. I'm using MariaDB Server 11.8.2 on an rk3308 linux SBC with SSL disabled for performance, and enabled full row binlog. I created tables with int, varchar, char, binary, datetime etc, and use MariaDB Connector/C for best compatibility. It all worked fine, until I try its rpl feature for simple CDC.
Debugging shows it successfully received binlog event ROWS_EVENT_V1 INSERT/UPDATE/DELETE along with its row_data, but the MARIADB_RPL_ROW* mariadb_rpl_extract_rows() returned has all data wrong on and after char/binary column, for all other types(tinyint/smallint/int/bigint/datetime/varchar) the data is all fine.
Debugging with source shows that in mariadb_rpl_extract_rows() char/binary is recognized as MYSQL_TYPE_STRING, the connector implemented it in a format that doesn't match the received packet and caused wrong offset added to "pos" pointer, making all later row data processed wrong.
The received packet from server is weird. Its metadata is the documented format I find on mysql website(2 bytes, [0]=real type, [1]=max length), but the row_data is not what the doc says(fixed length data) but the same as MYSQL_TYPE_VARCHAR(1 byte data length+n byte data before '\0' terminal). To make it work on my mariadb 11.8.2 I did a quick dirty fix to make it fit into the received packet format and it's working now, but it'd be better if there's an official explanation and (possibly) fix to this.
Thanks!