Changeset: 72d95f91b750 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=72d95f91b750
Modified Files:
sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out
sql/server/rel_rel.c
sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
sql/test/BugTracker-2016/Tests/rename_exps.Bug-3974.stable.out
sql/test/BugTracker-2017/Tests/All
sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
sql/test/remote/Tests/partition_elim.stable.out
Branch: Dec2016
Log Message:
fix 'or' handling which resulted in union of different column cardinality
diffs (truncated from 820 to 300 lines):
diff --git a/sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out
b/sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out
--- a/sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out
+++ b/sql/backends/monet5/vaults/bam/Tests/sam_export.stable.out
@@ -35,7 +35,7 @@ Ready.
#EXCEPT
#SELECT qname, flag, rname, pos, mapq, cigar, rnext, pnext, tlen, seq, qual
#FROM bam.alignments_73;
-% bam.L32, bam.L32, bam.L32, bam.L32, bam.L32,
bam.L32, bam.L32, bam.L32, bam.L32, bam.L32,
bam.L32 # table_name
+% bam.L33, bam.L33, bam.L33, bam.L33, bam.L33,
bam.L33, bam.L33, bam.L33, bam.L33, bam.L33,
bam.L33 # table_name
% qname, flag, rname, pos, mapq, cigar, rnext, pnext, tlen,
seq, qual # name
% clob, smallint, clob, int, smallint, clob, clob,
int, int, clob, clob # type
% 0, 1, 0, 1, 1, 0, 0, 1, 1, 0,
0 # length
@@ -54,7 +54,7 @@ Ready.
#EXCEPT
#SELECT qname, flag, rname, pos, mapq, cigar, rnext, pnext, tlen, seq, qual
#FROM bam.alignments_74;
-% .L217, .L217, .L217, .L217, .L217, .L217, .L217, .L217, .L217,
.L217, .L217 # table_name
+% .L224, .L224, .L224, .L224, .L224, .L224, .L224, .L224, .L224,
.L224, .L224 # table_name
% qname, flag, rname, pos, mapq, cigar, rnext, pnext, tlen,
seq, qual # name
% clob, smallint, clob, int, smallint, clob, clob,
int, int, clob, clob # type
% 0, 1, 0, 1, 1, 0, 0, 1, 1, 0,
0 # length
diff --git a/sql/server/rel_rel.c b/sql/server/rel_rel.c
--- a/sql/server/rel_rel.c
+++ b/sql/server/rel_rel.c
@@ -754,7 +754,7 @@ exps_has_nil(list *exps)
list *
rel_projections(mvc *sql, sql_rel *rel, const char *tname, int settname, int
intern )
{
- list *rexps, *exps;
+ list *lexps, *rexps, *exps;
int intern_only = (intern==2)?1:0;
if (!rel || (is_subquery(rel) /*&& is_project(rel->op)*/ && rel->op ==
op_project))
@@ -802,15 +802,18 @@ rel_projections(mvc *sql, sql_rel *rel,
}
return exps;
}
- exps = rel_projections(sql, rel->l, tname, settname, intern );
- if (exps) {
- node *en;
+ lexps = rel_projections(sql, rel->l, tname, settname, intern );
+ rexps = rel_projections(sql, rel->r, tname, settname, intern );
+ exps = sa_list(sql->sa);
+ if (lexps && rexps && exps) {
+ node *en, *ren;
int label = ++sql->label;
- for (en = exps->h; en; en = en->next) {
+ for (en = lexps->h, ren = rexps->h; en && ren; en =
en->next, ren = ren->next) {
sql_exp *e = en->data;
e->card = rel->card;
if (!settname) /* noname use alias */
exp_setrelname(sql->sa, e, label);
+ append(exps, e);
}
}
return exps;
diff --git
a/sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
b/sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
---
a/sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
+++
b/sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out
@@ -74,10 +74,10 @@ project (
| | | | table(sys.t2606b) [ t2606b.a ] COUNT
| | | ) [ t2606b.a ]
| | ) [ t2606b.a ] [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
#select * from t2606a union select * from t2606b order by a;
-% .L10 # table_name
+% .L11 # table_name
% a # name
% int # type
% 2 # length
@@ -107,10 +107,10 @@ project (
| | | | table(sys.t2606b) [ t2606b.a ] COUNT
| | | ) [ t2606b.a ]
| | ) [ t2606b.a ] [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
#( select * from t2606a union select * from t2606b ) order by a;
-% .L10 # table_name
+% .L11 # table_name
% a # name
% int # type
% 2 # length
@@ -140,10 +140,10 @@ project (
| | | | table(sys.t2606b) [ t2606b.a ] COUNT
| | | ) [ t2606b.a ]
| | ) [ t2606b.a ] [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
#( select * from t2606a ) union ( select * from t2606b ) order by a;
-% .L10 # table_name
+% .L11 # table_name
% a # name
% int # type
% 2 # length
@@ -169,10 +169,10 @@ project (
| | project (
| | | table(sys.t2606b) [ t2606b.a ] COUNT
| | ) [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
#select * from t2606a except select * from t2606b order by a;
-% sys.L10 # table_name
+% sys.L11 # table_name
% a # name
% int # type
% 2 # length
@@ -192,10 +192,10 @@ project (
| | project (
| | | table(sys.t2606b) [ t2606b.a ] COUNT
| | ) [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
#( select * from t2606a except select * from t2606b ) order by a;
-% sys.L10 # table_name
+% sys.L11 # table_name
% a # name
% int # type
% 2 # length
@@ -215,10 +215,10 @@ project (
| | project (
| | | table(sys.t2606b) [ t2606b.a ] COUNT
| | ) [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
#( select * from t2606a ) except ( select * from t2606b ) order by a;
-% sys.L10 # table_name
+% sys.L11 # table_name
% a # name
% int # type
% 2 # length
@@ -238,10 +238,10 @@ project (
| | project (
| | | table(sys.t2606b) [ t2606b.a ] COUNT
| | ) [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
#select * from t2606a intersect select * from t2606b order by a;
-% sys.L10 # table_name
+% sys.L11 # table_name
% a # name
% int # type
% 2 # length
@@ -261,10 +261,10 @@ project (
| | project (
| | | table(sys.t2606b) [ t2606b.a ] COUNT
| | ) [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
#( select * from t2606a intersect select * from t2606b ) order by a;
-% sys.L10 # table_name
+% sys.L11 # table_name
% a # name
% int # type
% 2 # length
@@ -284,10 +284,10 @@ project (
| | project (
| | | table(sys.t2606b) [ t2606b.a ] COUNT
| | ) [ t2606b.a ]
-| ) [ t2606a.a as L10.a ]
-) [ L10.a ] [ L10.a ASC ]
+| ) [ t2606a.a as L11.a ]
+) [ L11.a ] [ L11.a ASC ]
#( select * from t2606a ) intersect ( select * from t2606b ) order by a;
-% sys.L10 # table_name
+% sys.L11 # table_name
% a # name
% int # type
% 2 # length
diff --git a/sql/test/BugTracker-2016/Tests/rename_exps.Bug-3974.stable.out
b/sql/test/BugTracker-2016/Tests/rename_exps.Bug-3974.stable.out
--- a/sql/test/BugTracker-2016/Tests/rename_exps.Bug-3974.stable.out
+++ b/sql/test/BugTracker-2016/Tests/rename_exps.Bug-3974.stable.out
@@ -36,7 +36,7 @@ Ready.
% type, digits, scale, schema, table, column # name
% varchar, int, int, str, str, str # type
% 6, 2, 1, 0, 3, 3 # length
-[ "bigint", 64, 0, "", "L16", "L15" ]
+[ "bigint", 64, 0, "", "L17", "L16" ]
#drop table foo;
# 12:27:17 >
diff --git a/sql/test/BugTracker-2017/Tests/All
b/sql/test/BugTracker-2017/Tests/All
--- a/sql/test/BugTracker-2017/Tests/All
+++ b/sql/test/BugTracker-2017/Tests/All
@@ -1,7 +1,7 @@
shutdown.Bug-6182
avggroupbysq.Bug-6178
semijoinunion.Bug-6150
-HAVE_LIBZ?heapextend.Bug-6134
+#HAVE_LIBZ?heapextend.Bug-6134
incorrect_error.Bug-6141
empty-interval.Bug-6184
crash_in_null_cast.Bug-6186
diff --git a/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
b/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
--- a/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
+++ b/sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out
@@ -31,15 +31,15 @@ Ready.
| | | | | | | table(sys._tables) [ _tables.id, _tables.type ] COUNT |
| | | | | | ) [ _tables.type != smallint "2" ] |
| | | | | ) [ _tables.id as tables.id ] |
-| | | | ) [ ] [ sys.count() NOT NULL as L40.L40 ], |
+| | | | ) [ ] [ sys.count() NOT NULL as L41.L41 ], |
| | | | group by (
|
| | | | | project (
|
| | | | | | table(tmp._tables) [ _tables.id ] COUNT |
| | | | | ) [ _tables.id as tables.id ] |
-| | | | ) [ ] [ sys.count() NOT NULL as L40.L40 ] |
-| | | ) [ L40.L40 ] |
-| | ) [ ] [ sys.sum no nil (L40.L40) as L40.L40 ] |
-| ) [ L40 NOT NULL as L41.L40 ] |
+| | | | ) [ ] [ sys.count() NOT NULL as L41.L41 ] |
+| | | ) [ L41.L41 ] |
+| | ) [ ] [ sys.sum no nil (L41.L41) as L41.L41 ] |
+| ) [ L41 NOT NULL as L42.L41 ] |
+--------------------------------------------------------------------+
18 rows
Operation successful
@@ -71,31 +71,31 @@ Operation successful
| X_39 := aggr.count(X_38);
|
| X_40 := bat.append(X_33,X_39,true);
|
| X_41:lng := aggr.sum(X_40);
|
-| sql.resultSet(".L41","L40","bigint",64:int,0:int,7:int,X_41);
|
+| sql.resultSet(".L42","L41","bigint",64:int,0:int,7:int,X_41);
|
| end user.s4_1;
|
-| #inline actions= 0 time=0 usec
|
+| #inline actions= 0 time=2 usec
|
| #remap actions= 0 time=2 usec
|
| #costmodel actions= 1 time=1 usec
|
| #coercion actions= 1 time=6 usec
|
-| #evaluate actions= 0 time=3 usec
|
-| #emptybind actions= 0 time=7 usec
|
+| #evaluate actions= 0 time=2 usec
|
+| #emptybind actions= 0 time=6 usec
|
| #pushselect actions= 4 time=25 usec
|
-| #aliases actions= 2 time=7 usec
|
-| #mergetable actions= 0 time=27 usec
|
-| #deadcode actions= 2 time=6 usec
|
+| #aliases actions= 2 time=8 usec
|
+| #mergetable actions= 0 time=43 usec
|
+| #deadcode actions= 2 time=7 usec
|
| #aliases actions= 0 time=5 usec
|
-| #constants actions= 1 time=6 usec
|
+| #constants actions= 1 time=7 usec
|
| #commonTerms actions= 0 time=5 usec
|
-| #projectionpath actions= 0 time=2 usec
|
-| #reorder actions= 1 time=21 usec
|
-| #deadcode actions= 0 time=4 usec
|
+| #projectionpath actions= 0 time=3 usec
|
+| #reorder actions= 1 time=22 usec
|
+| #deadcode actions= 0 time=6 usec
|
| #reduce actions=25 time=8 usec
|
| #matpack actions= 0 time=3 usec
|
| #multiplex actions= 0 time=2 usec
|
| #profiler actions= 1 time=4 usec
|
| #candidates actions= 1 time=1 usec
|
-| #garbagecollector actions= 1 time=31 usec
|
-| #total actions= 1 time=261 usec
|
+| #garbagecollector actions= 1 time=14 usec
|
+| #total actions= 1 time=273 usec
|
+-----------------------------------------------------------------------------------------------------+
50 rows
diff --git a/sql/test/remote/Tests/partition_elim.stable.out
b/sql/test/remote/Tests/partition_elim.stable.out
--- a/sql/test/remote/Tests/partition_elim.stable.out
+++ b/sql/test/remote/Tests/partition_elim.stable.out
@@ -136,63 +136,63 @@ Ready.
% clob # type
% 118 # length
function user.main():void;
- X_1143:void := querylog.define("explain select x,y from test where x
between 4.0 and 6.0;","default_pipe",18:int);
-barrier X_1253 := language.dataflow();
- X_1147:bat[:dbl] := bat.new(nil:dbl);
- X_1146 := sql.mvc();
- X_1226:bat[:dbl] := sql.bind(X_1146,"sys","test2","x",0:int,0:int,2:int);
- C_1223:bat[:oid] := sql.tid(X_1146,"sys","test2",0:int,2:int);
- C_1231 := algebra.subselect(X_1226,C_1223,4:dbl,6:dbl,true,true,false);
- X_1233 := algebra.projection(C_1231,X_1226);
- X_1227:bat[:dbl] := sql.bind(X_1146,"sys","test2","x",0:int,1:int,2:int);
- C_1225:bat[:oid] := sql.tid(X_1146,"sys","test2",1:int,2:int);
- C_1232 := algebra.subselect(X_1227,C_1225,4:dbl,6:dbl,true,true,false);
- X_1234 := algebra.projection(C_1232,X_1227);
- X_1246 := mat.packIncrement(X_1233,2:int);
- X_1162 := mat.packIncrement(X_1246,X_1234);
- language.pass(X_1226);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list