1533
MySQLERRORNotablePartitioningHIGH confidence
Table has no partition for the given value
Production Risk
High — inserts with unmatched values will fail; add a catch-all partition.
What this means
ER_NO_PARTITION_FOR_GIVEN_VALUE (1533, SQLSTATE HY000) is raised when an INSERT or UPDATE places a row with a value that does not match any defined partition.
Why it happens
- 1Inserting a value not covered by any partition in a LIST-partitioned table
- 2RANGE partition without MAXVALUE cannot accommodate the inserted value
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (status INT) PARTITION BY LIST(status) ( PARTITION p0 VALUES IN (1, 2), PARTITION p1 VALUES IN (3, 4) ); INSERT INTO t VALUES (99); -- 99 is not in any partition
expected output
ERROR 1533 (HY000): Table has no partition for value 99
Fix
Add a partition for the missing value or use MAXVALUE
Add a partition for the missing value or use MAXVALUE
-- For LIST: add the missing value to an existing or new partition ALTER TABLE t ADD PARTITION (PARTITION p_other VALUES IN (99, 100)); -- For RANGE: add a catch-all partition: ALTER TABLE t ADD PARTITION (PARTITION p_max VALUES LESS THAN MAXVALUE);
Why this works
Every value inserted into a LIST-partitioned table must match a VALUES IN clause; RANGE tables need a MAXVALUE partition for catch-all.
Sources
Official documentation ↗
MySQL 8.0 — 1533 ER_NO_PARTITION_FOR_GIVEN_VALUE
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev