Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TSQL: Allow for table identifier in DELETE clause (#2031)
Co-authored-by: jpersons <jpersons@iuhealth.org> Co-authored-by: Barry Pollard <barry@tunetheweb.com>
- Loading branch information
1 parent
873a116
commit de50325
Showing
3 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
test/fixtures/dialects/tsql/delete_azure_synapse_analytics.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
DELETE dbo.Table2 | ||
FROM dbo.Table2 | ||
INNER JOIN dbo.Table1 | ||
ON (dbo.Table2.ColA = dbo.Table1.ColA) | ||
WHERE dboTable2.ColA = 1; |
63 changes: 63 additions & 0 deletions
63
test/fixtures/dialects/tsql/delete_azure_synapse_analytics.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# YML test files are auto-generated from SQL files and should not be edited by | ||
# hand. To help enforce this, the "hash" field in the file must match a hash | ||
# computed by SQLFluff when running the tests. Please run | ||
# `python test/generate_parse_fixture_yml.py` to generate them after adding or | ||
# altering SQL files. | ||
_hash: d2c61d379d8c39938482d02df983b8690fa6689e21120deb05d50cc4d810664a | ||
file: | ||
batch: | ||
statement: | ||
delete_statement: | ||
keyword: DELETE | ||
table_reference: | ||
- identifier: dbo | ||
- dot: . | ||
- identifier: Table2 | ||
from_clause: | ||
keyword: FROM | ||
from_expression: | ||
from_expression_element: | ||
table_expression: | ||
table_reference: | ||
- identifier: dbo | ||
- dot: . | ||
- identifier: Table2 | ||
join_clause: | ||
- keyword: INNER | ||
- keyword: JOIN | ||
- from_expression_element: | ||
table_expression: | ||
table_reference: | ||
- identifier: dbo | ||
- dot: . | ||
- identifier: Table1 | ||
- join_on_condition: | ||
keyword: 'ON' | ||
expression: | ||
bracketed: | ||
start_bracket: ( | ||
expression: | ||
- column_reference: | ||
- identifier: dbo | ||
- dot: . | ||
- identifier: Table2 | ||
- dot: . | ||
- identifier: ColA | ||
- comparison_operator: '=' | ||
- column_reference: | ||
- identifier: dbo | ||
- dot: . | ||
- identifier: Table1 | ||
- dot: . | ||
- identifier: ColA | ||
end_bracket: ) | ||
where_clause: | ||
keyword: WHERE | ||
expression: | ||
column_reference: | ||
- identifier: dboTable2 | ||
- dot: . | ||
- identifier: ColA | ||
comparison_operator: '=' | ||
literal: '1' | ||
statement_terminator: ; |