Skip to content

Commit 6a13747

Browse files
knizhnikkelvich
authored andcommitted
Fix handling of dropped attributes in pglogical_apply
1 parent 5433e7a commit 6a13747

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pglogical_apply.c

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

405405
rnatts = pq_getmsgint(s, 2);
406406

407-
if (desc->natts != rnatts)
407+
if (desc->natts < rnatts)
408408
elog(ERROR, "tuple natts mismatch, %u vs %u", desc->natts, rnatts);
409409

410410
/* FIXME: unaligned data accesses */
411411

412412
for (i = 0; i < desc->natts; i++)
413413
{
414414
Form_pg_attribute att = desc->attrs[i];
415-
char kind = pq_getmsgbyte(s);
415+
char kind;
416416
const char *data;
417417
int len;
418418

419+
if (att->atttypid == InvalidOid) {
420+
continue;
421+
}
422+
423+
kind = pq_getmsgbyte(s);
424+
419425
switch (kind)
420426
{
421427
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