1732
MariaDBERRORNotablePartitioningHIGH confidence

Exchange table must not be a partitioned table

Production Risk

Low — operation rejected; no data moved.

What this means

The table used in the WITH TABLE clause of ALTER TABLE ... EXCHANGE PARTITION must be a non-partitioned table. Using another partitioned table is not allowed.

Why it happens
  1. 1Providing a partitioned table as the exchange table in EXCHANGE PARTITION.
How to reproduce
trigger — this will error
trigger — this will error
ALTER TABLE part_t EXCHANGE PARTITION p0 WITH TABLE another_part_t;

expected output

ERROR 1732 (HY000): The exchange table cannot be a partitioned table.

Fix

Use a non-partitioned table as the exchange table

Use a non-partitioned table as the exchange table
CREATE TABLE staging LIKE part_t;
-- Remove the partition clause; staging is now non-partitioned
ALTER TABLE part_t EXCHANGE PARTITION p0 WITH TABLE staging;

Why this works

The exchange table must be a plain non-partitioned InnoDB table with matching structure.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1732 ER_PARTITION_EXCHANGE_PART_TABLE

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

← All MariaDB errors