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

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

commit 83c34821bf8583077655bae3b5debf03e2ae7295
Author: Pxl <[email protected]>
AuthorDate: Fri Nov 10 16:21:28 2023 +0800

    [Bug](decimalv2)  getCmpType return decimalv2 when lhs/rhs type both is 
decimalv2  (#26705)
    
    getCmpType return decimalv2 when lhs/rhs type both is decimalv2
---
 .../org/apache/doris/analysis/BinaryPredicate.java   |  6 ++++++
 regression-test/suites/delete_p0/test_delete.groovy  | 20 ++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
index bce4807357b..5f41faa3c40 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
@@ -422,6 +422,12 @@ public class BinaryPredicate extends Predicate implements 
Writable {
         if (t1 == PrimitiveType.BIGINT && t2 == PrimitiveType.BIGINT) {
             return Type.getAssignmentCompatibleType(getChild(0).getType(), 
getChild(1).getType(), false);
         }
+
+        if (t1 == PrimitiveType.DECIMALV2 && t2 == PrimitiveType.DECIMALV2) {
+            return 
ScalarType.getAssignmentCompatibleDecimalV2Type((ScalarType) 
getChild(0).getType(),
+                    (ScalarType) getChild(1).getType());
+        }
+
         if ((t1 == PrimitiveType.BIGINT && t2 == PrimitiveType.DECIMALV2)
                 || (t2 == PrimitiveType.BIGINT && t1 == 
PrimitiveType.DECIMALV2)
                 || (t1 == PrimitiveType.LARGEINT && t2 == 
PrimitiveType.DECIMALV2)
diff --git a/regression-test/suites/delete_p0/test_delete.groovy 
b/regression-test/suites/delete_p0/test_delete.groovy
index aff35b978cc..2fef1c7be6a 100644
--- a/regression-test/suites/delete_p0/test_delete.groovy
+++ b/regression-test/suites/delete_p0/test_delete.groovy
@@ -280,4 +280,24 @@ PROPERTIES
     """
 
     sql "delete from dwd_pay partitions(p202310) where pay_time = '20231002';"
+
+    sql """
+    ADMIN SET FRONTEND CONFIG ('disable_decimalv2' = 'false');
+    """
+
+    sql "drop table if exists test"
+    sql """
+    CREATE TABLE `test`  
+    (
+            col_1 int,
+            col_2 decimalv2(10,3)
+    )ENGINE=OLAP
+    duplicate KEY(`col_1`)
+    COMMENT 'OLAP'
+    DISTRIBUTED BY HASH(`col_1`) BUCKETS 1
+    PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1"
+    );
+    """
+    sql "DELETE FROM test  WHERE col_2 = cast(123.45 as decimalv2(10,3));"
 }


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

Reply via email to