1736
MySQLERRORNotablePartitioningHIGH confidence
Tables have different metadata for EXCHANGE PARTITION
Production Risk
Low — operation rejected; no data moved.
What this means
The table-level metadata (such as CHARACTER SET, COLLATION, ROW_FORMAT, or KEY_BLOCK_SIZE) differs between the partitioned table and the exchange table, preventing EXCHANGE PARTITION.
Why it happens
- 1Different DEFAULT CHARSET or COLLATION between the two tables.
- 2Different ROW_FORMAT settings.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE part_t EXCHANGE PARTITION p0 WITH TABLE other_t;
expected output
ERROR 1736 (HY000): Tables have different metadata for EXCHANGE PARTITION.
Fix
Align table metadata between both tables
Align table metadata between both tables
SHOW CREATE TABLE part_t; SHOW CREATE TABLE other_t; -- Alter other_t to match charset, collation, and row_format. ALTER TABLE other_t CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
Why this works
Matching all table-level options ensures metadata compatibility for the exchange.
What not to do
✕
Sources
Official documentation ↗
MySQL 8.0 — 1736 ER_TABLES_DIFFERENT_METADATA
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev