Changeset: 93127116bc94 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/93127116bc94 Modified Files: sql/server/rel_exp.c sql/server/rel_optimize_sel.c sql/test/rel-optimizers/Tests/groupjoin.test Branch: Aug2024 Log Message:
Fix equali cmp if semantic flag is set and fix test where any cmp shouldn't match equali cmp. Fixes #7563. diffs (49 lines): diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -1425,11 +1425,19 @@ exp_match_exp_semantics( sql_exp *e1, sq { if (exp_match(e1, e2)) return 1; - if (is_ascending(e1) != is_ascending(e2) || nulls_last(e1) != nulls_last(e2) || zero_if_empty(e1) != zero_if_empty(e2) || - need_no_nil(e1) != need_no_nil(e2) || is_anti(e1) != is_anti(e2) || (semantics && is_semantics(e1) != is_semantics(e2)) || + + if (is_ascending(e1) != is_ascending(e2) || + nulls_last(e1) != nulls_last(e2) || + zero_if_empty(e1) != zero_if_empty(e2) || + need_no_nil(e1) != need_no_nil(e2) || + is_anti(e1) != is_anti(e2) || + (semantics && is_semantics(e1) != is_semantics(e2)) || (semantics && is_any(e1) != is_any(e2)) || - is_symmetric(e1) != is_symmetric(e2) || is_unique(e1) != is_unique(e2) || need_distinct(e1) != need_distinct(e2)) + is_symmetric(e1) != is_symmetric(e2) || + is_unique(e1) != is_unique(e2) || + need_distinct(e1) != need_distinct(e2)) return 0; + if (e1->type == e2->type) { switch(e1->type) { case e_cmp: diff --git a/sql/server/rel_optimize_sel.c b/sql/server/rel_optimize_sel.c --- a/sql/server/rel_optimize_sel.c +++ b/sql/server/rel_optimize_sel.c @@ -705,7 +705,7 @@ cleanup_equal_exps(mvc *sql, sql_rel *re bool needed = false; for(node *n = exps->h; !needed && n; n = n->next) { for (node *m = n->next; !needed && m; m = m->next) { - if (exp_match_exp_semantics(n->data, m->data, false)) + if (exp_match_exp_semantics(n->data, m->data, true)) needed = true; } } diff --git a/sql/test/rel-optimizers/Tests/groupjoin.test b/sql/test/rel-optimizers/Tests/groupjoin.test --- a/sql/test/rel-optimizers/Tests/groupjoin.test +++ b/sql/test/rel-optimizers/Tests/groupjoin.test @@ -14,6 +14,6 @@ project ( | | project ( | | | table("sys"."integers") [ "integers"."i" ] | | ) [ "integers"."i" as "%1"."%1" ] -| ) [ ("i1"."i") + = ("%1"."%1") ] [ boolean(1) "true" as "%4"."%4" ] +| ) [ ("i1"."i") + = ("%1"."%1"), ("i1"."i") = ("%1"."%1") ] [ boolean(1) "true" as "%4"."%4" ] ) [ "i1"."i", "sys"."or"("%4"."%4", "sys"."isnull"("i1"."i") NOT NULL) ] _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org