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)
drop table if exists t, t1;
create table t1(c_int int);
create table t(c_int int);
insert into t values(1),(2),(3),(4),(5),(6),(7),(8),(9);
begin;
insert into t1 values(18);
select (select min(t1.c_int) from t1 where t1.c_int > t.c_int), (select max(t1.c_int) from t1 where t1.c_int> t.c_int), (select sum(t1.c_int) from t1 where t1.c_int> t.c_int) from t;
rollback;
2. What did you expect to see? (Required)
mysql> select (select min(t1.c_int) from t1 where t1.c_int > t.c_int), (select max(t1.c_int) from t1 where t1.c_int> t.c_int), (select sum(t1.c_int) from t1 where t1.c_int> t.c_int) from t;
+---------------------------------------------------------+--------------------------------------------------------+--------------------------------------------------------+
| (select min(t1.c_int) from t1 where t1.c_int > t.c_int) | (select max(t1.c_int) from t1 where t1.c_int> t.c_int) | (select sum(t1.c_int) from t1 where t1.c_int> t.c_int) |
+---------------------------------------------------------+--------------------------------------------------------+--------------------------------------------------------+
| 18 | 18 | 18 |
| 18 | 18 | 18 |
| 18 | 18 | 18 |
| 18 | 18 | 18 |
| 18 | 18 | 18 |
| 18 | 18 | 18 |
| 18 | 18 | 18 |
| 18 | 18 | 18 |
| 18 | 18 | 18 |
+---------------------------------------------------------+--------------------------------------------------------+--------------------------------------------------------+
9 rows in set (0.00 sec)
3. What did you see instead (Required)
mysql> select (select min(t1.c_int) from t1 where t1.c_int > t.c_int), (select max(t1.c_int) from t1 where t1.c_int> t.c_int), (select sum(t1.c_int) from t1 where t1.c_int> t.c_int) from t;
+---------------------------------------------------------+--------------------------------------------------------+--------------------------------------------------------+
| (select min(t1.c_int) from t1 where t1.c_int > t.c_int) | (select max(t1.c_int) from t1 where t1.c_int> t.c_int) | (select sum(t1.c_int) from t1 where t1.c_int> t.c_int) |
+---------------------------------------------------------+--------------------------------------------------------+--------------------------------------------------------+
| 18 | 18 | 18 |
| 18 | 18 | 36 |
| 18 | 18 | 54 |
| 18 | 18 | 72 |
| 18 | 18 | 90 |
| 18 | 18 | 108 |
| 18 | 18 | 126 |
| 18 | 18 | 144 |
| 18 | 18 | 162 |
+---------------------------------------------------------+--------------------------------------------------------+--------------------------------------------------------+
9 rows in set (0.01 sec)
4. What is your TiDB version? (Required)
master & release-4.0
The text was updated successfully, but these errors were encountered:
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)
master & release-4.0
The text was updated successfully, but these errors were encountered: