Changeset: 5b4332f2704f for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5b4332f2704f
Modified Files:
        sql/server/sql_parser.y
        sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
Branch: default
Log Message:

allow for create table as ( subquery ), ie allow brackets.


diffs (79 lines):

diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y
--- a/sql/server/sql_parser.y
+++ b/sql/server/sql_parser.y
@@ -108,6 +108,7 @@ int yydebug=1;
        copyfrom_stmt
        table_def
        view_def
+       query_expression_def
        query_expression
        with_query_expression
        role_def
@@ -1356,7 +1357,7 @@ table_content_source:
 as_subquery_clause:
        opt_column_list
        AS
-       query_expression                        
+       query_expression_def
        with_or_without_data
                        { $$ = append_list(L(), $1);
                          append_symbol($$, $3); 
@@ -1669,7 +1670,7 @@ like_table:
  ;
 
 view_def:
-    VIEW qname opt_column_list AS query_expression opt_with_check_option
+    VIEW qname opt_column_list AS query_expression_def opt_with_check_option
        {  dlist *l = L();
          append_list(l, $2);
          append_list(l, $3);
@@ -1680,6 +1681,11 @@ view_def:
        }
   ;
 
+query_expression_def:
+       query_expression
+  |    '(' query_expression_def ')'    { $$ = $2; }
+  ;
+
 query_expression:
        select_no_parens_orderby
   |    with_query
@@ -2466,14 +2472,14 @@ copyfrom_stmt:
          append_list(l, $7);
          append_int(l, $8);
          $$ = _symbol_create_list( SQL_BINCOPYFROM, l ); }
-  | COPY query_expression INTO string opt_seps opt_null_string 
+  | COPY query_expression_def INTO string opt_seps opt_null_string 
        { dlist *l = L();
          append_symbol(l, $2);
          append_string(l, $4);
          append_list(l, $5);
          append_string(l, $6);
          $$ = _symbol_create_list( SQL_COPYTO, l ); }
-  | COPY query_expression INTO STDOUT opt_seps opt_null_string
+  | COPY query_expression_def INTO STDOUT opt_seps opt_null_string
        { dlist *l = L();
          append_symbol(l, $2);
          append_string(l, NULL);
diff --git a/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out 
b/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
--- a/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
+++ b/sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out
@@ -82,7 +82,6 @@ project (
 | | | | | | | | | select (
 | | | | | | | | | | group by (
 | | | | | | | | | | | join (
-| | | | | | | | | | | | table(sys.bidder) [ bidder.id NOT NULL HASHCOL  as 
b3a.id, bidder.open_auction_id NOT NULL as b3a.open_auction_id ] COUNT ,
 | | | | | | | | | | | | project (
 | | | | | | | | | | | | | crossproduct (
 | | | | | | | | | | | | | | project (
@@ -93,7 +92,8 @@ project (
 | | | | | | | | | | | | | | ) [ o.id NOT NULL HASHCOL , o.open_auction_id NOT 
NULL, b.id NOT NULL HASHCOL , b.open_auction_id NOT NULL, b.date NOT NULL, 
b.time NOT NULL, b.personref NOT NULL, b.increase NOT NULL, sys.identity(o.id 
NOT NULL HASHCOL ) HASHCOL  as L10.L10 ],
 | | | | | | | | | | | | | | table(sys.bidder) [ bidder.id NOT NULL HASHCOL  as 
b3.id, bidder.increase NOT NULL as b3.increase ] COUNT 
 | | | | | | | | | | | | | ) [  ]
-| | | | | | | | | | | | ) [ L10.L10 HASHCOL , o.id NOT NULL HASHCOL , 
o.open_auction_id NOT NULL, b.id NOT NULL HASHCOL , b.open_auction_id NOT NULL, 
b.date NOT NULL, b.time NOT NULL, b.personref NOT NULL, b.increase NOT NULL, 
b3.id NOT NULL HASHCOL , b3.increase NOT NULL, sys.identity(o.id NOT NULL 
HASHCOL ) HASHCOL  as L7.L7 ]
+| | | | | | | | | | | | ) [ L10.L10 HASHCOL , o.id NOT NULL HASHCOL , 
o.open_auction_id NOT NULL, b.id NOT NULL HASHCOL , b.open_auction_id NOT NULL, 
b.date NOT NULL, b.time NOT NULL, b.personref NOT NULL, b.increase NOT NULL, 
b3.id NOT NULL HASHCOL , b3.increase NOT NULL, sys.identity(o.id NOT NULL 
HASHCOL ) HASHCOL  as L7.L7 ],
+| | | | | | | | | | | | table(sys.bidder) [ bidder.id NOT NULL HASHCOL  as 
b3a.id, bidder.open_auction_id NOT NULL as b3a.open_auction_id ] COUNT 
 | | | | | | | | | | | ) [ b3a.open_auction_id NOT NULL = o.open_auction_id NOT 
NULL ]
 | | | | | | | | | | ) [ L7.L7, L10.L10 ] [ L10.L10 HASHCOL , o.id NOT NULL 
HASHCOL , o.open_auction_id NOT NULL, b.id NOT NULL HASHCOL , b.open_auction_id 
NOT NULL, b.date NOT NULL, b.time NOT NULL, b.personref NOT NULL, b.increase 
NOT NULL, b3.id NOT NULL HASHCOL , b3.increase NOT NULL, L7.L7 HASHCOL , 
sys.min no nil (b3a.id NOT NULL HASHCOL ) NOT NULL as L1.L1 ]
 | | | | | | | | | ) [ b3.id NOT NULL HASHCOL  = L1 NOT NULL ]
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to