Skip to content

Commit bbe3d5b

Browse files
committed
fill both slices keys
1 parent b58553c commit bbe3d5b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ydb/core/tablet_flat/ut/ut_part.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -955,16 +955,16 @@ Y_UNIT_TEST_SUITE(TPart) {
955955
auto slices = MakeIntrusive<TSlices>();
956956
for (size_t rowId = 0; rowId < fullRows.size();) {
957957
TSlice slice;
958-
slice.FirstInclusive = true;
959958
slice.FirstRowId = rowId;
960-
if (rowId > 0)
961-
slice.FirstKey = getKey(IndexTools::GetRecord(*cutPartTmp, slice.FirstRowId));
962-
slice.LastInclusive = false;
963-
slice.LastRowId = rowId + RandomNumber<ui32>(2) + 1;
964-
if (slice.LastRowId < fullRows.size())
965-
slice.LastKey = getKey(IndexTools::GetRecord(*cutPartTmp, slice.LastRowId));
959+
slice.FirstInclusive = true;
960+
slice.FirstKey = getKey(IndexTools::GetRecord(*cutPartTmp, slice.FirstRowId));
961+
slice.LastRowId = Min(fullRows.size(), rowId + RandomNumber<ui32>(2) + 1);
962+
slice.LastInclusive = slice.LastRowId == fullRows.size();
963+
slice.LastKey = getKey(slice.LastRowId < fullRows.size()
964+
? IndexTools::GetRecord(*cutPartTmp, slice.LastRowId)
965+
: IndexTools::GetLastRecord(*cutPartTmp));
966966
slices->push_back(slice);
967-
rowId = slice.LastRowId;
967+
rowId = slice.EndRowId();
968968
}
969969

970970
Cerr << "======= SLICES =======" << Endl;

0 commit comments

Comments
 (0)