Skip to content

Commit a9b4caf

Browse files
authored
Merge pull request #334 from Mytherin/issue319
Limit tids to POSTGRES_TID_MAX
2 parents 6647911 + 3857b7c commit a9b4caf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/postgres_scanner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static bool PostgresParallelStateNext(ClientContext &context, const FunctionData
341341
lstate.batch_idx = gstate.batch_idx++;
342342
if (gstate.page_idx < bind_data->pages_approx) {
343343
auto page_max = gstate.page_idx + bind_data->pages_per_task;
344-
if (page_max >= bind_data->pages_approx) {
344+
if (page_max >= bind_data->pages_approx || page_max > POSTGRES_TID_MAX) {
345345
// the relpages entry is not the real max, so make the last task bigger
346346
page_max = POSTGRES_TID_MAX;
347347
}

0 commit comments

Comments
 (0)