Changeset: b402d3516272 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b402d3516272
Branch: logger-fix
Log Message:

merged with Sep2022


diffs (116 lines):

diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -1602,6 +1602,19 @@ push_up_table(mvc *sql, sql_rel *rel, li
        return rel;
 }
 
+static bool
+exps_have_rank(list *exps)
+{
+       if (!exps)
+               return false;
+       for(node *n=exps->h; n; n = n->next) {
+               sql_exp *e = n->data;
+               if (is_analytic(e))
+                       return true;
+       }
+       return false;
+}
+
 static sql_rel *
 rel_unnest_dependent(mvc *sql, sql_rel *rel)
 {
@@ -1682,7 +1695,7 @@ rel_unnest_dependent(mvc *sql, sql_rel *
                                }
                        }
 
-                       if (r && is_simple_project(r->op) && 
((!exps_have_freevar(sql, r->exps) && !exps_have_unsafe(r->exps, 1)) || 
is_distinct_set(sql, l, ad))) {
+                       if (r && is_simple_project(r->op) && ((!r->r && 
!exps_have_rank(r->exps)) || (!exps_have_freevar(sql, r->exps) && 
!exps_have_unsafe(r->exps, 1)) || is_distinct_set(sql, l, ad))) {
                                rel = push_up_project(sql, rel, ad);
                                return rel_unnest_dependent(sql, rel);
                        }
diff --git a/sql/test/SQLancer/Tests/sqlancer18.test 
b/sql/test/SQLancer/Tests/sqlancer18.test
--- a/sql/test/SQLancer/Tests/sqlancer18.test
+++ b/sql/test/SQLancer/Tests/sqlancer18.test
@@ -313,7 +313,7 @@ SELECT vx.vc0 FROM vx WHERE vx.vc0 <> AL
 1970-01-01
 NULL
 
-statement error GDK reported error: mergejoin: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 SELECT max((SELECT (SELECT rt2.c1 FROM t2) FROM t2 as rt2))
 
 statement ok
@@ -330,7 +330,7 @@ SELECT 1 FROM (select 4) v100(vc0) WHERE
 ----
 1
 
-statement error GDK reported error: mergejoin: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 select 1 from t1 where exists (select min((select t2.c0 from t1)) from t1 as 
t2)
 
 query I rowsort
diff --git a/sql/test/subquery/Tests/correlated.test 
b/sql/test/subquery/Tests/correlated.test
--- a/sql/test/subquery/Tests/correlated.test
+++ b/sql/test/subquery/Tests/correlated.test
@@ -42,7 +42,7 @@ 3
 2
 1
 
-statement error GDK reported error: mergejoin: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 SELECT i, (SELECT 42+i1.i FROM integers) AS j FROM integers i1 ORDER BY i
 
 statement error
@@ -329,7 +329,7 @@ NULL
 statement error 42000!SELECT: subquery must return only one column
 SELECT (SELECT SUM(i + i1.i), 1 FROM integers) FROM integers i1
 
-statement error GDK reported error: mergejoin: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 SELECT (SELECT SUM(i1.i) FROM integers) AS k FROM integers i1 GROUP BY i ORDER 
BY i
 
 query II nosort
@@ -401,7 +401,7 @@ SELECT CAST(SUM((SELECT i+i1.i FROM inte
 ----
 9
 
-statement error GDK reported error: mergejoin: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 SELECT i, CAST(SUM(i1.i) AS BIGINT), CAST((SELECT SUM(i1.i) FROM integers) AS 
BIGINT) AS k FROM integers i1 GROUP BY i ORDER BY i
 
 query II nosort
@@ -511,7 +511,7 @@ 2
 3
 3
 
-statement error GDK reported error: mergejoin: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 SELECT i, SUM(i1.i) FROM integers i1 GROUP BY i ORDER BY (SELECT SUM(i1.i) 
FROM integers)
 
 statement error
diff --git a/sql/test/subquery/Tests/subquery2.test 
b/sql/test/subquery/Tests/subquery2.test
--- a/sql/test/subquery/Tests/subquery2.test
+++ b/sql/test/subquery/Tests/subquery2.test
@@ -296,7 +296,7 @@ 1
 0
 0
 
-statement error GDK reported error: mergejoin: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 SELECT
        (SELECT MAX(col6) FROM tbl_ProductSales) IN (SELECT MIN(col3) FROM 
another_T)
 FROM another_T
diff --git a/sql/test/subquery/Tests/subquery5.test 
b/sql/test/subquery/Tests/subquery5.test
--- a/sql/test/subquery/Tests/subquery5.test
+++ b/sql/test/subquery/Tests/subquery5.test
@@ -404,7 +404,7 @@ SELECT SUM((SELECT MAX(i1.i + i2.i) FROM
 ----
 15
 
-statement error GDK reported error: mergejoin: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 SELECT CORR((SELECT i1.i FROM integers i2), (SELECT SUM(i1.i + i2.i) FROM 
integers i2)) FROM integers i1
 
 query I rowsort
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to