Changeset: 2e34a9045dd8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2e34a9045dd8
Modified Files:
        sql/server/rel_exp.c
Branch: default
Log Message:

small improvement of exp_refers, fixing issue 7401


diffs (25 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
@@ -1212,16 +1212,18 @@ exp_refers( sql_exp *p, sql_exp *c)
                // at first they need to have the same expression names
                if (!p->alias.name || !c->r || strcmp(p->alias.name, c->r) != 0)
                        return 0;
+               if (!c->l)
+                       return 1;
                // then compare the relation names
-               if (c->l) {
+               if (c->l && (p->alias.rname || p->l)) {
                        // if the parent has an alias for the relation name 
compare with the child's relation name
                        if (p->alias.rname && strcmp(p->alias.rname, c->l) != 0)
                                return 0;
                        // if the parent does NOT have a relation name alias 
compare his relation name with the child's
-                       if (!p->alias.rname && p->l && strcmp(p->l, c->l) != 0)
+                       if (!p->alias.rname && p->l && (strcmp(p->l, c->l) != 0 
|| strcmp(p->alias.name, p->r) !=0))
                                return 0;
+                       return 1;
                }
-               return 1;
        }
        return 0;
 }
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to