Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/MariaDB/mysql-test/main/   (MariaDB Server Version 8.1-8.4©)  Datei vom 1.9.2026 mit Größe 7 kB image not shown  

Quelle  partition_key_algorithm,xxh3.rdiff  Sprache: unbekannt

 
Spracherkennung für: .rdiff vermutete Sprache: SQL {SQL[67] MT940[48] ABAP[39]} [Methode: maximale Elemente, drei Dimensionen]

--- ../src/mysql-test/main/partition_key_algorithm.result 2026-01-19 14:12:35.390091511 +1100
+++ ../src/mysql-test/main/partition_key_algorithm,xxh3.reject 2026-01-19 14:12:49.398000611 +1100
@@ -1,13 +1,13 @@
 # MDEV-9826 better hash algorithms for PARTITION BY KEY
 ## MDEV-9826 case with NULL
-create table t1(c1 int, c2 date) partition by key  (c2) partitions 8;
+create table t1(c1 int, c2 date) partition by key ALGORITHM=XXH3 (c2) partitions 8;
 show create table t1;
 Table Create Table
 t1 CREATE TABLE `t1` (
   `c1` int(11) DEFAULT NULL,
   `c2` date DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
- PARTITION BY KEY (`c2`)
+ PARTITION BY KEY ALGORITHM = XXH3 (`c2`)
 PARTITIONS 8
 insert into t1 values (1, NULL);
 insert into t1 values (1, '2014-04-22');
@@ -21,127 +21,127 @@
 insert into t1 values (1, '2014-04-30');
 select partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 3
-p1 0
-p2 1
-p3 0
-p4 2
+p0 1
+p1 1
+p2 2
+p3 4
+p4 1
 p5 0
-p6 4
+p6 1
 p7 0
 select * from t1;
 c1 c2
-1 2014-04-22
 1 2014-04-26
-1 2014-04-30
-1 NULL
 1 2014-04-24
+1 NULL
 1 2014-04-28
+1 2014-04-22
 1 2014-04-23
-1 2014-04-25
-1 2014-04-27
 1 2014-04-29
+1 2014-04-30
+1 2014-04-27
+1 2014-04-25
 drop table t1;
 ## MDEV-9826 case with more dates
-create table t1(c1 int, c2 date) partition by key  (c2) partitions 8;
+create table t1(c1 int, c2 date) partition by key ALGORITHM=XXH3 (c2) partitions 8;
 show create table t1;
 Table Create Table
 t1 CREATE TABLE `t1` (
   `c1` int(11) DEFAULT NULL,
   `c2` date DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
- PARTITION BY KEY (`c2`)
+ PARTITION BY KEY ALGORITHM = XXH3 (`c2`)
 PARTITIONS 8
 insert into t1 values (1, NULL);
 insert into t1 select 1, from_days(seq) from seq_735000_to_736000;
 select partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 297
-p1 0
-p2 1
-p3 0
-p4 428
-p5 0
-p6 276
-p7 0
+p0 122
+p1 132
+p2 151
+p3 121
+p4 113
+p5 125
+p6 128
+p7 110
 drop table t1;
 ## MDEV-9826 case with more dates and linear key
-create table t1(c1 int, c2 date) partition by linear key  (c2) partitions 8;
+create table t1(c1 int, c2 date) partition by linear key ALGORITHM=XXH3 (c2) partitions 8;
 show create table t1;
 Table Create Table
 t1 CREATE TABLE `t1` (
   `c1` int(11) DEFAULT NULL,
   `c2` date DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
- PARTITION BY LINEAR KEY (`c2`)
+ PARTITION BY LINEAR KEY ALGORITHM = XXH3 (`c2`)
 PARTITIONS 8
 insert into t1 values (1, NULL);
 insert into t1 select 1, from_days(seq) from seq_735000_to_736000;
 select partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 297
-p1 0
-p2 1
-p3 0
-p4 428
-p5 0
-p6 276
-p7 0
+p0 122
+p1 132
+p2 151
+p3 121
+p4 113
+p5 125
+p6 128
+p7 110
 drop table t1;
 ## MDEV-9826 case with more dates and multiple keys
-create table t1(c1 int, c2 date) partition by key  (c1, c2) partitions 8;
+create table t1(c1 int, c2 date) partition by key ALGORITHM=XXH3 (c1, c2) partitions 8;
 show create table t1;
 Table Create Table
 t1 CREATE TABLE `t1` (
   `c1` int(11) DEFAULT NULL,
   `c2` date DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
- PARTITION BY KEY (`c1`,`c2`)
+ PARTITION BY KEY ALGORITHM = XXH3 (`c1`,`c2`)
 PARTITIONS 8
 insert into t1 values (1, NULL);
 insert into t1 select 1, from_days(seq) from seq_735000_to_736000;
 select partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 153
-p1 0
-p2 542
-p3 0
-p4 306
-p5 1
-p6 0
-p7 0
+p0 140
+p1 124
+p2 140
+p3 128
+p4 108
+p5 124
+p6 122
+p7 116
 drop table t1;
 ## MDEV-20791 case with INET6
-create table t1 (a inet6) partition by key  (a) partitions 2;
+create table t1 (a inet6) partition by key ALGORITHM=XXH3 (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 partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 0
-p1 5
+p0 1
+p1 4
 ### here we test hash values using an odd prime number of partitions
-alter table t1 partition by key  (a) partitions 7;
+alter table t1 partition by key ALGORITHM=XXH3 (a) partitions 7;
 select partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 1
-p1 1
-p2 1
-p3 1
+p0 0
+p1 0
+p2 2
+p3 0
 p4 1
-p5 0
-p6 0
+p5 1
+p6 1
 ### partition by linear key where mask (7) > num_parts (6)
-alter table t1 partition by linear key  (a) partitions 6;
+alter table t1 partition by linear key ALGORITHM=XXH3 (a) partitions 6;
 select partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 0
-p1 4
+p0 1
+p1 1
 p2 0
-p3 1
+p3 3
 p4 0
 p5 0
 drop table t1;
 ## MDEV-20791 case with BINARY
-CREATE TABLE t1 (a BINARY(16)) PARTITION BY KEY  (a) PARTITIONS 2;
+CREATE TABLE t1 (a BINARY(16)) PARTITION BY KEY ALGORITHM=XXH3 (a) PARTITIONS 2;
 INSERT INTO t1 VALUES (X'00000DB8000000000000FF0000428329');
 INSERT INTO t1 VALUES (X'20010DB8000000000000FF0000428329');
 INSERT INTO t1 VALUES (X'00000000000000000000000000000000');
@@ -149,22 +149,22 @@
 INSERT INTO t1 VALUES (X'00000000000000000000FFFFC0000280');
 select partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 0
-p1 5
+p0 1
+p1 4
 drop table t1;
 ## MDEV-20791 case with more rows
-create table t1 (a inet6) partition by key  (a) partitions 2;
+create table t1 (a inet6) partition by key ALGORITHM=XXH3 (a) partitions 2;
 insert into t1 select concat(hex(seq), ':db8::ff00:42:8329') from seq_0_to_65535;
 select partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 0
-p1 65536
+p0 32550
+p1 32986
 insert into t1 values ('::');
 insert into t1 select concat('::', hex(seq), ':192.0.2.128') from seq_0_to_65535;
 select partition_name, table_rows from information_schema.partitions where table_name='t1';
 partition_name table_rows
-p0 16384
-p1 114689
+p0 65420
+p1 65653
 drop table t1;
 ## MDEV-6255 case to test charset/collation
 ### cp1251_ukrainian_ci: 0x20 SPACE is equal to 0x60 GRAVE ACCENT
@@ -176,7 +176,7 @@
 60
 6060
 606060
-ALTER TABLE t1  PARTITION BY KEY  (a) PARTITIONS 3;
+ALTER TABLE t1  PARTITION BY KEY ALGORITHM=XXH3 (a) PARTITIONS 3;
 SELECT HEX(a) FROM t1 WHERE a=0x60;
 HEX(a)
 20
@@ -193,7 +193,7 @@
 60
 6060
 606060
-ALTER TABLE t1  PARTITION BY KEY  (a) PARTITIONS 3;
+ALTER TABLE t1  PARTITION BY KEY ALGORITHM=XXH3 (a) PARTITIONS 3;
 SELECT HEX(a) FROM t1 WHERE a=0x60;
 HEX(a)
 20
@@ -210,7 +210,7 @@
 A0
 A0A0
 A0A0A0
-ALTER TABLE t1  PARTITION BY KEY  (a) PARTITIONS 3;
+ALTER TABLE t1  PARTITION BY KEY ALGORITHM=XXH3 (a) PARTITIONS 3;
 SELECT HEX(a) FROM t1 WHERE a=0xA0;
 HEX(a)
 20
@@ -220,15 +220,17 @@
 DROP TABLE t1;
 ## MDEV-38549 MDEV-9826 derived a bug for numeric columns from
 ## the old hash design
-CREATE OR REPLACE TABLE t1 (c1 INT NOT NULL) PARTITION BY KEY  (c1) PARTITIONS 16;
+CREATE OR REPLACE TABLE t1 (c1 INT NOT NULL) PARTITION BY KEY ALGORITHM=XXH3 (c1) PARTITIONS 16;
 INSERT INTO t1 VALUES (0x41),(0x61);
 SELECT table_name, partition_name, table_rows FROM information_schema.partitions
 WHERE table_name='t1' AND table_rows>0;
 table_name partition_name table_rows
-t1 p4 2
-ALTER TABLE t1 PARTITION BY KEY  (c1) PARTITIONS 7;
+t1 p6 1
+t1 p8 1
+ALTER TABLE t1 PARTITION BY KEY ALGORITHM=XXH3 (c1) PARTITIONS 7;
 SELECT table_name, partition_name, table_rows FROM information_schema.partitions
 WHERE table_name='t1' AND table_rows>0;
 table_name partition_name table_rows
-t1 p5 2
+t1 p0 1
+t1 p6 1
 DROP TABLE t1;

[Dauer der Verarbeitung: 0.13 Sekunden, vorverarbeitet 2026-10-08]