You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/06/12 12:58:10 UTC

[doris] branch master updated: [fix](case expr) fix coredump of case for null value 3 #20711

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

yiguolei 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 1433544c56 [fix](case expr) fix coredump of case for null value 3 #20711
1433544c56 is described below

commit 1433544c563dd5b8418e9c4336d4e813dc212915
Author: Xinyi Zou <zo...@gmail.com>
AuthorDate: Mon Jun 12 20:58:01 2023 +0800

    [fix](case expr) fix coredump of case for null value 3 #20711
---
 be/src/vec/functions/function_case.h | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/be/src/vec/functions/function_case.h b/be/src/vec/functions/function_case.h
index 0c72e98aaf..944d61ac43 100644
--- a/be/src/vec/functions/function_case.h
+++ b/be/src/vec/functions/function_case.h
@@ -331,14 +331,12 @@ public:
                                  size_t input_rows_count) {
         bool then_null = false;
         for (int i = 1 + has_case; i < arguments.size() - has_else; i += 2) {
-            auto then_column_ptr = block.get_by_position(arguments[i]).column;
-            if (then_column_ptr->get_data_type() == TypeIndex::Nullable) {
+            if (block.get_by_position(arguments[i]).type->is_nullable()) {
                 then_null = true;
             }
         }
         if constexpr (has_else) {
-            auto else_column_ptr = block.get_by_position(arguments[arguments.size() - 1]).column;
-            if (else_column_ptr->get_data_type() == TypeIndex::Nullable) {
+            if (block.get_by_position(arguments[arguments.size() - 1]).type->is_nullable()) {
                 then_null = true;
             }
         } else {
@@ -363,14 +361,12 @@ public:
                                  size_t input_rows_count) {
         bool when_null = false;
         if constexpr (has_case) {
-            auto case_column_ptr = block.get_by_position(arguments[0]).column;
-            if (case_column_ptr->get_data_type() == TypeIndex::Nullable) {
+            if (block.get_by_position(arguments[0]).type->is_nullable()) {
                 when_null = true;
             }
         }
         for (int i = has_case; i < arguments.size() - has_else; i += 2) {
-            auto when_column_ptr = block.get_by_position(arguments[i]).column;
-            if (when_column_ptr->get_data_type() == TypeIndex::Nullable) {
+            if (block.get_by_position(arguments[i]).type->is_nullable()) {
                 when_null = true;
             }
         }


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