bdr: adjustments for changed output plugin API
authorAndres Freund <[email protected]>
Wed, 12 Mar 2014 17:26:10 +0000 (18:26 +0100)
committerAndres Freund <[email protected]>
Thu, 3 Jul 2014 15:55:20 +0000 (17:55 +0200)
contrib/bdr/bdr_output.c

index 9fb160c1cb4eb68f4d434633bf3fa8e802b9be6a..67f09cda825d44cc5bdef3f8cb7a95696eba5068 100644 (file)
@@ -159,28 +159,33 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
        case REORDER_BUFFER_CHANGE_INSERT:
            appendStringInfoChar(ctx->out, 'I');        /* action INSERT */
            appendStringInfoChar(ctx->out, 'N');        /* new tuple follows */
-           write_tuple(ctx->out, relation, &change->tp.newtuple->tuple);
+           write_tuple(ctx->out, relation, &change->data.tp.newtuple->tuple);
            break;
        case REORDER_BUFFER_CHANGE_UPDATE:
            appendStringInfoChar(ctx->out, 'U');        /* action UPDATE */
-           if (change->tp.oldtuple != NULL)
+           if (change->data.tp.oldtuple != NULL)
            {
                appendStringInfoChar(ctx->out, 'K');    /* old key follows */
-               write_tuple(ctx->out, relation, &change->tp.oldtuple->tuple);
+               write_tuple(ctx->out, relation,
+                           &change->data.tp.oldtuple->tuple);
            }
            appendStringInfoChar(ctx->out, 'N');        /* new tuple follows */
-           write_tuple(ctx->out, relation, &change->tp.newtuple->tuple);
+           write_tuple(ctx->out, relation,
+                       &change->data.tp.newtuple->tuple);
            break;
        case REORDER_BUFFER_CHANGE_DELETE:
            appendStringInfoChar(ctx->out, 'D');        /* action DELETE */
-           if (change->tp.oldtuple != NULL)
+           if (change->data.tp.oldtuple != NULL)
            {
                appendStringInfoChar(ctx->out, 'K');    /* old key follows */
-               write_tuple(ctx->out, relation, &change->tp.oldtuple->tuple);
+               write_tuple(ctx->out, relation,
+                           &change->data.tp.oldtuple->tuple);
            }
            else
                appendStringInfoChar(ctx->out, 'E');    /* empty */
            break;
+       default:
+           Assert(false);
    }
    OutputPluginWrite(ctx, true);