From 3ac9f94b314fc1835c058bd662592ea269d1aed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 25 Sep 2024 12:31:18 +0200 Subject: [PATCH] fix(MySQL Node): Fix "Maximum call stack size exceeded" error when handling a large number of rows --- packages/nodes-base/nodes/MySql/v1/MySqlV1.node.ts | 2 +- packages/nodes-base/nodes/MySql/v2/helpers/utils.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/nodes/MySql/v1/MySqlV1.node.ts b/packages/nodes-base/nodes/MySql/v1/MySqlV1.node.ts index 17923377fb6e5..6209111b67bae 100644 --- a/packages/nodes-base/nodes/MySql/v1/MySqlV1.node.ts +++ b/packages/nodes-base/nodes/MySql/v1/MySqlV1.node.ts @@ -327,7 +327,7 @@ export class MySqlV1 implements INodeType { { itemData: { item: index } }, ); - collection.push(...executionData); + collection = collection.concat(executionData); return collection; }, diff --git a/packages/nodes-base/nodes/MySql/v2/helpers/utils.ts b/packages/nodes-base/nodes/MySql/v2/helpers/utils.ts index 1e15ce71bb2ad..6e50ae3eb1c7d 100644 --- a/packages/nodes-base/nodes/MySql/v2/helpers/utils.ts +++ b/packages/nodes-base/nodes/MySql/v2/helpers/utils.ts @@ -141,7 +141,7 @@ export function prepareOutput( ) => NodeExecutionWithMetadata[], itemData: IPairedItemData | IPairedItemData[], ) { - const returnData: INodeExecutionData[] = []; + let returnData: INodeExecutionData[] = []; if (options.detailedOutput) { response.forEach((entry, index) => { @@ -154,7 +154,7 @@ export function prepareOutput( itemData, }); - returnData.push(...executionData); + returnData = returnData.concat(executionData); }); } else { response @@ -164,7 +164,7 @@ export function prepareOutput( itemData: Array.isArray(itemData) ? itemData[index] : itemData, }); - returnData.push(...executionData); + returnData = returnData.concat(executionData); }); }