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

In table partitioned by INET6 all values go into the same partition

    XMLWordPrintable

Details

    Description

      create table t1 (a inet6) partition by key(a) partitions 2;
      insert into t1 values ('0:db8::ff00:42:8329'),('2001:db8::ff00:42:8329'),('::'),('::192.0.2.128'),('::ffff:192.0.2.128');
      select * from t1 partition (p0);
      select * from t1 partition (p1);
      

      10.5 b37386d8

      MariaDB [test]> select * from t1 partition (p0);
      Empty set (0.000 sec)
       
      MariaDB [test]> select * from t1 partition (p1);
      +------------------------+
      | a                      |
      +------------------------+
      | 0:db8::ff00:42:8329    |
      | 2001:db8::ff00:42:8329 |
      | ::                     |
      | ::192.0.2.128          |
      | ::ffff:192.0.2.128     |
      +------------------------+
      5 rows in set (0.001 sec)
      

      Compare with binary column:

      MariaDB [test]> create table t2 (a binary(22)) partition by key(a) partitions 2;
      Query OK, 0 rows affected (0.342 sec)
       
      MariaDB [test]> insert into t2 values ('0:db8::ff00:42:8329'),('2001:db8::ff00:42:8329'),('::'),('::192.0.2.128'),('::ffff:192.0.2.128');
      Query OK, 5 rows affected (0.050 sec)
      Records: 5  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> select * from t2 partition (p0);
      +------------------------+
      | a                      |
      +------------------------+
      | 0:db8::ff00:42:8329    |
      | ::192.0.2.128          |
      +------------------------+
      2 rows in set (0.000 sec)
       
      MariaDB [test]> select * from t2 partition (p1);
      +------------------------+
      | a                      |
      +------------------------+
      | 2001:db8::ff00:42:8329 |
      | ::                     |
      | ::ffff:192.0.2.128     |
      +------------------------+
      3 rows in set (0.000 sec)
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.