Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
5.5.2
-
None
-
2021-1, 2021-2
Description
See regression/mysql/queries/working_tpch1_compareLogOnly/view/mts_view.sql:
CREATE TABLE t1 (lid int, name char(10)) engine=columnstore; |
INSERT INTO t1 (lid, name) VALUES (1, 'YES'), (2, 'NO'); |
|
CREATE TABLE t2 ( id int, gid int, lid int, dt date) engine=columnstore; |
INSERT INTO t2 (id, gid, lid, dt) VALUES |
(1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'), |
(3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02'); |
|
SELECT DISTINCT t2.gid,(SELECT t1.name FROM t1, t2 WHERE t1.lid = t2.lid AND t2.gid = t1.lid and t1.lid =1 ) as clid FROM t2 order by 1,2; |
+------+------+
|
| gid | clid |
|
+------+------+
|
| 1 | YES |
|
| 2 | YES |
|
+------+------+
|
However, if you strip off the order by, you get
SELECT DISTINCT t2.gid,(SELECT t1.name FROM t1, t2 WHERE t1.lid = t2.lid AND t2.gid = t1.lid and t1.lid =1 ) as clid FROM t2; |
+------+------+
|
| gid | clid |
|
+------+------+
|
| 1 | YES |
|
| 1 | YES |
|
| 2 | YES |
|
| 2 | YES |
|
+------+------+
|
There should only be two rows returned
Attachments
Issue Links
- is caused by
-
MCOL-4455 "SELECT DISTINCT col FROM table LIMIT O,N" ignores offset
- Closed