You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zxealous (via GitHub)" <gi...@apache.org> on 2023/07/19 02:41:03 UTC

[GitHub] [doris] zxealous commented on a diff in pull request #21947: [fix](case function) Applying for an array in the heap to avoid stack…

zxealous commented on code in PR #21947:
URL: https://github.com/apache/doris/pull/21947#discussion_r1267470405


##########
be/src/vec/functions/function_case.h:
##########
@@ -167,9 +167,9 @@ class FunctionCase : public IFunction {
         int rows_count = column_holder.rows_count;
 
         // `then` data index corresponding to each row of results, 0 represents `else`.
-        int then_idx[rows_count];
-        int* __restrict then_idx_ptr = then_idx;
-        memset(then_idx_ptr, 0, sizeof(then_idx));
+        std::unique_ptr<int> then_idx(new int[rows_count]);

Review Comment:
   I have meet this problem in 1.1,  the rows_count is  > 5000w, cause all backends core dump, the problem was fixed by #17035, but it is hard to pick it to branch 1.1. I think changing it on the master can also avoid the same problem again.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org