Bug #116705 MYSQL 8.0 add some reserved keyword which is not compatible
Submitted: 19 Nov 2024 8:50 Modified: 19 Nov 2024 10:07
Reporter: haizhen xue Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[19 Nov 2024 8:50] haizhen xue
Description:
MYSQL 8.0 add some reserved keyword which is not compatible when migrating from MySQL 5.7 to MySQL 8.0, for example, this statement below whill report syntax error, because CUME_DIST is reserved keyword added in 8.0.2.
create table CUME_DIST(CUME_DIST int);

How to repeat:
MYSQL 5.7 is ok, MYSQL 8.0 report syntax error:
create table CUME_DIST(CUME_DIST int);
create table DENSE_RANK(DENSE_RANK int);
create table FIRST_VALUE(FIRST_VALUE int);
create table LAG(LAG int);
create table LAST_VALUE(LAST_VALUE int);
create table LEAD(LEAD int);
create table NTH_VALUE(NTH_VALUE int);
create table NTILE(NTILE int);
create table PERCENT_RANK(PERCENT_RANK int);
create table RANK(RANK int);
create table ROW_NUMBER(ROW_NUMBER int);
[19 Nov 2024 8:52] haizhen xue
I expect to fix CUME_DIST to non-reserved keyword. is it OK?
[19 Nov 2024 9:28] MySQL Verification Team
Hi Mr. xue,

Thank you for your bug report.

However, this is not a bug.

All the names and symbols that you used in the provided example are reserved words in MySQL 8.0. All these symbols are used in queries with window functions, which are introduced in the version 8.0. If you search our Reference Manual for 8.0, you will find all those words being actually reserved symbols. Hence, they can not be used for your qualifiers.

Hence, you will have to rename all these table and column names to some unused titles.

Not a bug.
[19 Nov 2024 9:31] MySQL Verification Team
Hi Mr. xue,

You do have a workaround ........ You can use backticks for your table and column names, like this:

create table `FIRST_VALUE`(`FIRST_VALUE` int);

etc ........
[19 Nov 2024 10:07] haizhen xue
I think those reserved keyword should not be added to reserved keyword, if we fix those reserved keyword to non-reserved keyword, is it OK?
[19 Nov 2024 18:02] Roy Lyseng
All these keywords are marked as reserved in the SQL standard.
It is unlikely that we are going to change their status to non-reserved.