Bug #108937 | Date value change caused by HAVING | ||
---|---|---|---|
Submitted: | 31 Oct 2022 13:30 | Modified: | 13 Dec 2022 4:03 |
Reporter: | ZongYin Hao | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 8.0.30 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | date, having |
[31 Oct 2022 13:30]
ZongYin Hao
[31 Oct 2022 14:14]
MySQL Verification Team
Hello ZongYin Hao, Thank you for the report and test case. regards, Umesh
[13 Dec 2022 4:03]
ZongYin Hao
We look for the first version of the bug in all docker images (with format x.x.x) of https://hub.docker.com/_/mysql/tags We found that the bug first occurred in mysql:5.6.17, it cannot be reproduced in mysql:5.5.62 (we can't find more intermediate versions in dockerhub): mysql> select version(); +-----------+ | version() | +-----------+ | 5.5.62 | +-----------+ 1 row in set (0.00 sec) mysql> SELECT c1-DATE_SUB('2008-05-25', INTERVAL 1 HOUR_MINUTE) AS f1 FROM t HAVING f1 != 0; +---------------------+ | f1 | +---------------------+ | -20080524235820.816 | | -20080524235887.008 | | -20080524235899 | +---------------------+ 3 rows in set (0.00 sec) mysql> SELECT c1-DATE_SUB('2008-05-25', INTERVAL 1 HOUR_MINUTE) AS f1 FROM t HAVING 1; +---------------------+ | f1 | +---------------------+ | -20080524235820.816 | | -20080524235887.008 | | -20080524235899 | +---------------------+ 3 rows in set (0.00 sec) Hope it can be helpful for your debugging.