On 25/07/2022 00:35, Thomas Munro wrote:
On Mon, Jul 25, 2022 at 6:22 AM Heikki Linnakangas <hlinn...@iki.fi> wrote:
ReadRecentBuffer() doesn't work for local buffers, i.e. for temp tables.
The bug is pretty clear if you look at the code:
- bufHdr = GetBufferDescriptor(-recent_buffer - 1);
+ int b = -recent_buffer - 1;
+
+ bufHdr = GetLocalBufferDescriptor(b);
Ugh, right. Obviously this code path is not reached currently. I
added the local path for completeness but I didn't think of the idea
of testing it the way you suggested, hence thinko escaped into the
wild. That way of testing seems good and the patch indeed fixes the
problem.
Pushed, thanks for the reviews.
- Heikki