You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
-- docker run -d --name tidb -p 4000:4000 pingcap/tidb:latest
-- docker run -it --network="host" mysql:latest mysql -h 127.0.0.1 -P 4000 -u root
CREATE TABLE t0(c0 BOOL ZEROFILL AS (-1) VIRTUAL , c1 DECIMAL);
CREATE TABLE t2 (c2 BOOL);
INSERT IGNORE INTO t0(c1) VALUES (NULL);
ANALYZE TABLE t0;
CREATE INDEX i0 ON t0(c0 ASC, c1 DESC);
INSERT INTO t2(c2) VALUES (1);
-- The result of 'semi join' is absolutely contradictory with 'anti join'
SELECT * FROM t2 WHERE NOT EXISTS (SELECT 1 FROM t0 WHERE t2.c2 < t0.c0); -- expect: empty set
+------+
| c2 |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
SELECT * FROM t2 WHERE EXISTS (SELECT 1 FROM t0 WHERE t2.c2 < t0.c0);
+------+
| c2 |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
SELECT * FROM t2;
+------+
| c2 |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
SELECT * FROM t2 INNER JOIN t0 ON t2.c2 < t0.c0;
+------+------+------+
| c2 | c0 | c1 |
+------+------+------+
| 1 | 255 | NULL |
+------+------+------+
1 row in set (0.00 sec)
2. What did you expect to see? (Required)
SELECT * FROM t2 WHERE NOT EXISTS (SELECT 1 FROM t0 WHERE t2.c2 < t0.c0);
-- expect: empty set
3. What did you see instead (Required)
SELECT * FROM t2 WHERE NOT EXISTS (SELECT 1 FROM t0 WHERE t2.c2 < t0.c0); -- expect: empty set
+------+
| c2 |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
| Release Version: v7.5.1
Edition: Community
Git Commit Hash: 7d16cc7
Git Branch: heads/refs/tags/v7.5.1
UTC Build Time: 2024-02-27 14:28:32
GoVersion: go1.21.6
Race Enabled: false
Check Table Before Drop: false
Store: unistore |
The text was updated successfully, but these errors were encountered: