Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-21150

Encoding BIT and Geometry types on binary protocol

Details

    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`.

      Attachments

        Activity

          wojtekmach Wojtek Mach added a comment -

          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!

          wojtekmach Wojtek Mach added a comment - 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!

          People

            sanja Oleksandr Byelkin
            wojtekmach Wojtek Mach
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.