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

CAST(inet6 AS BINARY) returns wrong result

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.5
    • Fix Version/s: 10.5.0
    • Component/s: Data types
    • Labels:
      None

      Description

      CREATE OR REPLACE TABLE t1 (a INET6);
      INSERT INTO t1 VALUES ('2001:db8::ff00:42:8329');
      SELECT CAST(a AS BINARY(16)) FROM t1;
      SHOW WARNINGS;
      

      +-----------------------+
      | CAST(a AS BINARY(16)) |
      +-----------------------+
      | 2001:db8::ff00:4      |
      +-----------------------+
      

      +---------+------+----------------------------------------------------------------+
      | Level   | Code | Message                                                        |
      +---------+------+----------------------------------------------------------------+
      | Warning | 1292 | Truncated incorrect BINARY(16) value: '2001:db8::ff00:42:8329' |
      +---------+------+----------------------------------------------------------------+
      

      Notice: it returned text address representation with a truncation warning.
      The expected result is to return binary address representation without warnings.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: