Closed
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
create table t1 (i1 integer, c1 char);
insert into t1 values (2, 'a'), (1, 'b'), (3, 'c'), (0, null);
create table t2 (i2 integer, c2 char, f2 float);
insert into t2 values (0, 'c', null), (1, null, 0.1), (3, 'b', 0.01), (2, 'q', 0.12), (null, 'a', -0.1), (null, null, null);
SELECT count(_tmp_2._tmp_8) FROM t1 AS _tmp_1 JOIN (SELECT count(_tmp_3.i2) AS _tmp_8 FROM t2 AS _tmp_3 JOIN (SELECT count(_tmp_6.i2) AS _tmp_7 FROM t1 AS _tmp_5 JOIN t2 AS _tmp_6 WHERE _tmp_5.c1!=1 AND _tmp_6.c2>100 ORDER BY _tmp_5.i1) AS _tmp_4 GROUP BY _tmp_3.c2) AS _tmp_2;
2. What did you expect to see? (Required)
in MySQL:
+----------------------+
| count(_tmp_2._tmp_8) |
+----------------------+
| 20 |
+----------------------+
1 row in set, 4 warnings (0.00 sec)
3. What did you see instead (Required)
in TiDB:
+----------------------+
| count(_tmp_2._tmp_8) |
+----------------------+
| 0 |
+----------------------+
1 row in set, 7 warnings (0.00 sec)
The result is zero even type of t1.c1
and t2.c2
(char) is replaced with integer, so it is not due to truncated values (message in warnings)
4. What is your TiDB version? (Required)
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()
|
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-2968-g19e100c27-dirty
Edition: Community
Git Commit Hash: 19e100c27a37601d674df625034ebddb5196a299
Git Branch: master
UTC Build Time: 2021-05-23 15:35:12
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)