Bug #108207 information schema view return wrong data type
Submitted: 21 Aug 2022 13:35 Modified: 22 Aug 2022 12:49
Reporter: raymond astri Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Data Types Severity:S3 (Non-critical)
Version:8.0 OS:Any (Centos, window)
Assigned to: CPU Architecture:Any
Tags: view as table

[21 Aug 2022 13:35] raymond astri
Description:
wrong data_type in information_schema.views for columns resulting to a function with return type = enum or set. The resulting view column datatype is varchar.
example :

CREATE DEFINER=`dbadmin`@`%` FUNCTION `test_enum`() 
RETURNS enum('no','yes') CHARSET utf8mb4
DETERMINISTIC
BEGIN
RETURN 'yes';
END

CREATE 
    ALGORITHM = UNDEFINED 
    DEFINER = `dbadmin`@`%` 
    SQL SECURITY DEFINER
VIEW `hbtmp`.`test_enum` AS
    SELECT `hbtmp`.`test_enum`() AS `toto`

show columns from`hbtmp`.`test_enum`
toto	varchar(3)	YES		

in 5.7 result is correct
toto	enum('no','yes')	YES		

How to repeat:
command retrun always same result 
show columns from`hbtmp`.`test_enum`
toto	varchar(3)	YES

Suggested fix:
no suggestion
[22 Aug 2022 12:49] MySQL Verification Team
Hi Mr. astri,

Thank you for your bug report.

We have managed to repeat it, so this is now a verified bug.

It could be possible that this is a change that was intended, which would mean that a category might be changed to 'Documentation'. In that case, you will be informed about it.