1504
MariaDBERRORNotablePartitioningHIGH confidence

Mix of storage handlers in partitions is not allowed

Production Risk

Low — DDL error; the table will not be created.

What this means

ER_MIX_HANDLER_ERROR (1504, SQLSTATE HY000) is raised when a partitioned table attempts to use different storage engines for different partitions, which is not allowed.

Why it happens
  1. 1Specifying ENGINE=InnoDB for some partitions and ENGINE=MyISAM for others
  2. 2All partitions in a partitioned table must use the same storage engine
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (id INT)
PARTITION BY RANGE(id) (
  PARTITION p0 VALUES LESS THAN (100) ENGINE=InnoDB,
  PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE=MyISAM  -- Different engine
);

expected output

ERROR 1504 (HY000): The mix of handlers in the partitions is not allowed in this version of MySQL

Fix

Use the same storage engine for all partitions

Use the same storage engine for all partitions
CREATE TABLE t (id INT)
ENGINE=InnoDB
PARTITION BY RANGE(id) (
  PARTITION p0 VALUES LESS THAN (100),
  PARTITION p1 VALUES LESS THAN MAXVALUE
);

Why this works

All partitions must use the same storage engine; set the engine at the table level.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1504 ER_MIX_HANDLER_ERROR

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors