Skip to content

Commit 5b14371

Browse files
Fix nullable value in TKafkaRecord (#17609)
1 parent b38bd0d commit 5b14371

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

ydb/core/kafka_proxy/kafka_records.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class TKafkaRecord: public TMessage {
165165

166166
static constexpr TKafkaVersions PresentVersions = VersionsAlways;
167167
static constexpr TKafkaVersions TaggedVersions = VersionsNever;
168-
static constexpr TKafkaVersions NullableVersions = VersionsNever;
168+
static constexpr TKafkaVersions NullableVersions = VersionsAlways;
169169
static constexpr TKafkaVersions FlexibleVersions = VersionsAlways;
170170
};
171171
ValueMeta::Type Value;

ydb/core/kafka_proxy/ut/ut_protocol.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,24 @@ Y_UNIT_TEST_SUITE(KafkaProtocol) {
393393
AssertMessageMeta(readMessage, headerKey, headerValue);
394394
}
395395

396+
// send empty produce message
397+
{
398+
TKafkaRecordBatch batch;
399+
batch.BaseOffset = 3;
400+
batch.BaseSequence = 5;
401+
batch.Magic = 2; // Current supported
402+
batch.Records.resize(1);
403+
batch.Records[0].Key = TKafkaBytes{};
404+
batch.Records[0].Value = TKafkaBytes{};
405+
406+
auto msg = client.Produce(topicName, 0, batch);
407+
408+
UNIT_ASSERT_VALUES_EQUAL(msg->Responses[0].Name, topicName);
409+
UNIT_ASSERT_VALUES_EQUAL(msg->Responses[0].PartitionResponses[0].Index, 0);
410+
UNIT_ASSERT_VALUES_EQUAL(msg->Responses[0].PartitionResponses[0].ErrorCode,
411+
static_cast<TKafkaInt16>(EKafkaErrors::NONE_ERROR));
412+
}
413+
396414
{
397415
// Check short topic name
398416

0 commit comments

Comments
 (0)