postgresql/src/backend
David Rowley d16a0c1e2e Verify that attribute counts match in ExecCopySlot
tts_virtual_copyslot() contained an Assert that checked that the srcslot
contained <= attributes than the dstslot.  This seems to be backwards as
if the srcslot contained fewer attributes then the dstslot could be left
with stale Datum values from the previously stored tuple.  It might make
more sense to allow the source to contain additional attributes and only
copy the leading ones that also exist in the destination, however, that's
not what we're doing here.

Here we just remove the Assert from tts_virtual_copyslot() and add an
Assert to ExecCopySlot() to verify the attribute counts match.  There
does not seem to be any places where the destination contains fewer
attributes, so instead of going to the trouble of making the code
properly handle this, let's just ensure the attribute counts match.  If
this Assert fails then that will indicate that we do have cases that
require us to handle the srcslot with more attributes than the dstslot.
It seems better to only write this code if there's a genuine requirement
for it rather than write it now only to leave it untested.

Thanks to Andres Freund for helping with the analysis of this.

Discussion: https://postgr.es/m/CAApHDvpMAvBL0T+TRORquyx1iqFQKMVTXtqNocOw0Pa2uh1heg@mail.gmail.com
2023-12-07 21:28:24 +13:00
..
access Fix compilation on Windows with WAL_DEBUG 2023-12-06 14:10:39 +09:00
archive Redesign archive modules 2023-02-17 14:26:42 +09:00
backup Change how a base backup decides which files have checksums. 2023-11-14 10:51:05 -05:00
bootstrap Remove distprep 2023-11-06 15:18:04 +01:00
catalog Optimize SearchPathCache by saving the last entry. 2023-12-04 17:19:16 -08:00
commands Improve some error messages with invalid indexes for REINDEX CONCURRENTLY 2023-12-07 14:27:54 +09:00
executor Verify that attribute counts match in ExecCopySlot 2023-12-07 21:28:24 +13:00
foreign Improve "user mapping not found" error message 2023-11-30 05:34:28 +01:00
jit Make ResourceOwners more easily extensible. 2023-11-08 13:30:50 +02:00
lib Make binaryheap available to frontend code. 2023-09-18 12:18:33 -07:00
libpq Apply quotes more consistently to GUC names in logs 2023-11-30 14:11:45 +09:00
main Remove obsolete defense against strxfrm() bugs. 2023-04-20 13:20:14 +12:00
nodes Remove distprep 2023-11-06 15:18:04 +01:00
optimizer Fix comment about ressortgrouprefs being unique in setop plans. 2023-11-28 14:15:14 +02:00
parser Clean up usage of bison precedence for non-operator keywords. 2023-11-28 13:32:15 -05:00
partitioning Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
po Translation updates 2023-08-07 12:39:30 +02:00
port Remove distprep 2023-11-06 15:18:04 +01:00
postmaster Remove now-unnecessary Autovacuum[Launcher|Worker]IAm functions 2023-12-04 15:34:37 +02:00
regex Add trailing commas to enum definitions 2023-10-26 09:20:54 +02:00
replication Fix indentation 2023-12-05 15:54:59 +01:00
rewrite Add TupleDescGetDefault() 2023-09-27 18:52:40 +01:00
snowball Remove distprep 2023-11-06 15:18:04 +01:00
statistics Retire MemoryContextResetAndDeleteChildren() macro. 2023-11-15 13:42:30 -06:00
storage Refactor how InitProcess is called 2023-12-03 16:39:18 +02:00
tcop Add support for REINDEX in event triggers 2023-12-04 09:53:49 +09:00
tsearch Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
utils Fix issues in binary_upgrade_logical_slot_has_caught_up(). 2023-12-07 08:42:48 +05:30
.gitignore
common.mk
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
meson.build Add win32ver data to meson-built postgres.exe. 2023-06-12 07:40:38 -07:00
nls.mk Remove distprep 2023-11-06 15:18:04 +01:00