Tiny Tweak: Future Reserved Words
Suppose you create a table like this:
CREATE TABLE t (current_role INT);
It works in MySQL 5.1. But it might fail in MySQL 7.0.
The problem is that CURRENT_ROLE might be a reserved word if we implement “Roles” as described in the worklog task description
Roles and the warning is right there in the description: “CURRENT_ROLE is a new reserved word”. The task description might change before we implement it, and your application might change too, after all MySQL 7.0 alpha is far from imminent. But if you have an inkling of our plans for reserved words later, maybe you’ll want to avoid using them now.
These words are marked as “possibly reserved” in some future version:
ARRAY AUDIT BOOLEAN CIDR CONNECT CUBE CURRENT CURRENT_CATALOG CURRENT_PATH CURRENT_ROLE CYCLE DEFAULT DENSE_RANK EXCEPT FOR GET INET INTERSECT MACADDR MERGE NEW NONE OLD OVER PARTITION RANK RESIGNAL ROWNUM ROWNUM ROW_NUMBER ROWS SESSION_USER SIGNAL START SOME SYSTEM_USER TRUNC UNKNOWN WINDOW
A longer list, including words that are in standard SQL or other vendors’ products, can be found in the article SQL Naming Conventions.

Leave a Reply