Changeset: 9fb6702e320f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9fb6702e320f
Modified Files:
        sql/server/rel_dump.c
        sql/test/miscellaneous/Tests/groupby_error.test
        sql/test/miscellaneous/Tests/simple_selects.test
Branch: Sep2022
Log Message:

attribute only alias (allthough equal to the original attribute name) hides the 
table/relation name.


diffs (54 lines):

diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c
--- a/sql/server/rel_dump.c
+++ b/sql/server/rel_dump.c
@@ -254,7 +254,7 @@ exp_print(mvc *sql, stream *fout, sql_ex
                        strcmp(exp_relname(e), e->l) == 0 &&
                        strcmp(exp_name(e), e->r) == 0)
                        alias = 0;
-               if (!exp_relname(e) && exp_name(e) && strcmp(exp_name(e), 
e->r)==0)
+               if (!exp_relname(e) && exp_name(e) && !e->l && 
strcmp(exp_name(e), e->r)==0)
                        alias = 0;
                break;
        case e_cmp:
diff --git a/sql/test/miscellaneous/Tests/groupby_error.test 
b/sql/test/miscellaneous/Tests/groupby_error.test
--- a/sql/test/miscellaneous/Tests/groupby_error.test
+++ b/sql/test/miscellaneous/Tests/groupby_error.test
@@ -406,7 +406,7 @@ project (
 | | | table("sys"."tab2") [ "tab2"."myk" as "myalias1"."myk", "tab2"."ups" 
UNIQUE as "myalias1"."ups" ]
 | | ) [ ("myalias0"."part" UNIQUE) = ("myalias1"."myk") ]
 | ) [ "myalias1"."ups", "myalias0"."part", "myalias0"."tet" as "track" ] [ 
"myalias0"."part", "track", "myalias0"."tet", "sys"."count"() NOT NULL as 
"%1"."%1" ]
-) [ "myalias0"."part", "myalias0"."tet", "%1"."%1" NOT NULL as "mycount", 
"track" ]
+) [ "myalias0"."part" as "part", "myalias0"."tet" as "tet", "%1"."%1" NOT NULL 
as "mycount", "track" ]
 
 query IIII rowsort
 select
diff --git a/sql/test/miscellaneous/Tests/simple_selects.test 
b/sql/test/miscellaneous/Tests/simple_selects.test
--- a/sql/test/miscellaneous/Tests/simple_selects.test
+++ b/sql/test/miscellaneous/Tests/simple_selects.test
@@ -914,7 +914,7 @@ project (
 | group by (
 | |  [  [ tinyint(2) "1", tinyint(2) "2", tinyint(2) "3" ] as "x"."x", "x"."x" 
NOT NULL as "x1" ]
 | ) [ "x"."x" NOT NULL ] [ "x"."x" NOT NULL, "x1" NOT NULL ]
-) [ "x"."x" NOT NULL UNIQUE, "x1" NOT NULL ]
+) [ "x"."x" NOT NULL UNIQUE as "x", "x1" NOT NULL ]
 
 query II rowsort
 SELECT x AS x, x + 1 AS x1 FROM (VALUES (1),(2),(3)) x(x) GROUP BY x, x1
@@ -936,7 +936,7 @@ project (
 | | |  [  [ tinyint(2) "1", tinyint(2) "2", tinyint(2) "3" ] as "x"."x" ]
 | | ) [ "x"."x" NOT NULL, "sys"."sql_add"("x"."x" NOT NULL, tinyint(2) "1") 
NOT NULL as "x1" ]
 | ) [ "x"."x" NOT NULL ] [ "x"."x" NOT NULL, "x1" NOT NULL ]
-) [ "x"."x" NOT NULL UNIQUE, "x1" NOT NULL ]
+) [ "x"."x" NOT NULL UNIQUE as "x", "x1" NOT NULL ]
 
 query II rowsort
 SELECT x AS x, (10 + x) * 2 - 29 AS x1 FROM (VALUES (1),(2),(3),(4),(5)) x(x) 
GROUP BY x, x1
@@ -962,7 +962,7 @@ project (
 | | |  [  [ tinyint(3) "1", tinyint(3) "2", tinyint(3) "3", tinyint(3) "4", 
tinyint(3) "5" ] as "x"."x" ]
 | | ) [ "x"."x" NOT NULL, "sys"."sql_add"("x"."x" NOT NULL, tinyint(5) "10") 
NOT NULL as "%7"."%7", "sys"."sql_mul"("%7"."%7" NOT NULL, tinyint(2) "2") NOT 
NULL as "%10"."%10", "sys"."sql_sub"("%10"."%10" NOT NULL, smallint(10) "29") 
NOT NULL as "x1" ]
 | ) [ "x"."x" NOT NULL ] [ "x"."x" NOT NULL, "x1" NOT NULL ]
-) [ "x"."x" NOT NULL UNIQUE, "x1" NOT NULL ]
+) [ "x"."x" NOT NULL UNIQUE as "x", "x1" NOT NULL ]
 
 query I nosort
 SELECT count(1) FROM (SELECT 
0.642700575141694319114549216465093195438385009765 % 3) x(x) GROUP BY 
2+(0+round(x.x, 1))
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to