<p>MySQL raises error 1495 when the same constant appears more than once in a LIST partition definition.</p>
<p>MySQL Error 1495: ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR occurs when a LIST partition rule repeats the same constant. Remove or rename the duplicate value, then run ALTER TABLE to recreate the partitions.</p>
Multiple definition of same constant in list partitioning
Error 1495 fires when you create or alter a LIST-partitioned table and repeat the same constant in two or more partition value lists. The server rejects the statement because every constant must map to exactly one partition.
The error stops table creation or modification, leaving the schema unchanged until you supply a valid, non-overlapping set of constants.
The primary trigger is a duplicate literal in the PARTITION ... VALUES IN() clause. MySQL scans each value and compares it to earlier entries. If a duplicate is found, error 1495 is emitted immediately.
Copy-paste mistakes, automated script loops, or merging partition definitions from different environments commonly introduce the duplicate constant.
Identify duplicates by reviewing each VALUES IN() list. Remove or move the overlapping constant so it appears only once across all partitions, then rerun the CREATE or ALTER statement.
If many constants are involved, load them into a temporary table and use SELECT ... GROUP BY to spot duplicates quickly before generating the final partition script.
During schema refactors, engineers often append new partitions without checking existing lists. Query INFORMATION_SCHEMA.PARTITIONS first to see current values and avoid overlaps.
ETL automation can regenerate CREATE TABLE scripts daily. Add validation logic in your CI pipeline to catch duplicate constants before deployment.
Keep partition values in a single source-of-truth script or YAML file so changes are atomic and reviewable in Git.
In Galaxy, enable the AI copilot linter which highlights repeated constants in LIST partitions before execution, preventing runtime errors.
Error 1504 ER_PARTITION_SUBPART_MIXED occurs when mixing subpartitioning types. Use consistent partitioning to resolve.
Error 1658 ER_SAME_NAME_PARTITION exists when two partitions share the same name. Rename the duplicate partition to fix.
The same integer or string appears in two separate partition value lists.
Merging scripts or reusing code without checking for overlaps creates duplicates.
Dynamic SQL that builds partition lists programmatically may accidentally append an existing constant.
Hotfixes applied directly in the database can overlook previous values and introduce duplication.
Happens when combining RANGE and LIST subpartitions improperly.
Raised when two partitions share the same name in a CREATE or ALTER statement.
Occurs when the partition column list is invalid or missing in a partitioned table.
No. MySQL enforces a one-to-one mapping of constant to partition, so duplicates are prohibited.
Error 1495 is specific to LIST partitioning. RANGE, HASH, and KEY partitions use different validation rules.
No. All supported MySQL versions include the same duplicate-constant validation for LIST partitions.
Galaxy's AI copilot flags duplicate constants during query composition and provides auto-fix suggestions before you run the statement.