Skip to content

Commit 0668366

Browse files
committed
Some SQL queries related to [CALCITE-709] are now working correctly
1 parent d0e0d0e commit 0668366

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

core/src/test/resources/sql/scalar.iq

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -150,52 +150,48 @@ select deptno, (select sum(empno) from "scott".emp where 1 = 0 group by ()) as x
150150
!ok
151151

152152
# [CALCITE-709] Errors with LIMIT inside scalar sub-query
153-
!if (false) {
154-
select deptno, (select sum(empno) from "scott".emp where deptno = dept.deptno limit 1) as x from "scott".dept;
155-
+--------+----------------------+
156-
| DEPTNO | X |
157-
+--------+----------------------+
158-
| 10 | 23555 |
159-
| 20 | 38501 |
160-
| 30 | 46116 |
161-
| 40 | null |
162-
+--------+----------------------+
153+
select deptno, (select sum(cast(empno as bigint)) from "scott".emp where deptno = dept.deptno limit 1) as x from "scott".dept;
154+
+--------+-------+
155+
| DEPTNO | X |
156+
+--------+-------+
157+
| 10 | 23555 |
158+
| 20 | 38501 |
159+
| 30 | 46116 |
160+
| 40 | |
161+
+--------+-------+
163162
(4 rows)
164163

165164
!ok
166-
!}
167165

168166
# [CALCITE-709] Errors with LIMIT inside scalar sub-query
169167
!if (false) {
170168
select deptno, (select sum(empno) from "scott".emp where deptno = dept.deptno limit 0) as x from "scott".dept;
171-
+--------+----------------------+
172-
| DEPTNO | X |
173-
+--------+----------------------+
174-
| 10 | 23555 |
175-
| 20 | 38501 |
176-
| 30 | 46116 |
177-
| 40 | null |
178-
+--------+----------------------+
169+
+--------+-------+
170+
| DEPTNO | X |
171+
+--------+-------+
172+
| 10 | 23555 |
173+
| 20 | 38501 |
174+
| 30 | 46116 |
175+
| 40 | |
176+
+--------+-------+
179177
(4 rows)
180178

181179
!ok
182180
!}
183181

184182
# [CALCITE-709] Errors with LIMIT inside scalar sub-query
185-
!if (false) {
186183
select deptno, (select deptno from "scott".emp where deptno = dept.deptno limit 1) as x from "scott".dept;
187-
+--------+------+
188-
| DEPTNO | X |
189-
+--------+------+
190-
| 10 | 10 |
191-
| 20 | 20 |
192-
| 30 | 30 |
193-
| 40 | null |
194-
+--------+------+
184+
+--------+----+
185+
| DEPTNO | X |
186+
+--------+----+
187+
| 10 | 10 |
188+
| 20 | 20 |
189+
| 30 | 30 |
190+
| 40 | |
191+
+--------+----+
195192
(4 rows)
196193

197194
!ok
198-
!}
199195

200196
select deptno, (select deptno from "scott".emp where deptno = dept.deptno limit 0) as x from "scott".dept;
201197
+--------+---+

0 commit comments

Comments
 (0)