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

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit c753b56cf68bd8c6eca55946c6af5dc6f2bee7f0
Author: starocean999 <[email protected]>
AuthorDate: Tue Apr 16 14:40:54 2024 +0800

    [fix](nereids)InSubquery's withChildren method lost typeCoercionExpr 
(#33692)
---
 .../java/org/apache/doris/nereids/trees/expressions/InSubquery.java     | 2 +-
 regression-test/suites/nereids_p0/subquery/test_subquery.groovy         | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InSubquery.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InSubquery.java
index b04f9d3d78b..8b7d0518181 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InSubquery.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InSubquery.java
@@ -106,7 +106,7 @@ public class InSubquery extends SubqueryExpr {
     public InSubquery withChildren(List<Expression> children) {
         Preconditions.checkArgument(children.size() == 2);
         Preconditions.checkArgument(children.get(1) instanceof ListQuery);
-        return new InSubquery(children.get(0), (ListQuery) children.get(1), 
isNot);
+        return new InSubquery(children.get(0), (ListQuery) children.get(1), 
correlateSlots, typeCoercionExpr, isNot);
     }
 
     @Override
diff --git a/regression-test/suites/nereids_p0/subquery/test_subquery.groovy 
b/regression-test/suites/nereids_p0/subquery/test_subquery.groovy
index 45825a0acb0..5f71d92ea9b 100644
--- a/regression-test/suites/nereids_p0/subquery/test_subquery.groovy
+++ b/regression-test/suites/nereids_p0/subquery/test_subquery.groovy
@@ -273,6 +273,7 @@ suite("test_subquery") {
     sql """insert into 
table_100_undef_partitions2_keys3_properties4_distributed_by5(pk,col_int_undef_signed,col_varchar_10__undef_signed)
 values 
(0,3,'l'),(1,null,''),(2,null,'really'),(3,4,''),(4,null,null),(5,3,'s'),(6,2,''),(7,1,''),(8,null,''),(9,5,''),(10,6,null),(11,9,'i'),(12,null,'u'),(13,1,'p'),(14,7,''),(15,null,'v'),(16,2,null),(17,null,''),(18,null,'my'),(19,2,null),(20,7,''),(21,9,''),(22,null,''),(23,null,'good'),(24,7,'n'),(25,1,'my'),(26,null,'k'),(27,null,'you'),(28,4,'
 [...]
     sql """insert into 
table_5_undef_partitions2_keys3_properties4_distributed_by5(pk,col_int_undef_signed,col_varchar_10__undef_signed)
 values (0,null,'r'),(1,null,'m'),(2,9,'his'),(3,1,'good'),(4,0,null);"""
     qt_select_assert_num_row """SELECT * FROM 
table_100_undef_partitions2_keys3_properties4_distributed_by5 AS t1 WHERE 
t1.`pk` IN (0, 6, 8, 9, 5)  OR  t1.`pk`  -  0  <  (SELECT `pk` FROM 
table_5_undef_partitions2_keys3_properties4_distributed_by5 AS t2 WHERE t2.pk = 
9) order by t1.pk;"""
+    sql """SELECT count(1) as c FROM 
table_100_undef_partitions2_keys3_properties4_distributed_by5 HAVING c IN 
(select col_int_undef_signed from 
table_100_undef_partitions2_keys3_properties4_distributed_by5);"""
     sql """drop table if exists 
table_100_undef_partitions2_keys3_properties4_distributed_by5"""
     sql """drop table if exists 
table_5_undef_partitions2_keys3_properties4_distributed_by5"""
     


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

Reply via email to