Use `oneof` for different datum field types

pull/1/head
Jarred Ward 2015-04-20 16:34:00 -07:00
parent 29a7ac49dc
commit 27db93ceb8
4 changed files with 140 additions and 93 deletions

View File

@ -1,7 +1,7 @@
package decoderbufs; package decoderbufs;
option java_package="decoderbufs.proto"; option java_package="decoderbufs.proto";
option java_outer_classname = "PgldProto"; option java_outer_classname = "PgldProtos";
option optimize_for = SPEED; option optimize_for = SPEED;
enum Op { enum Op {
@ -18,20 +18,23 @@ message Point {
message DatumMessage { message DatumMessage {
optional string column_name = 1; optional string column_name = 1;
optional int64 column_type = 2; optional int64 column_type = 2;
optional int32 datum_int32 = 3; oneof datum {
optional int64 datum_int64 = 4; int32 datum_int32 = 3;
optional float datum_float = 5; int64 datum_int64 = 4;
optional double datum_double = 6; float datum_float = 5;
optional bool datum_bool = 7; double datum_double = 6;
optional string datum_string = 8; bool datum_bool = 7;
optional bytes datum_bytes = 9; string datum_string = 8;
optional Point datum_point = 10; bytes datum_bytes = 9;
Point datum_point = 10;
}
} }
message RowMessage { message RowMessage {
optional sint64 commit_time = 1; optional uint32 transaction_id = 1;
optional string table = 2; optional uint64 commit_time = 2;
optional Op op = 3; optional string table = 3;
repeated DatumMessage new_tuple = 4; optional Op op = 4;
repeated DatumMessage old_tuple = 5; repeated DatumMessage new_tuple = 5;
repeated DatumMessage old_tuple = 6;
} }

View File

@ -190,18 +190,33 @@ static void row_message_destroy(Decoderbufs__RowMessage *msg) {
return; return;
} }
pfree(msg->table); if (msg->table) {
pfree(msg->table);
}
if (msg->n_new_tuple > 0) { if (msg->n_new_tuple > 0) {
for (int i = 0; i < msg->n_new_tuple; i++) { for (int i = 0; i < msg->n_new_tuple; i++) {
if (msg->new_tuple[i]) { if (msg->new_tuple[i]) {
if (msg->new_tuple[i]->datum_string) { switch (msg->new_tuple[i]->datum_case) {
pfree(msg->new_tuple[i]->datum_string); case DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_STRING:
} else if (msg->new_tuple[i]->has_datum_bytes) { if (msg->new_tuple[i]->datum_string) {
pfree(msg->new_tuple[i]->datum_bytes.data); pfree(msg->new_tuple[i]->datum_string);
msg->new_tuple[i]->datum_bytes.data = NULL; }
msg->new_tuple[i]->datum_bytes.len = 0; break;
} else if (msg->new_tuple[i]->datum_point) { case DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_BYTES:
pfree(msg->new_tuple[i]->datum_point); if (msg->new_tuple[i]->datum_bytes.data) {
pfree(msg->new_tuple[i]->datum_bytes.data);
msg->new_tuple[i]->datum_bytes.data = NULL;
msg->new_tuple[i]->datum_bytes.len = 0;
}
break;
case DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_POINT:
if (msg->new_tuple[i]->datum_point) {
pfree(msg->new_tuple[i]->datum_point);
}
break;
default:
break;
} }
pfree(msg->new_tuple[i]); pfree(msg->new_tuple[i]);
} }
@ -211,14 +226,26 @@ static void row_message_destroy(Decoderbufs__RowMessage *msg) {
if (msg->n_old_tuple > 0) { if (msg->n_old_tuple > 0) {
for (int i = 0; i < msg->n_old_tuple; i++) { for (int i = 0; i < msg->n_old_tuple; i++) {
if (msg->old_tuple[i]) { if (msg->old_tuple[i]) {
if (msg->old_tuple[i]->datum_string) { switch (msg->old_tuple[i]->datum_case) {
pfree(msg->old_tuple[i]->datum_string); case DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_STRING:
} else if (msg->old_tuple[i]->has_datum_bytes) { if (msg->old_tuple[i]->datum_string) {
pfree(msg->old_tuple[i]->datum_bytes.data); pfree(msg->old_tuple[i]->datum_string);
msg->old_tuple[i]->datum_bytes.data = NULL; }
msg->old_tuple[i]->datum_bytes.len = 0; break;
} else if (msg->old_tuple[i]->datum_point) { case DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_BYTES:
pfree(msg->old_tuple[i]->datum_point); if (msg->old_tuple[i]->datum_bytes.data) {
pfree(msg->old_tuple[i]->datum_bytes.data);
msg->old_tuple[i]->datum_bytes.data = NULL;
msg->old_tuple[i]->datum_bytes.len = 0;
}
break;
case DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_POINT:
if (msg->old_tuple[i]->datum_point) {
pfree(msg->old_tuple[i]->datum_point);
}
break;
default:
break;
} }
pfree(msg->old_tuple[i]); pfree(msg->old_tuple[i]);
} }
@ -350,34 +377,27 @@ static void set_datum_value(Decoderbufs__DatumMessage *datum_msg, Oid typid,
switch (typid) { switch (typid) {
case BOOLOID: case BOOLOID:
datum_msg->datum_bool = DatumGetBool(datum); datum_msg->datum_bool = DatumGetBool(datum);
datum_msg->has_datum_bool = true;
break; break;
case INT2OID: case INT2OID:
datum_msg->datum_int32 = DatumGetInt16(datum); datum_msg->datum_int32 = DatumGetInt16(datum);
datum_msg->has_datum_int32 = true;
break; break;
case INT4OID: case INT4OID:
datum_msg->datum_int32 = DatumGetInt32(datum); datum_msg->datum_int32 = DatumGetInt32(datum);
datum_msg->has_datum_int32 = true;
break; break;
case INT8OID: case INT8OID:
case OIDOID: case OIDOID:
datum_msg->datum_int64 = DatumGetInt64(datum); datum_msg->datum_int64 = DatumGetInt64(datum);
datum_msg->has_datum_int64 = true;
break; break;
case FLOAT4OID: case FLOAT4OID:
datum_msg->datum_float = DatumGetFloat4(datum); datum_msg->datum_float = DatumGetFloat4(datum);
datum_msg->has_datum_float = true;
break; break;
case FLOAT8OID: case FLOAT8OID:
datum_msg->datum_double = DatumGetFloat8(datum); datum_msg->datum_double = DatumGetFloat8(datum);
datum_msg->has_datum_double = true;
break; break;
case NUMERICOID: case NUMERICOID:
num = DatumGetNumeric(datum); num = DatumGetNumeric(datum);
if (!numeric_is_nan(num)) { if (!numeric_is_nan(num)) {
datum_msg->datum_double = numeric_to_double_no_overflow(num); datum_msg->datum_double = numeric_to_double_no_overflow(num);
datum_msg->has_datum_double = true;
} }
break; break;
case CHAROID: case CHAROID:
@ -404,7 +424,6 @@ static void set_datum_value(Decoderbufs__DatumMessage *datum_msg, Oid typid,
datum_msg->datum_bytes.data = palloc(size); datum_msg->datum_bytes.data = palloc(size);
memcpy(datum_msg->datum_bytes.data, (uint8_t *)VARDATA(valptr), size); memcpy(datum_msg->datum_bytes.data, (uint8_t *)VARDATA(valptr), size);
datum_msg->datum_bytes.len = size; datum_msg->datum_bytes.len = size;
datum_msg->has_datum_bytes = true;
break; break;
case POINTOID: case POINTOID:
p = DatumGetPointP(datum); p = DatumGetPointP(datum);
@ -428,7 +447,6 @@ static void set_datum_value(Decoderbufs__DatumMessage *datum_msg, Oid typid,
datum_msg->datum_bytes.data = palloc(size); datum_msg->datum_bytes.data = palloc(size);
memcpy(datum_msg->datum_bytes.data, (uint8_t *)output, size); memcpy(datum_msg->datum_bytes.data, (uint8_t *)output, size);
datum_msg->datum_bytes.len = len; datum_msg->datum_bytes.len = len;
datum_msg->has_datum_bytes = true;
} }
break; break;
} }
@ -509,6 +527,8 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
!OidIsValid(relation->rd_replidindex))); !OidIsValid(relation->rd_replidindex)));
/* set common fields */ /* set common fields */
rmsg.transaction_id = txn->xid;
rmsg.has_transaction_id = true;
rmsg.commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH(txn->commit_time); rmsg.commit_time = TIMESTAMPTZ_TO_USEC_SINCE_EPOCH(txn->commit_time);
rmsg.has_commit_time = true; rmsg.has_commit_time = true;
rmsg.table = pstrdup(NameStr(class_form->relname)); rmsg.table = pstrdup(NameStr(class_form->relname));

View File

@ -218,11 +218,11 @@ static const ProtobufCFieldDescriptor decoderbufs__datum_message__field_descript
3, 3,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT32, PROTOBUF_C_TYPE_INT32,
offsetof(Decoderbufs__DatumMessage, has_datum_int32), offsetof(Decoderbufs__DatumMessage, datum_case),
offsetof(Decoderbufs__DatumMessage, datum_int32), offsetof(Decoderbufs__DatumMessage, datum_int32),
NULL, NULL,
NULL, NULL,
0, /* flags */ 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -230,11 +230,11 @@ static const ProtobufCFieldDescriptor decoderbufs__datum_message__field_descript
4, 4,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT64, PROTOBUF_C_TYPE_INT64,
offsetof(Decoderbufs__DatumMessage, has_datum_int64), offsetof(Decoderbufs__DatumMessage, datum_case),
offsetof(Decoderbufs__DatumMessage, datum_int64), offsetof(Decoderbufs__DatumMessage, datum_int64),
NULL, NULL,
NULL, NULL,
0, /* flags */ 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -242,11 +242,11 @@ static const ProtobufCFieldDescriptor decoderbufs__datum_message__field_descript
5, 5,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_FLOAT, PROTOBUF_C_TYPE_FLOAT,
offsetof(Decoderbufs__DatumMessage, has_datum_float), offsetof(Decoderbufs__DatumMessage, datum_case),
offsetof(Decoderbufs__DatumMessage, datum_float), offsetof(Decoderbufs__DatumMessage, datum_float),
NULL, NULL,
NULL, NULL,
0, /* flags */ 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -254,11 +254,11 @@ static const ProtobufCFieldDescriptor decoderbufs__datum_message__field_descript
6, 6,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_DOUBLE, PROTOBUF_C_TYPE_DOUBLE,
offsetof(Decoderbufs__DatumMessage, has_datum_double), offsetof(Decoderbufs__DatumMessage, datum_case),
offsetof(Decoderbufs__DatumMessage, datum_double), offsetof(Decoderbufs__DatumMessage, datum_double),
NULL, NULL,
NULL, NULL,
0, /* flags */ 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -266,11 +266,11 @@ static const ProtobufCFieldDescriptor decoderbufs__datum_message__field_descript
7, 7,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_BOOL, PROTOBUF_C_TYPE_BOOL,
offsetof(Decoderbufs__DatumMessage, has_datum_bool), offsetof(Decoderbufs__DatumMessage, datum_case),
offsetof(Decoderbufs__DatumMessage, datum_bool), offsetof(Decoderbufs__DatumMessage, datum_bool),
NULL, NULL,
NULL, NULL,
0, /* flags */ 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -278,11 +278,11 @@ static const ProtobufCFieldDescriptor decoderbufs__datum_message__field_descript
8, 8,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_STRING, PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */ offsetof(Decoderbufs__DatumMessage, datum_case),
offsetof(Decoderbufs__DatumMessage, datum_string), offsetof(Decoderbufs__DatumMessage, datum_string),
NULL, NULL,
NULL, NULL,
0, /* flags */ 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -290,11 +290,11 @@ static const ProtobufCFieldDescriptor decoderbufs__datum_message__field_descript
9, 9,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_BYTES, PROTOBUF_C_TYPE_BYTES,
offsetof(Decoderbufs__DatumMessage, has_datum_bytes), offsetof(Decoderbufs__DatumMessage, datum_case),
offsetof(Decoderbufs__DatumMessage, datum_bytes), offsetof(Decoderbufs__DatumMessage, datum_bytes),
NULL, NULL,
NULL, NULL,
0, /* flags */ 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
{ {
@ -302,11 +302,11 @@ static const ProtobufCFieldDescriptor decoderbufs__datum_message__field_descript
10, 10,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_MESSAGE, PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */ offsetof(Decoderbufs__DatumMessage, datum_case),
offsetof(Decoderbufs__DatumMessage, datum_point), offsetof(Decoderbufs__DatumMessage, datum_point),
&decoderbufs__point__descriptor, &decoderbufs__point__descriptor,
NULL, NULL,
0, /* flags */ 0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */ 0,NULL,NULL /* reserved1,reserved2, etc */
}, },
}; };
@ -342,13 +342,25 @@ const ProtobufCMessageDescriptor decoderbufs__datum_message__descriptor =
(ProtobufCMessageInit) decoderbufs__datum_message__init, (ProtobufCMessageInit) decoderbufs__datum_message__init,
NULL,NULL,NULL /* reserved[123] */ NULL,NULL,NULL /* reserved[123] */
}; };
static const ProtobufCFieldDescriptor decoderbufs__row_message__field_descriptors[5] = static const ProtobufCFieldDescriptor decoderbufs__row_message__field_descriptors[6] =
{ {
{ {
"commit_time", "transaction_id",
1, 1,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_SINT64, PROTOBUF_C_TYPE_UINT32,
offsetof(Decoderbufs__RowMessage, has_transaction_id),
offsetof(Decoderbufs__RowMessage, transaction_id),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"commit_time",
2,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_UINT64,
offsetof(Decoderbufs__RowMessage, has_commit_time), offsetof(Decoderbufs__RowMessage, has_commit_time),
offsetof(Decoderbufs__RowMessage, commit_time), offsetof(Decoderbufs__RowMessage, commit_time),
NULL, NULL,
@ -358,7 +370,7 @@ static const ProtobufCFieldDescriptor decoderbufs__row_message__field_descriptor
}, },
{ {
"table", "table",
2, 3,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_STRING, PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */ 0, /* quantifier_offset */
@ -370,7 +382,7 @@ static const ProtobufCFieldDescriptor decoderbufs__row_message__field_descriptor
}, },
{ {
"op", "op",
3, 4,
PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_ENUM, PROTOBUF_C_TYPE_ENUM,
offsetof(Decoderbufs__RowMessage, has_op), offsetof(Decoderbufs__RowMessage, has_op),
@ -382,7 +394,7 @@ static const ProtobufCFieldDescriptor decoderbufs__row_message__field_descriptor
}, },
{ {
"new_tuple", "new_tuple",
4, 5,
PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_LABEL_REPEATED,
PROTOBUF_C_TYPE_MESSAGE, PROTOBUF_C_TYPE_MESSAGE,
offsetof(Decoderbufs__RowMessage, n_new_tuple), offsetof(Decoderbufs__RowMessage, n_new_tuple),
@ -394,7 +406,7 @@ static const ProtobufCFieldDescriptor decoderbufs__row_message__field_descriptor
}, },
{ {
"old_tuple", "old_tuple",
5, 6,
PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_LABEL_REPEATED,
PROTOBUF_C_TYPE_MESSAGE, PROTOBUF_C_TYPE_MESSAGE,
offsetof(Decoderbufs__RowMessage, n_old_tuple), offsetof(Decoderbufs__RowMessage, n_old_tuple),
@ -406,16 +418,17 @@ static const ProtobufCFieldDescriptor decoderbufs__row_message__field_descriptor
}, },
}; };
static const unsigned decoderbufs__row_message__field_indices_by_name[] = { static const unsigned decoderbufs__row_message__field_indices_by_name[] = {
0, /* field[0] = commit_time */ 1, /* field[1] = commit_time */
3, /* field[3] = new_tuple */ 4, /* field[4] = new_tuple */
4, /* field[4] = old_tuple */ 5, /* field[5] = old_tuple */
2, /* field[2] = op */ 3, /* field[3] = op */
1, /* field[1] = table */ 2, /* field[2] = table */
0, /* field[0] = transaction_id */
}; };
static const ProtobufCIntRange decoderbufs__row_message__number_ranges[1 + 1] = static const ProtobufCIntRange decoderbufs__row_message__number_ranges[1 + 1] =
{ {
{ 1, 0 }, { 1, 0 },
{ 0, 5 } { 0, 6 }
}; };
const ProtobufCMessageDescriptor decoderbufs__row_message__descriptor = const ProtobufCMessageDescriptor decoderbufs__row_message__descriptor =
{ {
@ -425,14 +438,14 @@ const ProtobufCMessageDescriptor decoderbufs__row_message__descriptor =
"Decoderbufs__RowMessage", "Decoderbufs__RowMessage",
"decoderbufs", "decoderbufs",
sizeof(Decoderbufs__RowMessage), sizeof(Decoderbufs__RowMessage),
5, 6,
decoderbufs__row_message__field_descriptors, decoderbufs__row_message__field_descriptors,
decoderbufs__row_message__field_indices_by_name, decoderbufs__row_message__field_indices_by_name,
1, decoderbufs__row_message__number_ranges, 1, decoderbufs__row_message__number_ranges,
(ProtobufCMessageInit) decoderbufs__row_message__init, (ProtobufCMessageInit) decoderbufs__row_message__init,
NULL,NULL,NULL /* reserved[123] */ NULL,NULL,NULL /* reserved[123] */
}; };
const ProtobufCEnumValue decoderbufs__op__enum_values_by_number[3] = static const ProtobufCEnumValue decoderbufs__op__enum_values_by_number[3] =
{ {
{ "INSERT", "DECODERBUFS__OP__INSERT", 0 }, { "INSERT", "DECODERBUFS__OP__INSERT", 0 },
{ "UPDATE", "DECODERBUFS__OP__UPDATE", 1 }, { "UPDATE", "DECODERBUFS__OP__UPDATE", 1 },
@ -441,7 +454,7 @@ const ProtobufCEnumValue decoderbufs__op__enum_values_by_number[3] =
static const ProtobufCIntRange decoderbufs__op__value_ranges[] = { static const ProtobufCIntRange decoderbufs__op__value_ranges[] = {
{0, 0},{0, 3} {0, 0},{0, 3}
}; };
const ProtobufCEnumValueIndex decoderbufs__op__enum_values_by_name[3] = static const ProtobufCEnumValueIndex decoderbufs__op__enum_values_by_name[3] =
{ {
{ "DELETE", 2 }, { "DELETE", 2 },
{ "INSERT", 0 }, { "INSERT", 0 },

View File

@ -1,8 +1,8 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */ /* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: pg_logicaldec.proto */ /* Generated from: pg_logicaldec.proto */
#ifndef PROTOBUF_C_proto_2fpg_5flogicaldec_2eproto__INCLUDED #ifndef PROTOBUF_C_pg_5flogicaldec_2eproto__INCLUDED
#define PROTOBUF_C_proto_2fpg_5flogicaldec_2eproto__INCLUDED #define PROTOBUF_C_pg_5flogicaldec_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h> #include <protobuf-c/protobuf-c.h>
@ -10,7 +10,7 @@ PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1000000 #if PROTOBUF_C_VERSION_NUMBER < 1000000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. # error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1001000 < PROTOBUF_C_MIN_COMPILER_VERSION #elif 1001001 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif #endif
@ -42,37 +42,48 @@ struct _Decoderbufs__Point
, 0, 0 } , 0, 0 }
typedef enum {
DECODERBUFS__DATUM_MESSAGE__DATUM__NOT_SET = 0,
DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_INT32 = 3,
DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_INT64 = 4,
DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_FLOAT = 5,
DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_DOUBLE = 6,
DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_BOOL = 7,
DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_STRING = 8,
DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_BYTES = 9,
DECODERBUFS__DATUM_MESSAGE__DATUM_DATUM_POINT = 10,
} Decoderbufs__DatumMessage__DatumCase;
struct _Decoderbufs__DatumMessage struct _Decoderbufs__DatumMessage
{ {
ProtobufCMessage base; ProtobufCMessage base;
char *column_name; char *column_name;
protobuf_c_boolean has_column_type; protobuf_c_boolean has_column_type;
int64_t column_type; int64_t column_type;
protobuf_c_boolean has_datum_int32; Decoderbufs__DatumMessage__DatumCase datum_case;
int32_t datum_int32; union {
protobuf_c_boolean has_datum_int64; int32_t datum_int32;
int64_t datum_int64; int64_t datum_int64;
protobuf_c_boolean has_datum_float; float datum_float;
float datum_float; double datum_double;
protobuf_c_boolean has_datum_double; protobuf_c_boolean datum_bool;
double datum_double; char *datum_string;
protobuf_c_boolean has_datum_bool; ProtobufCBinaryData datum_bytes;
protobuf_c_boolean datum_bool; Decoderbufs__Point *datum_point;
char *datum_string; };
protobuf_c_boolean has_datum_bytes;
ProtobufCBinaryData datum_bytes;
Decoderbufs__Point *datum_point;
}; };
#define DECODERBUFS__DATUM_MESSAGE__INIT \ #define DECODERBUFS__DATUM_MESSAGE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&decoderbufs__datum_message__descriptor) \ { PROTOBUF_C_MESSAGE_INIT (&decoderbufs__datum_message__descriptor) \
, NULL, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, NULL, 0,{0,NULL}, NULL } , NULL, 0,0, DECODERBUFS__DATUM_MESSAGE__DATUM__NOT_SET, {} }
struct _Decoderbufs__RowMessage struct _Decoderbufs__RowMessage
{ {
ProtobufCMessage base; ProtobufCMessage base;
protobuf_c_boolean has_transaction_id;
uint32_t transaction_id;
protobuf_c_boolean has_commit_time; protobuf_c_boolean has_commit_time;
int64_t commit_time; uint64_t commit_time;
char *table; char *table;
protobuf_c_boolean has_op; protobuf_c_boolean has_op;
Decoderbufs__Op op; Decoderbufs__Op op;
@ -83,7 +94,7 @@ struct _Decoderbufs__RowMessage
}; };
#define DECODERBUFS__ROW_MESSAGE__INIT \ #define DECODERBUFS__ROW_MESSAGE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&decoderbufs__row_message__descriptor) \ { PROTOBUF_C_MESSAGE_INIT (&decoderbufs__row_message__descriptor) \
, 0,0, NULL, 0,0, 0,NULL, 0,NULL } , 0,0, 0,0, NULL, 0,0, 0,NULL, 0,NULL }
/* Decoderbufs__Point methods */ /* Decoderbufs__Point methods */
@ -168,4 +179,4 @@ extern const ProtobufCMessageDescriptor decoderbufs__row_message__descriptor;
PROTOBUF_C__END_DECLS PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_proto_2fpg_5flogicaldec_2eproto__INCLUDED */ #endif /* PROTOBUF_C_pg_5flogicaldec_2eproto__INCLUDED */