Bug #118390 | When the time type is compared with the datetime type, the returned result is error | ||
---|---|---|---|
Submitted: | 8 Jun 8:04 | Modified: | 10 Jun 11:11 |
Reporter: | Alice Alice | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 8.0.41 | OS: | Linux |
Assigned to: | CPU Architecture: | x86 |
[8 Jun 8:04]
Alice Alice
[9 Jun 5:20]
MySQL Verification Team
Hello Alice Alice, Thank you for the report and feedback. regards, Umesh
[10 Jun 11:11]
Roy Lyseng
Posted by developer: This is not a bug. strcmp() converts its arguments to string values before comparison. IF analyzes its arguments and sees that both are temporal, thus it returns a compatible common temporal type, which is DATETIME. In order to convert the TIME values to DATETIME, the current date is added. To ensure that values are preserved, cast them to character strings in the IF clause.