Bug #97290 json function member of naming inconsistent / bad choice
Submitted: 18 Oct 2019 13:52 Modified: 7 Nov 2019 7:37
Reporter: Ron Hughes Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: JSON Severity:S4 (Feature request)
Version:8.0.17 OS:Any
Assigned to: CPU Architecture:Any

[18 Oct 2019 13:52] Ron Hughes
Description:
Our database conversion from 5.7 to >= 8.0.17 fails because "member" was added as a reserved object identifier.  The JSON "member of" function was introduced in version 8.0.17 (https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#operator_member-of).  We have a table called member in a database filled with members for our products -- with many, many, many years of application collateral referencing that table.  The JSON "member of" function is an incredibly poor choice in naming.  How many other databases running on top of MySql in the world use member as an object identifier.  Beyond that, every other JSON function in this area of MySql is prefixed with "JSON_" and any other subsequent words separated by underscores and not spaces (e.g. any other function listed in https://dev.mysql.com/doc/refman/8.0/en/json-function-reference.html).  We are left with the difficult choices of 1) not upgrading or 2) spending an enormous amount of developer time (money, sacrificing other projects, etc.) going through the code base and either fully qualifying table names or escaping through quoting (e.g. backticks).

How to repeat:
Create a table in MySQL version 5.7 called member, add a couple of columns, add a trigger on that table, run through the upgrade process from 5.7 to >= 8.0.17.

Suggested fix:
Change this inconsistent naming from "member of" to "JSON_MEMBER_OF".
[18 Oct 2019 14:09] MySQL Verification Team
Hi Mr. Hughes,

Thank you for your bug report.

Unfortunately, this report can not be treated as a bug, since the change of the function names can be done only in a future release.

However, this is a valid feature request.

Verified as a feature request.
[18 Oct 2019 14:59] MySQL Verification Team
That is yet to be decided by a team that works on the design of future versions and / or releases. We do not have access to their decisions.
[5 Nov 2019 11:42] Knut Anders Hatlen
Hi Ron,

A similar problem was reported in bug#96288. I think it's unlikely that it will be fixed by renaming the MEMBER OF operator, since the name comes from the SQL standard. Another more likely solution to the upgrade problem is to make MEMBER a non-reserved word, like it was before 8.0.17.
[5 Nov 2019 13:12] MySQL Verification Team
Thank you, Knut !!!!!
[7 Nov 2019 7:37] Knut Anders Hatlen
Bug#96288 will be fixed by making "member", and also "array", non-reserved words again. So the fix for that bug will also fix the problem reported here. Closing this bug as a duplicate of bug#96288.
[7 Nov 2019 13:23] MySQL Verification Team
Thank you, Knut ........