From 9c269e18ffb4857dfc9c56ef67d583cd4b94b1dd Mon Sep 17 00:00:00 2001 From: James Petty Date: Mon, 20 Nov 2023 11:56:08 -0500 Subject: [PATCH] Fix loop index range in CombineHashFunction --- .../main/java/io/trino/operator/scalar/CombineHashFunction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/trino-main/src/main/java/io/trino/operator/scalar/CombineHashFunction.java b/core/trino-main/src/main/java/io/trino/operator/scalar/CombineHashFunction.java index 42e4ef800a35..d04b2b786010 100644 --- a/core/trino-main/src/main/java/io/trino/operator/scalar/CombineHashFunction.java +++ b/core/trino-main/src/main/java/io/trino/operator/scalar/CombineHashFunction.java @@ -36,7 +36,7 @@ public static void combineAllHashesWithConstant(long[] hashes, int fromIndex, in { checkFromToIndex(fromIndex, toIndex, hashes.length); - for (int i = 0; i < toIndex; i++) { + for (int i = fromIndex; i < toIndex; i++) { hashes[i] = (31 * hashes[i]) + value; } }