Skip to content

Commit b5a85d6

Browse files
committed
[MOVE ME] Add smoke E2E test for limit 0 in sql template
1 parent 25dae18 commit b5a85d6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/cubejs-testing/test/smoke-cubesql.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@ describe('SQL API', () => {
390390
expect(res.rows).toEqual([]);
391391
});
392392

393+
test('zero limited dimension aggregated queries through wrapper', async () => {
394+
// Attempts to trigger query generation from SQL templates, not from Cube
395+
const query = 'SELECT MIN(t.maxval) FROM (SELECT MAX(createdAt) as maxval FROM Orders LIMIT 10) t LIMIT 0';
396+
const res = await connection.query(query);
397+
expect(res.rows).toEqual([]);
398+
});
399+
393400
test('select dimension agg where false', async () => {
394401
const query =
395402
'SELECT MAX("createdAt") AS "max" FROM "BigOrders" WHERE 1 = 0';

0 commit comments

Comments
 (0)