| Bug #105015 | The variable declared by the current_date function does not respect the charset | ||
|---|---|---|---|
| Submitted: | 23 Sep 2021 8:51 | Modified: | 24 Sep 2021 15:13 |
| Reporter: | Marco Cristofanilli | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: Data Types | Severity: | S4 (Feature request) |
| Version: | 8.0 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | current_date | ||
[23 Sep 2021 8:51]
Marco Cristofanilli
[23 Sep 2021 14:55]
MySQL Verification Team
Hi Mr. Cristofanilli, Thank you for your bug report. However, this is not a bug. Simply, current_date() returns the result in Latin1. And you can not collate Latin1 into UTF, after you have assigned that value to user-defined variable. Simply, user variable is defined fully by the output from the right hand side !!!!! However, if you first collate the output from current_date() then assign it to user-defined variable it will work. So, this is not a bug, but if you would like to make it a feature request, we would be very much willing to verify it as a nice feature request.
[24 Sep 2021 13:08]
Marco Cristofanilli
Thanks, I turned the request into a feature request, it would definitely be useful for current_date() to return the result based on the character_set_connection and collation_connection variables
[24 Sep 2021 14:36]
MySQL Verification Team
Hi Mr. Cristofanilli, But, that definition of the feature request is unreal. The only feature request that is acceptable is the one where the expression of this type: SELECT @date collate utf8mb4_unicode_ci; would change a character set and a collation of the user variable of the DATE/DATETIME type. If you agree with this, we can verify it as such.
[24 Sep 2021 14:43]
Marco Cristofanilli
I don't understand why the current_date() function always returns with Latin1 encoding even if all user variables have other chaersets defined.
[24 Sep 2021 14:47]
MySQL Verification Team
This is due to the very specific set of characters that these functions are returning.
[24 Sep 2021 14:50]
Marco Cristofanilli
Okay, clear. If you think it's interesting, it might be useful to impementation of SELECT @date collate utf8mb4_unicode_ci; Thanks
[24 Sep 2021 15:13]
MySQL Verification Team
Hi Mr. Cristofanilli, You are truly welcome. Verified as a feature request.
