You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2022/07/26 08:10:52 UTC
[doris] branch master updated: [Bug][Vectorized] Fix use-after-free bug of memtable shrink (#11197)
This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 8551ceaa1b [Bug][Vectorized] Fix use-after-free bug of memtable shrink (#11197)
8551ceaa1b is described below
commit 8551ceaa1b0f181abe861297c331646fd5c4cede
Author: HappenLee <ha...@hotmail.com>
AuthorDate: Tue Jul 26 16:10:44 2022 +0800
[Bug][Vectorized] Fix use-after-free bug of memtable shrink (#11197)
Co-authored-by: lihaopeng <li...@baidu.com>
---
be/src/olap/memtable.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/be/src/olap/memtable.cpp b/be/src/olap/memtable.cpp
index 2c3ee73357..a44c54c552 100644
--- a/be/src/olap/memtable.cpp
+++ b/be/src/olap/memtable.cpp
@@ -312,10 +312,15 @@ void MemTable::_collect_vskiplist_results() {
for (size_t i = _schema->num_key_columns(); i < _schema->num_columns(); ++i) {
auto function = _agg_functions[i];
auto agg_place = it.key()->agg_places(i);
- function->insert_result_into(agg_place,
- *(_output_mutable_block.get_column_by_position(i)));
+ auto col_ptr = _output_mutable_block.get_column_by_position(i).get();
+ function->insert_result_into(agg_place, *col_ptr);
if constexpr (is_final) {
function->destroy(agg_place);
+ } else {
+ function->reset(agg_place);
+ function->add(agg_place,
+ const_cast<const doris::vectorized::IColumn**>(&col_ptr), idx,
+ nullptr);
}
}
if constexpr (!is_final) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org