Changeset: 99d401144654 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/99d401144654
Modified Files:
sql/server/rel_unnest.c
sql/test/SQLancer/Tests/sqlancer15.test
Branch: Jul2021
Log Message:
Don't simplify list of atoms with 1 element at the moment, rel_dce optimizer
doesn't handle it well
diffs (45 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
@@ -1902,12 +1902,6 @@ exp_reset_card_and_freevar_set_physical_
e->r = NULL;
reset_freevar(e); /* unnesting is done, we can remove the freevar flag
*/
- if (is_values(e) && list_length(exp_get_values(e))==1) { /* list of
values with 1 element are redundant */
- sql_exp *val = ((list*)e->f)->h->data;
- if (exp_name(e))
- exp_prop_alias(v->sql->sa, val, e);
- e = val;
- }
if (!(e = exp_physical_types(v, rel, e, depth))) /* for decimals and
intervals we need to adjust the scale for some operations */
return NULL;
if (!rel->l)
diff --git a/sql/test/SQLancer/Tests/sqlancer15.test
b/sql/test/SQLancer/Tests/sqlancer15.test
--- a/sql/test/SQLancer/Tests/sqlancer15.test
+++ b/sql/test/SQLancer/Tests/sqlancer15.test
@@ -255,3 +255,25 @@ insert into t0(c2) values(ifthenelse((se
statement ok
ROLLBACK
+
+statement ok
+START TRANSACTION
+
+statement ok
+CREATE TABLE "t0" ("c0" INT)
+
+statement ok rowcount 2
+INSERT INTO "t0" VALUES (3), (2)
+
+query IIIIII rowsort
+select * from t0 join (values (1, 2, 3, 4, 5)) as sub0(a,b,c,d,e) on t0.c0 = 3;
+----
+3
+1
+2
+3
+4
+5
+
+statement ok
+ROLLBACK
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list