aboutsummaryrefslogtreecommitdiff
path: root/contrib/test_decoding/test_decoding.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-03-07 17:02:48 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2014-03-07 17:03:26 -0500
commitea177a3ba7a7901f6467eadb0a407e03d46462fd (patch)
treeeab3ef55a25f72fe0ea2941cb0c2251e45d2db78 /contrib/test_decoding/test_decoding.c
parent83204e100c7855a50ccffd761bcd45474955b5fb (diff)
downloadpostgresql-ea177a3ba7a7901f6467eadb0a407e03d46462fd.tar.gz
postgresql-ea177a3ba7a7901f6467eadb0a407e03d46462fd.zip
Remove unportable use of anonymous unions from reorderbuffer.h.
In b89e151054a I had assumed it was ok to use anonymous unions as struct members, but while a longstanding extension in many compilers, it's only been standardized in C11. To fix, remove one of the anonymous unions which tried to hide some implementation specific enum values and give the other a name. The latter unfortunately requires changes in output plugins, but since the feature has only been added a few days ago... Andres Freund
Diffstat (limited to 'contrib/test_decoding/test_decoding.c')
-rw-r--r--contrib/test_decoding/test_decoding.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c
index ea463fb2e7c..e356c7ca675 100644
--- a/contrib/test_decoding/test_decoding.c
+++ b/contrib/test_decoding/test_decoding.c
@@ -358,43 +358,45 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
{
case REORDER_BUFFER_CHANGE_INSERT:
appendStringInfoString(ctx->out, " INSERT:");
- if (change->tp.newtuple == NULL)
+ if (change->data.tp.newtuple == NULL)
appendStringInfoString(ctx->out, " (no-tuple-data)");
else
tuple_to_stringinfo(ctx->out, tupdesc,
- &change->tp.newtuple->tuple,
+ &change->data.tp.newtuple->tuple,
false);
break;
case REORDER_BUFFER_CHANGE_UPDATE:
appendStringInfoString(ctx->out, " UPDATE:");
- if (change->tp.oldtuple != NULL)
+ if (change->data.tp.oldtuple != NULL)
{
appendStringInfoString(ctx->out, " old-key:");
tuple_to_stringinfo(ctx->out, tupdesc,
- &change->tp.oldtuple->tuple,
+ &change->data.tp.oldtuple->tuple,
true);
appendStringInfoString(ctx->out, " new-tuple:");
}
- if (change->tp.newtuple == NULL)
+ if (change->data.tp.newtuple == NULL)
appendStringInfoString(ctx->out, " (no-tuple-data)");
else
tuple_to_stringinfo(ctx->out, tupdesc,
- &change->tp.newtuple->tuple,
+ &change->data.tp.newtuple->tuple,
false);
break;
case REORDER_BUFFER_CHANGE_DELETE:
appendStringInfoString(ctx->out, " DELETE:");
/* if there was no PK, we only know that a delete happened */
- if (change->tp.oldtuple == NULL)
+ if (change->data.tp.oldtuple == NULL)
appendStringInfoString(ctx->out, " (no-tuple-data)");
/* In DELETE, only the replica identity is present; display that */
else
tuple_to_stringinfo(ctx->out, tupdesc,
- &change->tp.oldtuple->tuple,
+ &change->data.tp.oldtuple->tuple,
true);
break;
+ default:
+ Assert(false);
}
MemoryContextSwitchTo(old);