Changeset: 43db25573b11 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/43db25573b11
Modified Files:
        sql/server/rel_select.c
        
sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.test
        sql/test/emptydb/Tests/check.stable.out
        sql/test/emptydb/Tests/check.stable.out.32bit
        sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:

only run unnest on views once (when used)


diffs (101 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -992,7 +992,7 @@ table_ref(sql_query *query, sql_rel *rel
                                if (sql->objid && sql->objid == t->base.id)
                                        return sql_error(sql, 02, 
SQLSTATE(42000) "SELECT: attempting to recursively bind view '%s'.'%s'", 
t->s->base.name, tname);
                                rel = rel_parse(sql, t->s, t->query, 
m_instantiate);
-                               if (rel)
+                               if (rel && sql->emode == m_deps)
                                        rel = rel_unnest(sql, rel);
                        }
 
diff --git 
a/sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.test
 
b/sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.test
--- 
a/sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.test
+++ 
b/sql/test/BugTracker-2018/Tests/count_from_commented_function_signatures.Bug-6542.test
@@ -53,8 +53,8 @@ project (
 | | | | ) [ "f"."id" as "fid", "line" ]
 | | | ) [ "fid" ] [ "line" ASC ]
 | | ) [ "fid" as "commented_function_signatures_6542"."fid" ]
-| ) [  ] [ "sys"."count"() NOT NULL as "%3"."%3" ]
-) [ "%3"."%3" NOT NULL ]
+| ) [  ] [ "sys"."count"() NOT NULL as "%1"."%1" ]
+) [ "%1"."%1" NOT NULL ]
 
 query I rowsort
 select count (*) from sys.commented_function_signatures_6542
diff --git a/sql/test/emptydb/Tests/check.stable.out 
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -6205,8 +6205,8 @@ select 'null in value_partitions.value',
 % %1,  name,   name,   start,  minvalue,       maxvalue,       increment,      
cacheinc,       cycle # name
 % char,        varchar,        varchar,        bigint, bigint, bigint, bigint, 
bigint, boolean # type
 % 13,  0,      0,      1,      1,      1,      1,      1,      5 # length
-% .%21 # table_name
-% %21 # name
+% .%20 # table_name
+% %20 # name
 % bigint # type
 % 1 # length
 [ 0    ]
@@ -6780,8 +6780,8 @@ select 'null in value_partitions.value',
 % %2,  %1,     name # name
 % char,        bigint, varchar # type
 % 26,  1,      0 # length
-% .%24,        .%21,   .statistics # table_name
-% %24, %21,    column_id # name
+% .%24,        .%20,   .statistics # table_name
+% %24, %20,    column_id # name
 % char,        bigint, int # type
 % 24,  1,      1 # length
 % .%3, .%2,    .%1,    .%1,    .%1 # table_name
diff --git a/sql/test/emptydb/Tests/check.stable.out.32bit 
b/sql/test/emptydb/Tests/check.stable.out.32bit
--- a/sql/test/emptydb/Tests/check.stable.out.32bit
+++ b/sql/test/emptydb/Tests/check.stable.out.32bit
@@ -6205,8 +6205,8 @@ select 'null in value_partitions.value',
 % %1,  name,   name,   start,  minvalue,       maxvalue,       increment,      
cacheinc,       cycle # name
 % char,        varchar,        varchar,        bigint, bigint, bigint, bigint, 
bigint, boolean # type
 % 13,  0,      0,      1,      1,      1,      1,      1,      5 # length
-% .%21 # table_name
-% %21 # name
+% .%20 # table_name
+% %20 # name
 % bigint # type
 % 1 # length
 [ 0    ]
@@ -6780,8 +6780,8 @@ select 'null in value_partitions.value',
 % %2,  %1,     name # name
 % char,        bigint, varchar # type
 % 26,  1,      0 # length
-% .%24,        .%21,   .statistics # table_name
-% %24, %21,    column_id # name
+% .%24,        .%20,   .statistics # table_name
+% %24, %20,    column_id # name
 % char,        bigint, int # type
 % 24,  1,      1 # length
 % .%3, .%2,    .%1,    .%1,    .%1 # table_name
diff --git a/sql/test/emptydb/Tests/check.stable.out.int128 
b/sql/test/emptydb/Tests/check.stable.out.int128
--- a/sql/test/emptydb/Tests/check.stable.out.int128
+++ b/sql/test/emptydb/Tests/check.stable.out.int128
@@ -6415,8 +6415,8 @@ select 'null in value_partitions.value',
 % %1,  name,   name,   start,  minvalue,       maxvalue,       increment,      
cacheinc,       cycle # name
 % char,        varchar,        varchar,        bigint, bigint, bigint, bigint, 
bigint, boolean # type
 % 13,  0,      0,      1,      1,      1,      1,      1,      5 # length
-% .%21 # table_name
-% %21 # name
+% .%20 # table_name
+% %20 # name
 % bigint # type
 % 1 # length
 [ 0    ]
@@ -6992,8 +6992,8 @@ select 'null in value_partitions.value',
 % %2,  %1,     name # name
 % char,        bigint, varchar # type
 % 26,  1,      0 # length
-% .%24,        .%21,   .statistics # table_name
-% %24, %21,    column_id # name
+% .%24,        .%20,   .statistics # table_name
+% %24, %20,    column_id # name
 % char,        bigint, int # type
 % 24,  1,      1 # length
 % .%3, .%2,    .%1,    .%1,    .%1 # table_name
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to