From 98bb6fe13fcb98fbc7f5913e7fb70f80bf8eaeb4 Mon Sep 17 00:00:00 2001 From: apeng-singlestore <127370261+apeng-singlestore@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:22:17 -0400 Subject: [PATCH] fix "'set operations (union all) from query builder'" test --- .../tests/singlestore/singlestore-common.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/integration-tests/tests/singlestore/singlestore-common.ts b/integration-tests/tests/singlestore/singlestore-common.ts index a6edbbf6f..ab2f08b48 100644 --- a/integration-tests/tests/singlestore/singlestore-common.ts +++ b/integration-tests/tests/singlestore/singlestore-common.ts @@ -2624,18 +2624,20 @@ export function tests(driver?: string) { })()).rejects.toThrowError(); }); - test('set operations (union all) from query builder', async (ctx) => { + test.only('set operations (union all) from query builder', async (ctx) => { const { db } = ctx.singlestore; await setupSetOperationTest(db); - const result = await db + const sq = db .select({ id: citiesTable.id, name: citiesTable.name }) - .from(citiesTable).limit(2).unionAll( + .from(citiesTable).orderBy(asc(sql`id`)).limit(2).unionAll( db .select({ id: citiesTable.id, name: citiesTable.name }) - .from(citiesTable).limit(2), - ).orderBy(asc(sql`id`)).limit(3); + .from(citiesTable).orderBy(asc(sql`id`)).limit(2), + ).as('sq'); + + const result = await db.select().from(sq).orderBy(asc(sql`id`)).limit(3); expect(result).toHaveLength(3);