Bug #101994 Failed to create function index, column name is uppercase character
Submitted: 15 Dec 2020 8:27 Modified: 4 Jan 2021 14:10
Reporter: qingsong 丁 Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:8.0, 8.0.22 OS:Linux
Assigned to: CPU Architecture:Any
Tags: Unknow column 'NAME' in 'functional index'

[15 Dec 2020 8:27] qingsong 丁
Description:
I want to create a functional index for characters using the substr function。
However, I found that when the column name in the substr function is capitalized, an error is reported.

How to repeat:
mysql> create table t1 (id id, name varchar(50), index (NAME)) charset=utf8mb4 collate=utf8mb4_0900_ai_ci;
Query OK, 0 rows affected (0.07 sec)

mysql> create table t1 (id id, name varchar(50), index ((substr(NAME, 1, 2)))) charset=utf8mb4 collate=utf8mb4_0900_ai_ci;
ERROR 1054 (42S22):Unknow column 'NAME' in 'functional index'

Suggested fix:
Column names ignore case when creating a functional index。
Thank you very much.
[15 Dec 2020 9:23] MySQL Verification Team
Hello!

Thank you for the report and feedback.

regards,
Umesh
[4 Jan 2021 14:10] Paul DuBois
Posted by developer:
 
Fixed in 8.0.24.

Functional index creation did not handle the column name as not
case-sensitive.