Skip to content

Commit b23bb5e

Browse files
committed
Fix handling of dropped attributes in pglogical_apply
1 parent b76df8e commit b23bb5e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

contrib/mmts/pglogical_apply.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,18 +413,24 @@ read_tuple_parts(StringInfo s, Relation rel, TupleData *tup)
413413

414414
rnatts = pq_getmsgint(s, 2);
415415

416-
if (desc->natts != rnatts)
416+
if (desc->natts < rnatts)
417417
elog(ERROR, "tuple natts mismatch, %u vs %u", desc->natts, rnatts);
418418

419419
/* FIXME: unaligned data accesses */
420420

421421
for (i = 0; i < desc->natts; i++)
422422
{
423423
Form_pg_attribute att = desc->attrs[i];
424-
char kind = pq_getmsgbyte(s);
424+
char kind;
425425
const char *data;
426426
int len;
427427

428+
if (att->atttypid == InvalidOid) {
429+
continue;
430+
}
431+
432+
kind = pq_getmsgbyte(s);
433+
428434
switch (kind)
429435
{
430436
case 'n': /* null */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy