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

panxiaolei 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 2712bb9f60c [Bug](decimalv2)  getCmpType return decimalv2 when lhs/rhs 
type both is decimalv2  (#26705)
2712bb9f60c is described below

commit 2712bb9f60cb70ee50389a5c9853ce955c08dfb7
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 5996b299603..74f3035285c 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
@@ -451,6 +451,12 @@ public class BinaryPredicate extends Predicate implements 
Writable {
             return Type.getAssignmentCompatibleType(getChild(0).getType(), 
getChild(1).getType(), false,
                     SessionVariable.getEnableDecimal256());
         }
+
+        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