MySQL 8.0: New Reserved Keywords Break Old Identifiers

Window functions and CTEs in MySQL 8.0 added new reserved words — column or table names matching one now need backtick-quoting they never needed on 5.7.

MySQL 5.7 → MySQL 8.0

Quick answer

MySQL 8.0 reserves additional words including OVER, RECURSIVE, ROW_NUMBER, RANK, LAG, LEAD, GROUPS, WINDOW, and others tied to its new window-function and CTE support. Any existing column, table, or alias name matching one of these now needs backtick-quoting that was optional on 5.7.

Why it matters

A schema or query that worked fine on 5.7 can fail with a syntax error on 8.0 purely because a column happens to be named `rank` or `window` — nothing about the query's logic changed, only the keyword list.

Example

MySQL 5.7
SELECT rank FROM leaderboard;
-- Valid on MySQL 5.7
MySQL 8.0
SELECT `rank` FROM leaderboard;
-- Required on MySQL 8.0+ since RANK is now a reserved word
The column name itself does not need to change — only whether it is backtick-quoted.

What to do about it

Migration steps

  • Before upgrading, check identifier names against MySQL 8.0's reserved-words list, prioritizing names related to ranking/ordering/windowing concepts.
  • Quote every identifier with backticks as a blanket policy going forward — it protects against future keyword additions in any subsequent MySQL (or MariaDB) release, not just this one.

References

  • MySQL 8.0 Reference Manual — Keywords and Reserved Words (v8.0) — checked 2026-07-31

Last verified 2026-07-31.