Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4(EOL), 10.5
-
None
Description
Starting from 10.4, the following CREATE statement works:
MariaDB [test]> CREATE TABLE t1 (a INT, b INT, UNIQUE (b) USING HASH) PARTITION BY KEY (a) PARTITIONS 2; |
Query OK, 0 rows affected (0.433 sec) |
 |
MariaDB [test]> show create table t1; |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| Table | Create Table | |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| t1 | CREATE TABLE `t1` ( |
`a` int(11) DEFAULT NULL, |
`b` int(11) DEFAULT NULL, |
UNIQUE KEY `b` (`b`) USING HASH |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
PARTITION BY KEY (`a`) |
PARTITIONS 2 |
|
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
Without USING HASH it fails as it probably should:
MariaDB [test]> CREATE TABLE t1 (a INT, b INT, UNIQUE (b)) PARTITION BY KEY (a) PARTITIONS 2; |
ERROR 1503 (HY000): A UNIQUE INDEX must include all columns in the table's partitioning function |
It also fails with and without USING HASH in earlier versions.
If it's something that was implemented intentionally in 10.4, it needs to be documented.
Reproducible with at least InnoDB, MyISAM.
Attachments
Issue Links
- relates to
-
MDEV-22185 Failing assertion: node->pcur->rel_pos == BTR_PCUR_ON or ER_KEY_NOT_FOUND or Assertion `inited==NONE' failed in handler::ha_index_init
- Closed
-
MDEV-22262 Server crashes in ha_partition::open or handler::ha_table_flags upon UPDATE with partition pruning
- Confirmed
-
MDEV-23530 ERROR 1071: Specified key was too long; max key length is 1000/2000 bytes on CREATE TABLE ... UNIQUE KEY ... USING HASH
- Open
-
MDEV-23713 Replication stops with "Index for table is corrupt", table with HASH index, assertion: !cursor->index->is_committed() fails in row_ins_sec_index_entry_by_modify
- Closed