From e29a2580a50791956036615c25418b36663f3ea1 Mon Sep 17 00:00:00 2001 From: Jiri Pechanec Date: Thu, 30 Jan 2020 12:20:40 +0100 Subject: [PATCH] DBZ-1052 DBZ-1746 Add unknown message type --- proto/pg_logicaldec.proto | 1 + src/proto/pg_logicaldec.pb-c.c | 24 +++++++++++++----------- src/proto/pg_logicaldec.pb-c.h | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/proto/pg_logicaldec.proto b/proto/pg_logicaldec.proto index 14aed7d..43371f5 100644 --- a/proto/pg_logicaldec.proto +++ b/proto/pg_logicaldec.proto @@ -5,6 +5,7 @@ option java_outer_classname = "PgProto"; option optimize_for = SPEED; enum Op { + UNKNOWN = -1; INSERT = 0; UPDATE = 1; DELETE = 2; diff --git a/src/proto/pg_logicaldec.pb-c.c b/src/proto/pg_logicaldec.pb-c.c index 058290e..c8f4e8a 100644 --- a/src/proto/pg_logicaldec.pb-c.c +++ b/src/proto/pg_logicaldec.pb-c.c @@ -565,8 +565,9 @@ const ProtobufCMessageDescriptor decoderbufs__row_message__descriptor = (ProtobufCMessageInit) decoderbufs__row_message__init, NULL,NULL,NULL /* reserved[123] */ }; -static const ProtobufCEnumValue decoderbufs__op__enum_values_by_number[5] = +static const ProtobufCEnumValue decoderbufs__op__enum_values_by_number[6] = { + { "UNKNOWN", "DECODERBUFS__OP__UNKNOWN", -1 }, { "INSERT", "DECODERBUFS__OP__INSERT", 0 }, { "UPDATE", "DECODERBUFS__OP__UPDATE", 1 }, { "DELETE", "DECODERBUFS__OP__DELETE", 2 }, @@ -574,15 +575,16 @@ static const ProtobufCEnumValue decoderbufs__op__enum_values_by_number[5] = { "COMMIT", "DECODERBUFS__OP__COMMIT", 4 }, }; static const ProtobufCIntRange decoderbufs__op__value_ranges[] = { -{0, 0},{0, 5} +{-1, 0},{0, 6} }; -static const ProtobufCEnumValueIndex decoderbufs__op__enum_values_by_name[5] = -{ - { "BEGIN", 3 }, - { "COMMIT", 4 }, - { "DELETE", 2 }, - { "INSERT", 0 }, - { "UPDATE", 1 }, +static const ProtobufCEnumValueIndex decoderbufs__op__enum_values_by_name[6] = +{ + { "BEGIN", 4 }, + { "COMMIT", 5 }, + { "DELETE", 3 }, + { "INSERT", 1 }, + { "UNKNOWN", 0 }, + { "UPDATE", 2 }, }; const ProtobufCEnumDescriptor decoderbufs__op__descriptor = { @@ -591,9 +593,9 @@ const ProtobufCEnumDescriptor decoderbufs__op__descriptor = "Op", "Decoderbufs__Op", "decoderbufs", - 5, + 6, decoderbufs__op__enum_values_by_number, - 5, + 6, decoderbufs__op__enum_values_by_name, 1, decoderbufs__op__value_ranges, diff --git a/src/proto/pg_logicaldec.pb-c.h b/src/proto/pg_logicaldec.pb-c.h index cfeb895..fd6674a 100644 --- a/src/proto/pg_logicaldec.pb-c.h +++ b/src/proto/pg_logicaldec.pb-c.h @@ -24,6 +24,7 @@ typedef struct _Decoderbufs__RowMessage Decoderbufs__RowMessage; /* --- enums --- */ typedef enum _Decoderbufs__Op { + DECODERBUFS__OP__UNKNOWN = -1, DECODERBUFS__OP__INSERT = 0, DECODERBUFS__OP__UPDATE = 1, DECODERBUFS__OP__DELETE = 2,