[MDEV-21150] Encoding BIT and Geometry types on binary protocol Created: 2019-11-26  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Data types, Protocol
Affects Version/s: 10.3.20, 10.4.10
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Wojtek Mach Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I noticed some problems with encoding BIT and GEOMETRY types on the binary protocol.

For the query:

    SELECT ?

With `B'101'` encoded as `MYSQL_TYPE_BIT` (`0x10`) the execute statement's hexdump is:

    0000   10 00 00 00 17 13 00 00 00 00 01 00 00 00 00 01
    0010   10 00 01 05

But I'm getting a NULL value back in the response:

However, if I encode bit as `MYSQL_TYPE_VAR_STRING` (`0xFD`):

    0000   10 00 00 00 17 04 00 00 00 00 01 00 00 00 00 01
    0010   fd 00 01 05

I'm getting the expected result.

I observed the same behaviour for `MYSQL_TYPE_GEOMETRY`.



 Comments   
Comment by Wojtek Mach [ 2020-11-09 ]

I noticed the same behaviour on mysql 8.0.22 (but not on prior versions!) which makes me think that sending this data as `MYSQL_TYPE_VAR_STRING` was the intended usage all along. A confirmation would be very appreciated but in any case, I think this can be closed. Thanks!

Generated at Thu Feb 08 09:04:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.