Bug #106226 | cast expression result is different when used with least expression | ||
---|---|---|---|
Submitted: | 20 Jan 2022 10:12 | Modified: | 20 Jan 2022 12:57 |
Reporter: | jiangtao guo | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 8.0.23, 5.7.37, 8.0.28 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[20 Jan 2022 10:12]
jiangtao guo
[20 Jan 2022 10:17]
MySQL Verification Team
Hello jiangtao, Thank you for the report and test case. regards, Umesh
[20 Jan 2022 12:57]
Roy Lyseng
Posted by developer: This is not a bug. The result of the LEAST function is a timestamp, which cast to an integer gives 20010101000000. The other CAST statement tries to interpret a character string as an integer, which stops at the first '-'. You may want to use this statement instead: select cast(timestamp'2001-01-01 00:00:00.1' as signed) from t1;