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

panxiaolei pushed a commit to branch dev_syxj_2
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 0e52bd94303d496874f8009c9aaba4a20d4cca98
Author: BiteTheDDDDt <[email protected]>
AuthorDate: Tue Aug 22 18:43:53 2023 +0800

    add check for comparison input type
    
    update
    
    fix
    
    fix
---
 be/src/vec/functions/functions_comparison.h | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/be/src/vec/functions/functions_comparison.h 
b/be/src/vec/functions/functions_comparison.h
index 014c5a6c03..0b40c7c469 100644
--- a/be/src/vec/functions/functions_comparison.h
+++ b/be/src/vec/functions/functions_comparison.h
@@ -590,18 +590,30 @@ public:
                   execute_num_left_type<Float32>(block, result, 
col_left_untyped,
                                                  col_right_untyped) ||
                   execute_num_left_type<Float64>(block, result, 
col_left_untyped,
-                                                 col_right_untyped)))
-
+                                                 col_right_untyped))) {
                 return Status::RuntimeError("Illegal column {} of first 
argument of function {}",
                                             col_left_untyped->get_name(), 
get_name());
-        } else if (is_decimal_v2(left_type) || is_decimal_v2(right_type)) {
+            }
+            return Status::OK();
+        }
+        if (is_decimal_v2(left_type) || is_decimal_v2(right_type)) {
             if (!allow_decimal_comparison(left_type, right_type)) {
                 return Status::RuntimeError("No operation {} between {} and 
{}", get_name(),
                                             left_type->get_name(), 
right_type->get_name());
             }
             return execute_decimal(block, result, col_with_type_and_name_left,
                                    col_with_type_and_name_right);
-        } else if (is_decimal(left_type) || is_decimal(right_type)) {
+        }
+
+        if (which_left.idx != which_right.idx) {
+            return Status::InternalError(
+                    "comparison must input two same type column or column type 
is "
+                    "decimalv3/numeric, lhs={}, rhs={}",
+                    col_with_type_and_name_left.type->get_name(),
+                    col_with_type_and_name_right.type->get_name());
+        }
+
+        if (is_decimal(left_type) || is_decimal(right_type)) {
             if (!allow_decimal_comparison(left_type, right_type)) {
                 return Status::RuntimeError("No operation {} between {} and 
{}", get_name(),
                                             left_type->get_name(), 
right_type->get_name());


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

Reply via email to