Changeset: d0daa0bd498f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d0daa0bd498f Branch: Jun2020 Log Message:
Correct merge with Jun2020-weird-join-results. diffs (96 lines): diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c --- a/sql/server/rel_optimizer.c +++ b/sql/server/rel_optimizer.c @@ -5114,11 +5114,17 @@ rel_join_push_exps_down(visitor *v, sql_ rel->exps = jexps; if (lexps) { l = rel->l = rel_select(v->sql->sa, rel->l, NULL); + if (l->exps) + list_merge(lexps, l->exps, NULL); + l->exps = lexps; v->changes = 1; } if (rexps) { r = rel->r = rel_select(v->sql->sa, rel->r, NULL); + if (r->exps) + list_merge(rexps, r->exps, NULL); + r->exps = rexps; v->changes = 1; } diff --git a/sql/test/bugs/Tests/All b/sql/test/bugs/Tests/All --- a/sql/test/bugs/Tests/All +++ b/sql/test/bugs/Tests/All @@ -65,6 +65,7 @@ default_with_cast.SF-1334486 predicate_or-sf-1409824 alter_view simple_view +do_not_push_down_join_filter float2dec not references-bug diff --git a/sql/test/bugs/Tests/do_not_push_down_join_filter.sql b/sql/test/bugs/Tests/do_not_push_down_join_filter.sql new file mode 100644 --- /dev/null +++ b/sql/test/bugs/Tests/do_not_push_down_join_filter.sql @@ -0,0 +1,12 @@ +START TRANSACTION; + +create table b (id int); +insert into b (id) values(1); + + +select a.* +from (select 1 as id) a +inner join (select id from b where false) c +on a.id = c.id; + +ROLLBACK; diff --git a/sql/test/bugs/Tests/do_not_push_down_join_filter.stable.err b/sql/test/bugs/Tests/do_not_push_down_join_filter.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/bugs/Tests/do_not_push_down_join_filter.stable.err @@ -0,0 +1,12 @@ +stderr of test 'do_not_push_down_join_filter` in directory 'sql/test/bugs` itself: + + +# 15:16:51 > +# 15:16:51 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-5125" "--port=39250" +# 15:16:51 > + + +# 15:16:51 > +# 15:16:51 > "Done." +# 15:16:51 > + diff --git a/sql/test/bugs/Tests/do_not_push_down_join_filter.stable.out b/sql/test/bugs/Tests/do_not_push_down_join_filter.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/bugs/Tests/do_not_push_down_join_filter.stable.out @@ -0,0 +1,25 @@ +stdout of test 'do_not_push_down_join_filter` in directory 'sql/test/bugs` itself: + + +# 15:16:51 > +# 15:16:51 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-5125" "--port=39250" +# 15:16:51 > + +#START TRANSACTION; +#create table b (id int); +#insert into b (id) values(1); +[ 1 ] +#select a.* +#from (select 1 as id) a +#inner join (select id from b where false) c +#on a.id = c.id; +% .a # table_name +% id # name +% tinyint # type +% 1 # length +#ROLLBACK; + +# 15:16:51 > +# 15:16:51 > "Done." +# 15:16:51 > + _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list