Changeset: 314b8c0d6beb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=314b8c0d6beb
Modified Files:
        sql/server/sql_parser.y
Branch: sciql
Log Message:

make 'ALTER TABLE <tname> ADD COLUMN' work again in sciql branch.

Instead of the correct rule 'ALTER table_or_array qname ADD opt_column
add_table_element', the rule 'ALTER TABLE qname ADD TABLE qname' was selected
to handle an 'ALTER TABLE <tname> ADD COLUMN' statement, since the second rule
is easier to match.  To make the two rules equally complex, we now also use
table_or_array in the rule of ADD TABLE, but gives an error in case one adds a
table to an array.


diffs (19 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
@@ -952,8 +952,13 @@ alter_statement:
          else /* $2 == SQL_ARRAY */
                $$ = _symbol_create_list( SQL_ALTER_ARRAY, l );
        }
- | ALTER TABLE qname ADD TABLE qname
-       { dlist *l = L();
+ | ALTER table_or_array qname ADD TABLE qname
+       { if ($2 == SQL_ARRAY) {
+                       $$ = NULL;
+                       yyerror("\"ADD TABLE\" to an array not allowed");
+                       YYABORT;
+         }
+         dlist *l = L();
          append_list(l, $3);
          append_symbol(l, _symbol_create_list( SQL_TABLE, $6));
          $$ = _symbol_create_list( SQL_ALTER_TABLE, l ); }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to