Changeset: f0c006e026ba for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f0c006e026ba
Modified Files:
sql/server/rel_optimize_proj.c
sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
Branch: Dec2023
Log Message:
fixed exp_ref bug
diffs (59 lines):
diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c
--- a/sql/server/rel_optimize_proj.c
+++ b/sql/server/rel_optimize_proj.c
@@ -90,6 +90,8 @@ rel_push_project_down_(visitor *v, sql_r
}
}
}
+ /* ToDo handle usefull renames, ie new relation name and unique set of
attribute names (could reduce set of * attributes) */
+ /* handle both useless and usefull with project [ group by ] */
return rel;
}
@@ -391,6 +393,7 @@ exp_rename(mvc *sql, sql_exp *e, sql_rel
}
if (!ne)
return e;
+ sql_exp *oe = e;
e = NULL;
if (exp_name(ne) && ne->r && ne->l)
e = rel_bind_column2(sql, t, ne->l, ne->r, 0);
@@ -401,6 +404,7 @@ exp_rename(mvc *sql, sql_exp *e, sql_rel
sql->errstr[0] = 0;
if (exp_is_atom(ne))
return ne;
+ return oe;
}
return exp_ref(sql, e);
case e_cmp:
diff --git a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
--- a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
+++ b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
@@ -10,23 +10,16 @@ WITH x AS ( SELECT 1 x UNION SELECT - '1
1
1
-query IRI nosort
+statment error syntax error, unexpected ')' in: "with x as ( select 1 x union
select - '199419' ) select 1 from x as where x in ("
WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN
( SELECT min ( x ) OVER ( PARTITION BY x ) AS )
----
-1
-1.000
-1
-1
--199419.000
-1
-skipif knownfail
query T nosort
WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN
( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS )
----
+1
+1
-skipif knownfail
-query T nosort
+statment error GDK reported error: BATsubcross: more than one match
SELECT ( WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS
WHERE x IN ( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS
) )
----
-
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]