Details
Description
【重现步骤】
1、创建表 t1,插入数据
create table t1(id int primary key auto_increment, c1 int) engine=innodb; |
insert into t1(c1) values(1),(2),(3); |
2、执行以下查询
(select * from t1 where c1>=1 limit 2,1) union ALL (select * from t1 where c1>1 order by c1 desc); |
+----+------+
|
| id | c1 |
|
+----+------+
|
| 3 | 3 |
|
| 2 | 2 |
|
| 3 | 3 |
|
+----+------+
|
3、加 limit ,检查结果
(select * from t1 where c1>=1 limit 2,1) union ALL (select * from t1 where c1>1 order by c1 desc) limit 2; |
【预期结果】
+----+------+
|
| id | c1 |
|
+----+------+
|
| 3 | 3 |
|
| 2 | 2 |
|
+----+-----+
|
【实际结果】
空