forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd16a0c1
committed
Verify that attribute counts match in ExecCopySlot
tts_virtual_copyslot() contained an Assert that checked that the srcslotcontained <= attributes than the dstslot. This seems to be backwards asif the srcslot contained fewer attributes then the dstslot could be leftwith stale Datum values from the previously stored tuple. It might makemore sense to allow the source to contain additional attributes and onlycopy the leading ones that also exist in the destination, however, that'snot what we're doing here.Here we just remove the Assert from tts_virtual_copyslot() and add anAssert to ExecCopySlot() to verify the attribute counts match. Theredoes not seem to be any places where the destination contains fewerattributes, so instead of going to the trouble of making the codeproperly handle this, let's just ensure the attribute counts match. Ifthis Assert fails then that will indicate that we do have cases thatrequire us to handle the srcslot with more attributes than the dstslot.It seems better to only write this code if there's a genuine requirementfor 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.com1 parentd43bd09 commitd16a0c1
2 files changed
+9
-3
lines changedLines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
253 | 253 |
| |
254 | 254 |
| |
255 | 255 |
| |
256 |
| - | |
257 |
| - | |
258 | 256 |
| |
259 | 257 |
| |
260 | 258 |
| |
|
Lines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
174 | 174 |
| |
175 | 175 |
| |
176 | 176 |
| |
177 |
| - | |
| 177 | + | |
| 178 | + | |
178 | 179 |
| |
179 | 180 |
| |
180 | 181 |
| |
| |||
477 | 478 |
| |
478 | 479 |
| |
479 | 480 |
| |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
480 | 486 |
| |
481 | 487 |
| |
482 | 488 |
| |
483 | 489 |
| |
484 | 490 |
| |
485 | 491 |
| |
| 492 | + | |
| 493 | + | |
486 | 494 |
| |
487 | 495 |
| |
488 | 496 |
| |
|
0 commit comments
Comments
(0)