1684
MySQLWARNINGNotableDDLHIGH confidence

Old temporal columns found; they need to be upgraded to the new format

Production Risk

Medium — queries involving sub-second precision may return incorrect results until upgraded.

What this means

MySQL detected temporal columns (DATE, DATETIME, TIMESTAMP, TIME) stored in the pre-5.6.4 format. Running mysql_upgrade or REPAIR TABLE will convert them to the new fractional-seconds-capable format.

Why it happens
  1. 1Table was created on MySQL 5.5 or earlier and not yet upgraded.
  2. 2Skipped mysql_upgrade after upgrading the server.
How to reproduce
trigger — this will error
trigger — this will error
-- Detected automatically during CHECK TABLE or mysql_upgrade.

expected output

Warning (Code 1684): Column 'created_at' of table 'mydb.orders' has a deprecated pre-4.1 temporal format.

Fix 1

Run mysql_upgrade to convert old temporal columns

Run mysql_upgrade to convert old temporal columns
-- From the OS shell:
mysql_upgrade -u root -p

Why this works

mysql_upgrade rewrites temporal columns to the new format without data loss.

Fix 2

Repair individual table

Repair individual table
REPAIR TABLE orders;

Why this works

REPAIR TABLE upgrades the temporal column format in-place.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 1684 ER_OLD_TEMPORALS_UPGRADED

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

← All MySQL errors