<p>MySQL raises ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR when a VALUES clause in a partition definition uses a data type different from the partitioning function, blocking table creation or alteration.</p>
<p>MySQL Error 1494: ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR appears when the VALUES value in a partition definition is not the same data type as the partition function. Align the VALUES constants (e.g., INT, DATE) with the data type returned by the partitioning expression to resolve the issue.</p>
VALUES value must be of same type as partition function
MySQL throws "VALUES value must be of same type as partition function" when defining or altering a partitioned table whose VALUES LESS THAN or VALUES IN clause contains a literal that does not match the data type returned by the partitioning expression.
The server stops the CREATE TABLE or ALTER TABLE statement to prevent invalid range or list boundaries that would corrupt the partition metadata.
The error commonly appears during DDL operations that involve RANGE, LIST, or RANGE COLUMNS partitioning. It is triggered the moment MySQL parses a mismatched literal, so no data is written.
Developers typically encounter it while migrating schemas, converting column types, or scripting partition maintenance jobs that add new partitions automatically.
Leaving the error unresolved blocks table creation or partition management, halting application deployments and ETL pipelines. Consistent types also ensure efficient partition pruning and correct query results.
The partitioning expression returns one data type, but the VALUES clause supplies another-for example, INT vs VARCHAR, or DATE vs BIGINT. MySQL requires exact type equivalence.
Implicit casts do not apply inside partition definitions, so even compatible types like TINYINT and INT can raise the error.
Identify the data type returned by the partitioning function (usually the column type). Rewrite every VALUES literal to match that exact type or modify the partitioning expression to output the desired type.
If using RANGE COLUMNS, ensure each column in VALUES lists matches the declared column types in both order and type.
INT column partitioned by YEAR(date_col): supply YEAR(date_col) output (INT) in VALUES LESS THAN (2025) not ('2025').
DATE column partitioned by TO_DAYS(date_col): use TO_DAYS('2024-01-01') output (INT) inside VALUES, or switch to RANGE COLUMNS on the raw DATE column.
Always document the data type of your partitioning expression. Use constants of the same type in automation scripts. Add unit tests that attempt dummy CREATE TABLE statements before production deployment.
In Galaxy, the SQL editor highlights mismatched literals in real time, letting you fix the value before executing the DDL.
ER_PARTITION_FUNC_NOT_ALLOWED: raised when unsupported functions appear in partition expressions. Replace them with permitted deterministic expressions.
ER_RANGE_NOT_INCREASING_ERROR: triggered when VALUES LESS THAN are not strictly ascending. Correct the order of range boundaries.
Partition function returns INT but VALUES clause uses DECIMAL or VARCHAR, causing a direct type conflict.
Using '2025' instead of 2025 in RANGE partitioning where the function outputs an INT.
Partitioning by TO_DAYS(date_col) yet supplying raw date strings instead of the integer result of TO_DAYS().
Altering a partition key column from INT to BIGINT but forgetting to regenerate the partition definitions with BIGINT literals.
Raised when non-deterministic or disallowed functions appear in the partitioning expression. Use permitted deterministic functions.
Occurs when VALUES LESS THAN are not strictly ascending in RANGE partitions. Ensure each boundary is higher than the previous one.
Triggered if two partitions share the same name. Rename the duplicate partition before executing ALTER TABLE.
No. MySQL does not perform implicit casts in VALUES clauses. Types must match exactly.
No. The error is specific to RANGE, LIST, and RANGE COLUMNS partitioning where VALUES boundaries are specified.
Galaxy's type-checking linter flags mismatched literals in real time and its AI copilot auto-generates correctly typed VALUES clauses.
The check exists in MySQL 5.1 and later. All supported versions will raise the same error when a mismatch is detected.