Changeset: f568beb5d42d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f568beb5d42d
Modified Files:
sql/server/rel_select.c
sql/test/nested/Tests/array_of_comp_with_array.test
sql/test/nested/Tests/simple.test
Branch: nested
Log Message:
approved/changed one more (no longer) crashing test.
Only returning composites needs some work (on path expression handling)
diffs (90 lines):
diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -740,7 +740,7 @@ rel_unnest_func(sql_query *query, list *
sql_table *st = mvc_bind_table(query->sql, t->s,
c->storage_type);
if (!st)
return sql_error(query->sql, ERR_NOTFOUND,
SQLSTATE(42000) "SELECT: unnest multiset table '%s' missing", c->storage_type);
- sql_rel *bt = rel_basetable(query->sql, st,
a_create(query->sql->sa, tname?tname:exp_name(e)));
+ sql_rel *bt = rel_basetable(query->sql, st,
a_create(query->sql->sa, tname?tname:NULL));
if (!bt)
return bt;
prop *p = prop_create(query->sql->sa, PROP_UNNEST,
bt->p);
diff --git a/sql/test/nested/Tests/array_of_comp_with_array.test
b/sql/test/nested/Tests/array_of_comp_with_array.test
--- a/sql/test/nested/Tests/array_of_comp_with_array.test
+++ b/sql/test/nested/Tests/array_of_comp_with_array.test
@@ -10,26 +10,33 @@ insert into aca_pre values (array[(array
statement ok
insert into aca_pre values ('{({"Ca01", "Ca02"}, 300), ({"Cb01", "Cb02"},
310)}', 30), ('{({"Da01", "Da02"}, 400), ({"Db01", "Db02"}, 410)}', 40)
-## CRASH - values are the expected ones
-#query TI nosort outer-array-unnest
-#select arr, k from aca_pre, unnest(arr);
-#----
-#({"Aa01", "Aa02"}, 100)
-#10
-#({"Ab01", "Ab02"}, 110)
-#10
-#({"Ba01", "Ba02"}, 200)
-#20
-#({"Bb01", "Bb02"}, 210)
-#20
-#({"Ca01", "Ca02"}, 300)
-#30
-#({"Cb01", "Cb02"}, 310)
-#30
-#({"Da01", "Da02"}, 400)
-#40
-#({"Db01", "Db02"}, 410)
-#40
+query TII nosort outer-array-unnest
+select a.ms, a.n, k from aca_pre, unnest(arr) a;
+----
+{"Aa01","Aa02"}
+100
+10
+{"Ab01","Ab02"}
+110
+10
+{"Ba01","Ba02"}
+200
+20
+{"Bb01","Bb02"}
+210
+20
+{"Ca01","Ca02"}
+300
+30
+{"Cb01","Cb02"}
+310
+30
+{"Da01","Da02"}
+400
+40
+{"Db01","Db02"}
+410
+40
query TII nosort full-unnest
select in_arr.elements, out_arr.n, k from aca_pre, unnest(arr) as out_arr,
unnest(out_arr.ms) as in_arr
diff --git a/sql/test/nested/Tests/simple.test
b/sql/test/nested/Tests/simple.test
--- a/sql/test/nested/Tests/simple.test
+++ b/sql/test/nested/Tests/simple.test
@@ -33,7 +33,7 @@ statement ok
insert into bar values (array[('left', 'right'), ('left', 'right')])
query TT nosort
-select p.key, p.value from bar, unnest(p)
+select pp.key, pp.value from bar, unnest(p) pp
----
left
right
@@ -86,7 +86,7 @@ statement ok
insert into tpsv values (1, array [ ('left','right'), ('l2','r2') ]), (2,
array [ ('left','right'), ('l2','r2') ]), (3, array [ ('l3', 'r3') ])
query ITT nosort
-select i, p.key, p.value from tpsv cross join unnest(p)
+select i, pp.key, pp.value from tpsv cross join unnest(p) pp
----
1
left
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]