Re: Don't overwrite scan key in systable_beginscan()
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-08-08T19:18:36Z
Lists: pgsql-hackers
On Thu, Aug 8, 2024 at 2:46 AM Peter Eisentraut <peter@eisentraut.org> wrote: > When systable_beginscan() and systable_beginscan_ordered() choose an > index scan, they remap the attribute numbers in the passed-in scan keys > to the attribute numbers of the index, and then write those remapped > attribute numbers back into the scan key passed by the caller. This > second part is surprising and gratuitous. It means that a scan key > cannot safely be used more than once (but it might sometimes work, > depending on circumstances). Also, there is no value in providing these > remapped attribute numbers back to the caller, since they can't do > anything with that. > > I propose to fix that by making a copy of the scan keys passed by the > caller and make the modifications there. This does have the disadvantage of adding more palloc overhead. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix temporary memory leak in system table index scans
- 1acf10549e64 18.0 landed
-
Don't overwrite scan key in systable_beginscan()
- 811af9786b91 18.0 landed
-
Replace gratuitous memmove() with memcpy()
- 8b5c6a54c439 18.0 landed