MYSQL5.5 table partition problem 1. the attribute of the field is timestamp, and an exception Constant, random or timezone-dependent expressions in (sub) occurs during partitioning) partitioning function are not allowed found on the Internet. for example, if a partition of the timestamp type does not work, change it to DATETIME or DATE pruning is not expected to work for tables partitioned on a TIMESTAMP column, and you shoshould use a DATETIME or DATE column for this instead. 2. after changing to datetime, the following error occurs: a primary key must include all columns in the table's partitioning function mysql partition field must be included in the primary key. the SQL statement is as follows:
Alter table Test partition by list (dayofweek (time) (PARTITION p01 values in (1), PARTITION p02 values in (2), PARTITION p03 values in (3 ), PARTITION p04 values in (4), PARTITION p05 values in (5), PARTITION p06 values in (6), PARTITION p07 values in (7 ), PARTITION perr values in (0 ));