Skip to content

Commit 8d06dd9

Browse files
committed
Protect against extremely high InlineSortThreshold settings
1 parent f8a6c97 commit 8d06dd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jrd/optimizer/Optimizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@ SortedStream* Optimizer::generateSort(const StreamList& streams,
12481248
const auto dbb = tdbb->getDatabase();
12491249
const auto threshold = dbb->dbb_config->getInlineSortThreshold();
12501250

1251-
refetchFlag = (totalLength > threshold);
1251+
refetchFlag = (totalLength > MIN(threshold, MAX_SORT_RECORD / 2));
12521252
}
12531253

12541254
// Check for persistent fields to be excluded from the sort.

0 commit comments

Comments
 (0)