Skip to content

CONCEPT Cited by 1 source

MySQL reserved-words upgrade break

The class of MySQL upgrade breakage where a new major version promotes previously-legal identifiers to reserved words, making existing schemas unparseable on the new version until the offending table / column / index names are either renamed or back-tick-quoted. The MySQL 5.7 → 8.0 upgrade adds ~40 new reserved words, making this the most mechanically-detectable but most disruptive-to-rename of the upgrade-break classes.

The canonical new words (partial list)

From the post:

ACTIVE     ADMIN      ATTRIBUTE     COMPONENT   DEFINITION
DESCRIPTION EMPTY     EXCLUDE       FINISH      GROUPS
INACTIVE   INITIAL    LEAD          LOCKED      MEMBER
NESTED     OFF        OLD           ORGANIZATION OTHERS
OVER       PATH       PROCESS       RANDOM      RANK
RESOURCE   RETURNING  REUSE         ROLE        SKIP
SRID       STREAM     SYSTEM        TIES        URL
VISIBLE    ZONE

The full authoritative list is maintained at dev.mysql.com — new keywords and reserved words in MySQL 8.0.

Many are SQL:2016 standard keywords (RANK, OVER, GROUPS, TIES — window-function vocabulary) or JSON-function vocabulary (PATH, NESTED). Some are more surprising (URL, SYSTEM, DESCRIPTION, SKIP) — common English words that happened to be legal identifiers on 5.7 and are not on 8.0.

The failure mode

Any schema using these words as unquoted identifiers fails to parse on 8.0:

-- Worked on 5.7, ERROR 1064 on 8.0:
SELECT url, rank, description FROM documents;

-- Must be:
SELECT `url`, `rank`, `description` FROM `documents`;

CREATE TABLE, ALTER TABLE, SELECT, INSERT, and stored-procedure / trigger / view definitions that mention the reserved word all need remediation.

Two remediation paths

Option 1 — rename the identifiers. Permanent fix; no technical debt. Cost scales with every query and every downstream application using the column name.

ALTER TABLE documents
    RENAME COLUMN url TO document_url,
    RENAME COLUMN rank TO result_rank;

Option 2 — back-tick-quote every reference. Minimal code change; the identifier stays the same at the wire level but all SQL referencing it must wrap it in back-ticks.

SELECT `url`, `rank` FROM documents WHERE `url` = ?;

Most ORMs auto-quote column names so this is often implicit. Hand-rolled SQL queries in application code need manual back-ticking.

The cleanest audit path

Unlike sql_mode breakage (needs full query-corpus static analysis) or auth-plugin breakage (needs per-client-library audit), reserved-word breakage has a single SQL query that finds every collision:

-- Columns named with a new reserved word:
SELECT table_schema, table_name, column_name
FROM information_schema.columns
WHERE column_name IN (
    'active','admin','attribute','component','definition',
    'description','empty','exclude','finish','groups',
    'inactive','initial','lead','locked','member','nested',
    'off','old','organization','others','over','path',
    'process','random','rank','resource','returning',
    'reuse','role','skip','srid','stream','system',
    'ties','url','visible','zone'
);

-- Tables/indexes named similarly:
SELECT table_schema, table_name FROM information_schema.tables
WHERE table_name IN (...);

This makes reserved-word audit the most tractable of the 5.7 → 8.0 upgrade axes — a single query against information_schema on a running 5.7 server enumerates the complete remediation backlog before the upgrade is attempted.

Classification

Backward-compatibility hazard at the DDL-parsing altitude. The stored data is fine; the query semantics are fine; the auth path is fine. What breaks is the parser's grammar — what was a legal identifier is now a grammatical token with its own production rule.

Structurally, this is the vocabulary-expansion variant of the naming-trap backward-compat failure mode: the vendor adds a new SQL feature (window functions, JSON path expressions) that necessitates new keywords, and every schema that used those words as column names inherits the migration cost.

Seen in

  • sources/2026-04-21-planetscale-how-to-upgrade-from-mysql-57-to-80 — canonical wiki introduction. JD Lien's upgrade checklist enumerates ~40 new MySQL 8 reserved words and frames them as the cleanest-to-detect of the upgrade breakage axes ("you will need to change them to something else or ensure that you are quoting them") with a direct reference to the MySQL authoritative keyword list.
Last updated · 378 distilled / 1,213 read