Closed 3manuek closed 2 years ago
SQL Server DDL definition accepts the following pattern:
REFERENCES referenced_table_name [ ( ref_column ) ]
There is a related babelfish_extensions' issue and it has a pending PR.
Proposed patch:
diff --git a/src/main/parser/TSQLParser.g4 b/src/main/parser/TSQLParser.g4 index b2fa036..741e06b 100644 --- a/src/main/parser/TSQLParser.g4 +++ b/src/main/parser/TSQLParser.g4 @@ -3225,7 +3225,7 @@ column_constraint :(CONSTRAINT constraint=id)? ((PRIMARY KEY | UNIQUE) clustered? with_index_options? | CHECK for_replication? LR_BRACKET search_condition RR_BRACKET - | (FOREIGN KEY)? REFERENCES table_name LR_BRACKET pk = column_name_list RR_BRACKET (on_update | on_delete)* for_replication? + | (FOREIGN KEY)? REFERENCES table_name (LR_BRACKET pk = column_name_list RR_BRACKET)? (on_update | on_delete)* for_replication? | DEFAULT expression | null_notnull | WITH VALUES
@nasbyj -- could you grant me access to create/push branches and Issue Management?
This fix is already scheduled to be included for the next release of Compass
Description
SQL Server DDL definition accepts the following pattern:
There is a related babelfish_extensions' issue and it has a pending PR.
Proposed patch: