1503-a PRIMARY KEY must include all columns in the table ' s partitioning function cause of error: The primary key field of the table must contain a partition field. Why? for example, the ID is auto_increment primary key, which is partitioned by date. Consider the following scenario, inserting a record with an ID of 100, MySQL is aware of the insertion into that partition based on the date, but it is obviously inefficient to check that all partitions already contain records with ID 100. If you do not check all the partitions, only check the currently inserted partition, causing a problem, partition 1 already has an ID of 100, and the partition table external rendering is a logical table, then this table has two ID 100 records, obviously violate the definition of the primary key. The primary key field contains the partition field, and without this problem, the record with ID 100 in two partitions is not the same as the time.
1503-a PRIMARY KEY must include all columns in the table ' s partitioning function