postgresql/src/backend
Peter Eisentraut 811af9786b Don't overwrite scan key in systable_beginscan()
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.

Fix that by making a copy of the scan keys passed by the caller and
make the modifications there.

Also, some code that had to work around the previous situation is
simplified.

Discussion: https://www.postgresql.org/message-id/flat/f8c739d9-f48d-4187-b214-df3391ba41ab@eisentraut.org
2024-09-12 10:48:39 +02:00
..
access Don't overwrite scan key in systable_beginscan() 2024-09-12 10:48:39 +02:00
archive Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
backup Define PG_TBLSPC_DIR for path pg_tblspc/ in data folder 2024-09-03 09:11:54 +09:00
bootstrap Include bison header files into implementation files 2024-08-02 10:25:11 +02:00
catalog Collect statistics about conflicts in logical replication. 2024-09-04 08:55:21 +05:30
commands Adjust tuplestore stats API 2024-09-12 16:02:01 +12:00
executor SQL/JSON: Avoid initializing unnecessary ON ERROR / ON EMPTY steps 2024-09-09 13:46:58 +09:00
foreign Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:33 -07:00
jit Speed up Hash Join by making ExprStates support hashing 2024-08-20 13:38:22 +12:00
lib Implement pg_wal_replay_wait() stored procedure 2024-08-02 21:16:56 +03:00
libpq Remove obsolete unconstify() 2024-09-11 09:18:12 +02:00
main Tighten check for --forkchild argument when spawning child process 2024-07-03 15:53:30 +03:00
nodes Introduce an RTE for the grouping step 2024-09-10 12:35:34 +09:00
optimizer Add amgettreeheight index AM API routine 2024-09-10 10:03:23 +02:00
parser Remove incorrect Assert. 2024-09-11 11:41:47 -04:00
partitioning Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 18:48:48 +03:00
po Translation updates 2024-06-24 13:11:27 +02:00
port Require memory barrier support. 2024-07-30 23:01:55 +12:00
postmaster Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
regex Remove lc_ctype_is_c(). 2024-09-06 13:23:21 -07:00
replication Improve assertion in FindReplTupleInLocalRel(). 2024-09-11 09:18:23 +05:30
rewrite Avoid inserting PlaceHolderVars in cases where pre-v16 PG did not. 2024-08-30 12:42:12 -04:00
snowball Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
statistics Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
storage Unify some error messages to ease work of translators 2024-09-04 14:53:18 +09:00
tcop Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 18:48:48 +03:00
tsearch Constify fields and parameters in spell.c 2024-08-06 23:04:51 +03:00
utils Don't overwrite scan key in systable_beginscan() 2024-09-12 10:48:39 +02:00
.gitignore
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile Fix make build on MinGW 2024-06-21 08:17:23 +02:00
meson.build meson: Fix import library name in Windows 2024-06-20 09:08:36 +02:00
nls.mk Add missing gettext triggers 2024-05-14 12:57:22 +02:00