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

Possibly inconsistent behavior of BIT_xx functions with INET6 field

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.5
    • 10.5.4
    • Data types
    • None

    Description

      10.5 41fe972d

      MariaDB [test]> create table t1 (a inet6);
      Query OK, 0 rows affected (0.120 sec)
       
      MariaDB [test]> insert into t1 values ('f::');
      Query OK, 1 row affected (0.020 sec)
       
      MariaDB [test]> select bit_or(a) from t1;
      +-----------+
      | bit_or(a) |
      +-----------+
      |         0 |
      +-----------+
      1 row in set (0.000 sec)
      

      So, the value is apparently truncated or converted, but there are no warnings or errors.
      With BINARY(16) a warning is produced:

      MariaDB [test]> create table t2 (b binary(16));
      Query OK, 0 rows affected (0.118 sec)
       
      MariaDB [test]> insert into t2 values ('f::');
      Query OK, 1 row affected (0.015 sec)
       
      MariaDB [test]> select bit_or(b) from t2;
      +-----------+
      | bit_or(b) |
      +-----------+
      |         0 |
      +-----------+
      1 row in set, 1 warning (0.000 sec)
       
      MariaDB [test]> show warnings;
      +---------+------+----------------------------------------------------------------------------------------------+
      | Level   | Code | Message                                                                                      |
      +---------+------+----------------------------------------------------------------------------------------------+
      | Warning | 1292 | Truncated incorrect INTEGER value: 'f::\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' |
      +---------+------+----------------------------------------------------------------------------------------------+
      1 row in set (0.000 sec)
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              elenst Elena Stepanova
              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.