P1-[4.0 bug hunting]-[SQL Plan Management]-Incorrect result for CAST to DATETIME #17809
Labels
component/expression
priority/P2
The issue has P2 priority.
severity/critical
sig/execution
SIG execution
type/bug
The issue is confirmed as a bug.
Bug Hunter issue tidb-challenge-program/bug-hunting-issue#13
Consider the following statements:
Unexpectedly, the
CAST
computesNULL
and prints a warning:This is unexpected, which can be also seen when directly using the constant, which computes the expected value:
This is problematic, since it can can result in an incorrect result for queries, which is demonstrated by the following query, which I used to find this bug:
I found this based on the 4.0 RC, and also found that this can be still reproduced on the latest master (7e71069):
MySQL 8.0.19 computes the result I would expect:
Since this bug causes an incorrect result bug, your classification seems to classify this bug as
P0
.The text was updated successfully, but these errors were encountered: