]> granicus.if.org Git - postgresql/commitdiff
Fix typo in tts_virtual_copyslot.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 22 Sep 2019 18:21:07 +0000 (14:21 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 22 Sep 2019 18:21:07 +0000 (14:21 -0400)
The code used the destination slot's natts where it intended to
use the source slot's natts.  Adding an Assert shows that there
is no case in "make check-world" where these counts are different,
so maybe this is a harmless bug, but it's still a bug.

Takayuki Tsunakawa

Discussion: https://postgr.es/m/0A3221C70F24FB45833433255569204D1FD34C0E@G01JPEXMBYT05

src/backend/executor/execTuples.c

index 5900d967a2d00ef52c0d3b337929c86fa116cd82..87bc510b31bff2a1a8946a15232441fb137a0ff4 100644 (file)
@@ -244,7 +244,7 @@ tts_virtual_materialize(TupleTableSlot *slot)
 static void
 tts_virtual_copyslot(TupleTableSlot *dstslot, TupleTableSlot *srcslot)
 {
-       TupleDesc       srcdesc = dstslot->tts_tupleDescriptor;
+       TupleDesc       srcdesc = srcslot->tts_tupleDescriptor;
 
        Assert(srcdesc->natts <= dstslot->tts_tupleDescriptor->natts);