Unexpected results of ANY
operator
#44706
Labels
fuzz/sqlancer
severity/moderate
sig/execution
SIG execution
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Consider the following program:
The second one is equivalent to the third one, because both the inner query of them return
NULL
. I believe the third one returns an incorrect result because(~ ('n') = ANY (SELECT MIN(t0.c2) FROM t0 WHERE false))
should returnNULL
as described in the document of MySQL https://dev.mysql.com/doc/refman/8.0/en/any-in-some-subqueries.htmlAnd
-1 <= NULL
also equals toNULL
, then this query should have an empty result.I also check this program in MySQL, and get empty result on this query. https://www.db-fiddle.com/f/5JLDSSaK6mWoXZyHEr64a5/0
2. What did you expect to see? (Required)
The third query returns an empty result.
3. What did you see instead (Required)
The third query returns a non-empty result.
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: