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

CAST(inet6 AS BINARY) returns wrong result

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.5
    • 10.5.0
    • Data types
    • 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

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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