This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 568a8d09e80 branch-30: [Bug](agg) fix agg with topn limit coredump 
with ctor same key twice (#54137) (#54271)
568a8d09e80 is described below

commit 568a8d09e80babbd87a7900c99a86403e0d90b25
Author: zhangstar333 <[email protected]>
AuthorDate: Fri Sep 5 12:09:10 2025 +0800

    branch-30: [Bug](agg) fix agg with topn limit coredump with ctor same key 
twice (#54137) (#54271)
    
    ### What problem does this PR solve?
    Problem Summary:
    cherry-pick from master  (#54137)
    
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Test <!-- At least one of them must be included. -->
        - [ ] Regression test
        - [ ] Unit Test
        - [ ] Manual test (add detailed scripts or steps below)
        - [ ] No need to test or manual test. Explain why:
    - [ ] This is a refactor/code format and no logic has been changed.
            - [ ] Previous test can cover this change.
            - [ ] No code files have been changed.
            - [ ] Other reason <!-- Add your reason?  -->
    
    - Behavior changed:
        - [ ] No.
        - [ ] Yes. <!-- Explain the behavior change -->
    
    - Does this need documentation?
        - [ ] No.
    - [ ] Yes. <!-- Add document PR link here. eg:
    https://github.com/apache/doris-website/pull/1214 -->
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label <!-- Add branch pick label that this PR
    should merge into -->
---
 be/src/pipeline/exec/aggregation_sink_operator.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/be/src/pipeline/exec/aggregation_sink_operator.cpp 
b/be/src/pipeline/exec/aggregation_sink_operator.cpp
index 39dfb4e7f3c..63d43e07511 100644
--- a/be/src/pipeline/exec/aggregation_sink_operator.cpp
+++ b/be/src/pipeline/exec/aggregation_sink_operator.cpp
@@ -601,6 +601,7 @@ bool 
AggSinkLocalState::_emplace_into_hash_table_limit(vectorized::AggregateData
                                 try {
                                     
HashMethodType::try_presis_key_and_origin(key, origin,
                                                                               
*_agg_arena_pool);
+                                    _shared_state->refresh_top_limit(i, 
key_columns);
                                     auto mapped =
                                             
_shared_state->aggregate_data_container->append_data(
                                                     origin);
@@ -609,7 +610,6 @@ bool 
AggSinkLocalState::_emplace_into_hash_table_limit(vectorized::AggregateData
                                         throw Exception(st.code(), 
st.to_string());
                                     }
                                     ctor(key, mapped);
-                                    _shared_state->refresh_top_limit(i, 
key_columns);
                                 } catch (...) {
                                     // Exception-safety - if it can not 
allocate memory or create status,
                                     // the destructors will not be called.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to