Skip to content

Commit dbfe1fb

Browse files
committed
DBZ-223 Handles dropped columns correctly.
1 parent d9415fc commit dbfe1fb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/decoderbufs.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ static void tuple_to_tuple_msg(Decoderbufs__DatumMessage **tmsg,
563563
Relation relation, HeapTuple tuple,
564564
TupleDesc tupdesc) {
565565
int natt;
566+
int valid_attr_cnt = 0;
566567
elog(DEBUG1, "processing tuple with %d columns", tupdesc->natts);
567568
/* build column names and values */
568569
for (natt = 0; natt < tupdesc->natts; natt++) {
@@ -611,8 +612,10 @@ static void tuple_to_tuple_msg(Decoderbufs__DatumMessage **tmsg,
611612
elog(DEBUG1, "column %s is null, ignoring value", attrName);
612613
}
613614

614-
tmsg[natt] = palloc(sizeof(datum_msg));
615-
memcpy(tmsg[natt], &datum_msg, sizeof(datum_msg));
615+
tmsg[valid_attr_cnt] = palloc(sizeof(datum_msg));
616+
memcpy(tmsg[valid_attr_cnt], &datum_msg, sizeof(datum_msg));
617+
618+
valid_attr_cnt++;
616619
}
617620
}
618621

0 commit comments

Comments
 (0)