Skip to content

Commit

Permalink
[MOVE ME] Add smoke E2E test for limit 0 in sql template
Browse files Browse the repository at this point in the history
  • Loading branch information
mcheshkov committed Oct 4, 2024
1 parent 25dae18 commit b5a85d6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/cubejs-testing/test/smoke-cubesql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,13 @@ describe('SQL API', () => {
expect(res.rows).toEqual([]);
});

test('zero limited dimension aggregated queries through wrapper', async () => {
// Attempts to trigger query generation from SQL templates, not from Cube
const query = 'SELECT MIN(t.maxval) FROM (SELECT MAX(createdAt) as maxval FROM Orders LIMIT 10) t LIMIT 0';
const res = await connection.query(query);
expect(res.rows).toEqual([]);
});

test('select dimension agg where false', async () => {
const query =
'SELECT MAX("createdAt") AS "max" FROM "BigOrders" WHERE 1 = 0';
Expand Down

0 comments on commit b5a85d6

Please sign in to comment.