diff options
author | aakulaga <aakulaga@ydb.tech> | 2023-11-22 15:46:59 +0300 |
---|---|---|
committer | aakulaga <aakulaga@ydb.tech> | 2023-11-22 18:52:34 +0300 |
commit | 8a1b9aaba773b70732f1f2eb2cb1f2206990f03d (patch) | |
tree | e635f02e84eec352369d32c8f6b838eefa63c22c | |
parent | 1ecee2cd81b66fae2b6d253463a4a01d98ca3f36 (diff) | |
download | ydb-8a1b9aaba773b70732f1f2eb2cb1f2206990f03d.tar.gz |
YQL-17149 fix
Shift overfill fix
-rw-r--r-- | ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp | 12 | ||||
-rw-r--r-- | ydb/library/yql/minikql/comp_nodes/mkql_grace_join_imp.cpp | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp index fbf7fe89c0e..9cd39efa5ab 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join.cpp @@ -204,10 +204,10 @@ void TGraceJoinPacker::Pack() { if (!value) { // Null value ui64 currNullsIdx = (i + 1) / (sizeof(ui64) * 8); ui64 remShift = ( (i + 1) - currNullsIdx * (sizeof(ui64) * 8) ); - ui64 bitMask = (0x1) << remShift; + ui64 bitMask = ui64(0x1) << remShift; TupleIntVals[currNullsIdx] |= bitMask; if (pi.IsKeyColumn) { - TupleIntVals[0] |= (0x1); + TupleIntVals[0] |= ui64(0x1); } continue; } @@ -318,7 +318,7 @@ void TGraceJoinPacker::UnPack() { } ui64 currNullsIdx = (i + 1) / (sizeof(ui64) * 8); ui64 remShift = ( (i + 1) - currNullsIdx * (sizeof(ui64) * 8) ); - ui64 bitMask = (0x1) << remShift; + ui64 bitMask = ui64(0x1) << remShift; if ( TupleIntVals[currNullsIdx] & bitMask ) { value = NYql::NUdf::TUnboxedValue(); continue; @@ -760,7 +760,7 @@ EFetchResult TGraceJoinState::FetchValues(TComputationContext& ctx, NUdf::TUnbox auto &valsRight = RightPacker->TupleHolder; - for (ui32 i = 0; i < LeftRenames.size() / 2; i++) + for (size_t i = 0; i < LeftRenames.size() / 2; i++) { auto & valPtr = output[LeftRenames[2 * i + 1]]; if ( valPtr ) { @@ -768,12 +768,12 @@ EFetchResult TGraceJoinState::FetchValues(TComputationContext& ctx, NUdf::TUnbox } } - for (ui32 i = 0; i < RightRenames.size() / 2; i++) + for (size_t i = 0; i < RightRenames.size() / 2; i++) { auto & valPtr = output[RightRenames[2 * i + 1]]; if ( valPtr ) { *valPtr = valsRight[RightRenames[2 * i]]; - } + } } return EFetchResult::One; diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join_imp.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join_imp.cpp index 2b2d637646d..a1b1ff78df5 100644 --- a/ydb/library/yql/minikql/comp_nodes/mkql_grace_join_imp.cpp +++ b/ydb/library/yql/minikql/comp_nodes/mkql_grace_join_imp.cpp @@ -70,7 +70,7 @@ void TTable::AddTuple( ui64 * intColumns, char ** stringColumns, ui32 * strings } - TempTuple[0] &= (0x1); // Setting only nulls in key bit, all other bits are ignored for key hash + TempTuple[0] &= ui64(0x1); // Setting only nulls in key bit, all other bits are ignored for key hash for (ui32 i = 1; i < NullsBitmapSize_; i ++) { TempTuple[i] = 0; } @@ -82,7 +82,7 @@ void TTable::AddTuple( ui64 * intColumns, char ** stringColumns, ui32 * strings ui64 bucket = hash & BucketsMask; - + std::vector<ui64, TMKQLAllocator<ui64>> & keyIntVals = TableBuckets[bucket].KeyIntVals; std::vector<ui32, TMKQLAllocator<ui32>> & stringsOffsets = TableBuckets[bucket].StringsOffsets; @@ -340,7 +340,7 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef slotSize = slotSize + avgStringsSize; } - + ui64 nSlots = 3 * bucket2->TuplesNum + 1; joinSlots.clear(); spillSlots.clear(); @@ -559,7 +559,7 @@ void TTable::Join( TTable & t1, TTable & t2, EJoinKind joinKind, bool hasMoreLef HasMoreLeftTuples_ = hasMoreLeftTuples; HasMoreRightTuples_ = hasMoreRightTuples; - + } inline void TTable::GetTupleData(ui32 bucketNum, ui32 tupleId, TupleData & td) { |