Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
11.4.2
-
None
-
ubuntu 20.04
Description
drop table if exists t; |
CREATE TABLE t (c1 FLOAT,c2 VARCHAR(20),key(c1)); |
INSERT INTO t VALUES (94.1106,'-0'),(1,'3 '),(0.0001,'-1'); |
|
SELECT f1 FROM (SELECT c1 AS f1 FROM t) AS t1 WHERE ((-f1)=ANY (SELECT c2 FROM t)); -- 1 |
|
|
SELECT f1 FROM (SELECT c1 AS f1 FROM t) AS t1 WHERE ((-f1)>=ANY (SELECT c2 FROM t)); -- empty set |
|
Logically, a sentence containing >=ANY should return a greater result than a sentence containing =ANY。
SELECT c1 AS f1 FROM t; |
result:
|
|
+---------+ |
| f1 |
|
+---------+ |
| 0.0001 |
|
| 1 |
|
| 94.1106 |
|
+---------+ |
So f1 should include 0.0001,1,94.1106.
SELECT c2 FROM t; |
--return -0,3,-1. |
Now ((-f1)>=ANY (SELECT c2 FROM t)) is equivalent to (-f1)>= (-1). The eligible F1s are 0.0001,1.
So the result of the second sql should be 0.0001,1, not the empty set.
Attachments
Issue Links
- duplicates
-
MDEV-30299 Result lost caused by key() [10.5.3,10.11.1]
- Confirmed