aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraneporada <aneporada@ydb.tech>2023-01-01 19:00:37 +0300
committeraneporada <aneporada@ydb.tech>2023-01-01 19:00:37 +0300
commit7d35dcfceadb9be958d546a3b5302d2433be80ce (patch)
tree6b78a68c0051b1a4d677624965a4fec07b831269
parent3730e2b8aa6afe2f3ef90f4dca442aac67a143d8 (diff)
downloadydb-7d35dcfceadb9be958d546a3b5302d2433be80ce.tar.gz
Fix key buffer resizing
-rw-r--r--ydb/library/yql/minikql/comp_nodes/mkql_block_agg.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/ydb/library/yql/minikql/comp_nodes/mkql_block_agg.cpp b/ydb/library/yql/minikql/comp_nodes/mkql_block_agg.cpp
index 979a67c473..9d5e76dcb9 100644
--- a/ydb/library/yql/minikql/comp_nodes/mkql_block_agg.cpp
+++ b/ydb/library/yql/minikql/comp_nodes/mkql_block_agg.cpp
@@ -394,7 +394,10 @@ public:
private:
void Ensure(size_t delta) {
if (Pos_ + delta > Vec_.size()) {
- Vec_.reserve(Max(2 * Vec_.capacity(), Pos_ + delta));
+ if (Pos_ + delta > Vec_.capacity()) {
+ Vec_.reserve(Max(2 * Vec_.capacity(), Pos_ + delta));
+ }
+ // TODO: replace TVector - resize() performs unneeded zeroing here
Vec_.resize(Pos_ + delta);
}
}