diff --git a/src/yb/docdb/docdb_compaction_context.cc b/src/yb/docdb/docdb_compaction_context.cc index c747b11677e1..1a30c3c2ca9b 100644 --- a/src/yb/docdb/docdb_compaction_context.cc +++ b/src/yb/docdb/docdb_compaction_context.cc @@ -375,7 +375,7 @@ class PackedRowData { dockv::PackerBase(&*packer_).schema().GetMissingValueByColumnId(column_id)); return CheckPackOldValueResult( column_id, std::visit([column_id, missing_value](auto& packer) { - return packer.AddValue(column_id, missing_value); + return packer.AddValue(column_id, missing_value, kUnlimitedTail); }, *packer_)); } return DoPackOldValue(column_id, decoder.FetchValue(decoder.GetPackedIndex(column_id))); diff --git a/src/yb/dockv/packed_row.cc b/src/yb/dockv/packed_row.cc index 89aa7931463c..b4a5f1c0db70 100644 --- a/src/yb/dockv/packed_row.cc +++ b/src/yb/dockv/packed_row.cc @@ -406,8 +406,8 @@ void RowPackerV1::Init(SchemaVersion version) { result_.Truncate(prefix_end_); } -Result RowPackerV1::AddValue(ColumnId column_id, const QLValuePB& value) { - return DoAddValue(column_id, value, /* tail_size= */ 0); +Result RowPackerV1::AddValue(ColumnId column_id, const QLValuePB& value, ssize_t tail_size) { + return DoAddValue(column_id, value, tail_size); } Result RowPackerV1::AddValue(ColumnId column_id, const LWQLValuePB& value) { @@ -489,8 +489,9 @@ Result RowPackerV2::AddValue( return DoAddValue(column_id, std::pair(value_prefix, value_suffix), tail_size); } -Result RowPackerV2::AddValue(ColumnId column_id, const QLValuePB& value) { - return DoAddValue(column_id, value, /* tail_size= */ 0); +Result RowPackerV2::AddValue( + ColumnId column_id, const QLValuePB& value, ssize_t tail_size) { + return DoAddValue(column_id, value, tail_size); } Result RowPackerV2::AddValue(ColumnId column_id, const LWQLValuePB& value) { diff --git a/src/yb/dockv/packed_row.h b/src/yb/dockv/packed_row.h index d01eecc93002..80652734537a 100644 --- a/src/yb/dockv/packed_row.h +++ b/src/yb/dockv/packed_row.h @@ -160,7 +160,7 @@ class RowPackerV1 : public RowPackerBase { // Add value consisting of 2 parts - value_prefix+value_suffix. Result AddValue( ColumnId column_id, Slice value_prefix, PackedValueV1 value_suffix, ssize_t tail_size); - Result AddValue(ColumnId column_id, const QLValuePB& value); + Result AddValue(ColumnId column_id, const QLValuePB& value, ssize_t tail_size = 0); Result AddValue(ColumnId column_id, const LWQLValuePB& value); Result AddValue(ColumnId column_id, Slice control_fields, const QLValuePB& value); @@ -202,7 +202,7 @@ class RowPackerV2 : public RowPackerBase { // Add value consisting of 2 parts - value_prefix+value_suffix. Result AddValue( ColumnId column_id, Slice value_prefix, PackedValueV1 value_suffix, ssize_t tail_size); - Result AddValue(ColumnId column_id, const QLValuePB& value); + Result AddValue(ColumnId column_id, const QLValuePB& value, ssize_t tail_size = 0); Result AddValue(ColumnId column_id, const LWQLValuePB& value); Result AddValue(ColumnId column_id, const PackableValue& value); diff --git a/src/yb/yql/pgwrapper/pg_packed_row-test.cc b/src/yb/yql/pgwrapper/pg_packed_row-test.cc index ce8dbd987c1b..52b0ccace667 100644 --- a/src/yb/yql/pgwrapper/pg_packed_row-test.cc +++ b/src/yb/yql/pgwrapper/pg_packed_row-test.cc @@ -685,6 +685,10 @@ TEST_P(PgPackedRowTest, PackOverflow) { ASSERT_OK(conn.Execute("ALTER TABLE t ADD COLUMN v2 TEXT")); ASSERT_OK(cluster_->CompactTablets()); + + ASSERT_OK(conn.Execute("ALTER TABLE t ADD COLUMN v3 TIMESTAMP DEFAULT CURRENT_TIMESTAMP NULL")); + + ASSERT_OK(cluster_->CompactTablets()); } TEST_P(PgPackedRowTest, AddDropColumn) {