MDEV-17832 support was added for extended type info.
Since this change I have random errors coming from mthd_my_read_query_result() and in it db_read_rows() when using connector-c 3.1.8 and higher. Using 3.1.7 no errors are present.
From 3.1.8 onwards ma_result_set_rows() returns 9 when using server 10.5.2 or greater.
So db_read_rows() wants to read 9 fields, always. The error comes from the server is sending sometimes less the 9 fields! When the client reads the field = 8 data it then reads past the packet size and reads random data. The function exits with:
SET_CLIENT_ERROR(mysql, CR_UNKNOWN_ERROR, SQLSTATE_UNKNOWN, 0);
I think the problem originates in the server function has_extended_metadata() in file sql/sql_type.h
The function Protocol_text::store_field_metadata() uses has_extended_metadata() to decide to send 6 or more fields depending on m_attr[i].str being not null. I suppose there are cases when all three m_attr[i].str are null, which results in sending 6 fields in stead of the expected 9.
Could mr. Alexander Barkov look at this issue?