Skip to content

Commit

Permalink
Fix VACUUM FULL
Browse files Browse the repository at this point in the history
VACUUM FULL rewrites tuple in order to possibly compact them after
columns drops etc. And when it calls `raw_pg_tde_insert` buffer of
the `RewriteState` is not valid as the Page is being built. So we have
to use the block num from `RewriteState`.
  • Loading branch information
dAdAbird authored and codeforall committed Sep 18, 2023
1 parent c490ff6 commit c69f1cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/access/pg_tde_rewrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ raw_pg_tde_insert(RewriteState state, HeapTuple tup)
}

/* And now we can insert the tuple into the page */
newoff = TDE_PageAddItem(heaptup->t_tableOid, BufferGetBlockNumber(state->rs_buffer), page, (Item) heaptup->t_data, heaptup->t_len,
newoff = TDE_PageAddItem(heaptup->t_tableOid, state->rs_blockno, page, (Item) heaptup->t_data, heaptup->t_len,
InvalidOffsetNumber, false, true);
if (newoff == InvalidOffsetNumber)
elog(ERROR, "failed to add tuple");
Expand Down

0 comments on commit c69f1cd

Please sign in to comment.