Bug #115110 cast function describes the document error
Submitted: 24 May 2024 3:29 Modified: 15 Jul 2024 17:57
Reporter: hx dr5 Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[24 May 2024 3:29] hx dr5
Description:
in document 8.4 the cast function describe as follow:
CAST(expr AS type [ARRAY])
the [ARRAY] not effect in cast function.

How to repeat:
see https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html#function_cast
[24 May 2024 10:01] MySQL Verification Team
Thank you mr. dr5 on your documentation request.

We took a look at our 8.0 and 8.4 manuals and found that a description of casting to an ARRAY is not provided at all.

This is now a verified Documentation bug in 8.0 and higher.
[15 Jul 2024 17:57] Jon Stephens
The page you point to contains:

> In MySQL 8.0.17 and higher, InnoDB allows the use of an additional ARRAY 
> keyword for creating a multi-valued index on a JSON array as part of CREATE 
> INDEX, CREATE TABLE, and ALTER TABLE statements. ARRAY is not supported except 
> when used to create a multi-valued index in one of these statements, in which 
> case it is required. The column being indexed must be a column of type JSON. 
> With ARRAY, the type following the AS keyword may specify any of the types 
> supported by CAST(), with the exceptions of BINARY, JSON, and YEAR. For syntax 
> information and examples, as well as other relevant information, see Multi-
> Valued Indexes. 

https://dev.mysql.com/doc/refman/8.0/en/create-index.html#create-index-multi-valued provides additional info as stated above.

Not a bug.
[16 Jul 2024 10:10] MySQL Verification Team
Thank you, Jon.