Bug #108703 Documentation doesn't clarify that partitioning is not supported in MySQL 8
Submitted: 6 Oct 2022 15:33 Modified: 18 Oct 2022 16:34
Reporter: Michael Coburn Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: partitioning; foreign keys

[6 Oct 2022 15:33] Michael Coburn
Description:
The MySQL 8 Manual's Partitioning Limitations page does not state that Foreign Keys are not yet supported in conjunction with partitioning. In earlier versions 5.6 and 5.7 it was clearly stated.

How to repeat:
mysql> create database percona;
Query OK, 1 row affected (0.01 sec)
mysql> use percona;
Database changed
mysql> CREATE TABLE parent (id int primary key auto_increment, name varchar(20));
Query OK, 0 rows affected (0.02 sec)

mysql> CREATE TABLE child (childId int primary key auto_increment, childName varchar(20), parentId int, FOREIGN KEY (parentId) REFERENCES parent(id));
Query OK, 0 rows affected (0.02 sec)

mysql> ALTER TABLE child PARTITION BY HASH (childId) PARTITIONS 4;
ERROR 1506 (HY000): Foreign keys are not yet supported in conjunction with partitioning
mysql> select @@version_comment,@@version;
+------------------------------+-----------+
| @@version_comment            | @@version |
+------------------------------+-----------+
| MySQL Community Server - GPL | 8.0.30    |
+------------------------------+-----------+
1 row in set (0.00 sec)

Suggested fix:
Include same statement from 5.7 Manual:

InnoDB storage engine.  InnoDB foreign keys and MySQL partitioning are not compatible. Partitioned InnoDB tables cannot have foreign key references, nor can they have columns referenced by foreign keys. InnoDB tables which have or which are referenced by foreign keys cannot be partitioned.

https://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations-storage-engines.html#:~:t....
[7 Oct 2022 12:54] MySQL Verification Team
HI Mr. Coburn,

Thank you for your documentation bug.

We have checked your test case and you are correct.

This documentation bug is now verified.
[18 Oct 2022 16:34] Jon Stephens
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.

See https://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations-storage-engines.html#part..., https://dev.mysql.com/doc/refman/8.0/en/partitioning-limitations-storage-engines.html#part...
[31 Oct 2022 12:40] MySQL Verification Team
Thank you, Jon.