Skip to content

Commit fd3ba4e

Browse files
committed
Improve isNull check in ArrayBlock positions copy
1 parent 46c9992 commit fd3ba4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/trino-spi/src/main/java/io/trino/spi/block/ArrayBlock.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ public ArrayBlock copyPositions(int[] positions, int offset, int length)
238238
IntArrayList valuesPositions = new IntArrayList();
239239
for (int i = 0; i < length; i++) {
240240
int position = positions[offset + i];
241-
if (newValueIsNull != null && isNull(position)) {
241+
checkReadablePosition(this, position);
242+
if (valueIsNull != null && valueIsNull[position + arrayOffset]) {
242243
hasNull = true;
243244
newValueIsNull[i] = true;
244245
newOffsets[i + 1] = newOffsets[i];

0 commit comments

Comments
 (0)