對已存在的未分區的表進行分區sql
alter table test PARTITION BY RANGE(id) (PARTITION p1 VALUES LESS THAN (101),PARTITION p2 VALUES LESS THAN (201) )
提示錯誤:code
Table has no partition for value 201it
緣由是分區沒有包含表中全部數據io
即 若是表中最大id是1655,則改爲:table
alter table test PARTITION BY RANGE(id) (PARTITION p1 VALUES LESS THAN (1001),PARTITION p2 VALUES LESS THAN (2001) )class
就行了(即全部數據都要有分區)test