From 7ca076b81a858f5a389a3bd20688d66d9d2755eb Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 24 May 2022 12:14:02 +0800 Subject: [PATCH] fix: add missing ( ) for precedence --- .../lib/dataMapper/lib/sql/formulav2/formulaQueryBuilderv2.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/formulav2/formulaQueryBuilderv2.ts b/packages/nocodb/src/lib/dataMapper/lib/sql/formulav2/formulaQueryBuilderv2.ts index 3a10ea4bd6..35e2ecab30 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/formulav2/formulaQueryBuilderv2.ts +++ b/packages/nocodb/src/lib/dataMapper/lib/sql/formulav2/formulaQueryBuilderv2.ts @@ -69,6 +69,7 @@ export default async function formulaQueryBuilderv2( model, { ...aliasToColumn, [col.id]: null } ); + builder.sql = '(' + builder.sql + ')'; aliasToColumn[col.id] = builder; } break;