Bug #118022 | between date and str_TO_DATE in select where returns incorrect result | ||
---|---|---|---|
Submitted: | 21 Apr 4:12 | Modified: | 28 Apr 12:23 |
Reporter: | Chunling Qin | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S2 (Serious) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[21 Apr 4:12]
Chunling Qin
[23 Apr 12:47]
Chunling Qin
It returns incorrect rusult, and can be easily reproduced.
[28 Apr 12:23]
MySQL Verification Team
Hello Chunling Qin, Thank you for the bug report. IMHO this is not a bug. Please use '%Y-%m-%d' instead of 'YYYY-MM-DD' Result of str_TO_DATE( '2019-03-20' ,'%Y-%m-%d HH24:MI:SS') + 1 gives 2019-03-21 The date not between '2019-03-20' and 2019-03-21 is 2020-01-01 as per inserted data. select t1.col_date from chqin t1 where t1.col_date NOT BETWEEN '2019-03-20' AND str_TO_DATE( '2019-03-20' ,'%Y-%m-%d HH24:MI:SS') + 1 ; col_date 2020-01-01 Regards, Ashwini Patil