1580
MySQLERRORCommonPartitioningHIGH confidence

Only integer values allowed here

Production Risk

Low — the DDL fails; no table is created.

What this means

A non-integer value was used in a context that requires an integer, such as a PARTITIONS clause.

Why it happens
  1. 1Specifying a non-integer as the number of partitions.
  2. 2Using a floating-point value in a partition count expression.
How to reproduce
trigger — this will error
trigger — this will error
CREATE TABLE t (id INT) PARTITION BY HASH(id) PARTITIONS 2.5;

expected output

ERROR 1580 (HY000): Only integers allowed as number of partitions

Fix

Use a positive integer for partition count

Use a positive integer for partition count
CREATE TABLE t (id INT) PARTITION BY HASH(id) PARTITIONS 4;

Why this works

The PARTITIONS clause requires a positive integer literal.

Sources
Official documentation ↗

MySQL 8.0 — 1580 ER_ONLY_INTEGERS_ALLOWED

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

← All MySQL errors