From 0d6bb747562c1e598e946788adaa205e763c1aaf Mon Sep 17 00:00:00 2001 From: Arjen Duursma Date: Thu, 18 Jul 2024 18:53:25 +0200 Subject: [PATCH 1/2] Redo fix for merge without alias in table specification --- pmd-plsql/etc/grammar/PLSQL.jjt | 2 +- .../plsql/ast/MergeStatementIssue1934.pls | 20 ++ .../plsql/ast/MergeStatementIssue1934.txt | 238 +++++++++++++++--- 3 files changed, 231 insertions(+), 29 deletions(-) diff --git a/pmd-plsql/etc/grammar/PLSQL.jjt b/pmd-plsql/etc/grammar/PLSQL.jjt index e30990b3c5..c5d970e242 100644 --- a/pmd-plsql/etc/grammar/PLSQL.jjt +++ b/pmd-plsql/etc/grammar/PLSQL.jjt @@ -2713,7 +2713,7 @@ ASTDeleteStatement DeleteStatement() : ASTMergeStatement MergeStatement() : {} { - [ LOOKAHEAD(2) SchemaName() "." ] TableName() [ TableAlias() ] + [ LOOKAHEAD(2) SchemaName() "." ] TableName() [ LOOKAHEAD(1, ID(), { getToken(1).kind != USING } ) TableAlias() ] ( LOOKAHEAD(3) "(" ValuesClause() ")" diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.pls b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.pls index 555f439f0b..262d1d27c9 100644 --- a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.pls +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.pls @@ -13,5 +13,25 @@ BEGIN THEN UPDATE SET b.text = e.text WHEN NOT MATCHED THEN INSERT (ID,KEY1, TEXT,LCE_ID) values (JHS_SEQ.NEXTVAL,'PROM_EDIT_PROM_NR','Edycja promocji nr',123123); + + + -- Missing alias + MERGE INTO b + USING ( SELECT 'PROM_EDIT_PROM_NR' key1,'Edycja promocji nr' text,123123 lce_id FROM dual ) e + ON (b.key1 = e.key1 and b.lce_id=e.lce_id) + WHEN MATCHED + THEN UPDATE SET b.text = e.text + WHEN NOT MATCHED + THEN INSERT (ID,KEY1, TEXT,LCE_ID) values (JHS_SEQ.NEXTVAL,'PROM_EDIT_PROM_NR','Edycja promocji nr',123123); + + -- Both aliases missing + MERGE INTO b + USING e + ON (b.key1 = e.key1 and b.lce_id=e.lce_id) + WHEN MATCHED + THEN UPDATE SET b.text = e.text + WHEN NOT MATCHED + THEN INSERT (ID,KEY1, TEXT,LCE_ID) values (JHS_SEQ.NEXTVAL,'PROM_EDIT_PROM_NR','Edycja promocji nr',123123); + END; / diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.txt b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.txt index c473d6143c..ba06c6aa3f 100644 --- a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.txt +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/MergeStatementIssue1934.txt @@ -1,38 +1,220 @@ +- Input[@CanonicalImage = null, @ExcludedLinesCount = 0, @ExcludedRangesCount = 0] +- Global[@CanonicalImage = null] +- Block[@CanonicalImage = null] + +- Statement[@CanonicalImage = null] + | +- UnlabelledStatement[@CanonicalImage = null] + | +- MergeStatement[@CanonicalImage = null] + | +- TableName[@CanonicalImage = "JHS_TRANSLATIONS", @Image = "jhs_translations"] + | | +- ID[@CanonicalImage = "JHS_TRANSLATIONS", @Image = "jhs_translations"] + | +- TableAlias[@CanonicalImage = "B", @Image = "b"] + | | +- ID[@CanonicalImage = "B", @Image = "b"] + | +- QueryBlock[@All = false, @CanonicalImage = null, @Distinct = false, @Unique = false] + | | +- SelectList[@CanonicalImage = null] + | | | +- SqlExpression[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | | | +- PrimaryPrefix[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @SelfModifier = false] + | | | | +- Literal[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | | | +- StringLiteral[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @String = "PROM_EDIT_PROM_NR"] + | | | +- ColumnAlias[@CanonicalImage = "KEY1", @Image = "key1"] + | | | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] + | | | +- SqlExpression[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | | | +- PrimaryPrefix[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @SelfModifier = false] + | | | | +- Literal[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | | | +- StringLiteral[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @String = "Edycja promocji nr"] + | | | +- ColumnAlias[@CanonicalImage = "TEXT", @Image = "text"] + | | | | +- ID[@CanonicalImage = "TEXT", @Image = "text"] + | | | +- SqlExpression[@CanonicalImage = "123123", @Image = "123123"] + | | | | +- PrimaryPrefix[@CanonicalImage = "123123", @Image = "123123", @SelfModifier = false] + | | | | +- Literal[@CanonicalImage = "123123", @Image = "123123"] + | | | | +- NumericLiteral[@CanonicalImage = "123123", @Image = "123123"] + | | | +- ColumnAlias[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | +- FromClause[@CanonicalImage = null] + | | +- TableReference[@CanonicalImage = null] + | | +- TableName[@CanonicalImage = "DUAL", @Image = "dual"] + | | +- ID[@CanonicalImage = "DUAL", @Image = "dual"] + | +- TableAlias[@CanonicalImage = "E", @Image = "e"] + | | +- ID[@CanonicalImage = "E", @Image = "e"] + | +- Condition[@CanonicalImage = null] + | | +- CompoundCondition[@CanonicalImage = null, @Type = "AND"] + | | +- ComparisonCondition[@CanonicalImage = null, @Operator = "="] + | | | +- SqlExpression[@CanonicalImage = "B.KEY1", @Image = "b.key1"] + | | | | +- PrimaryPrefix[@CanonicalImage = "B.KEY1", @Image = "b.key1", @SelfModifier = false] + | | | | +- SimpleExpression[@CanonicalImage = "B.KEY1", @Image = "b.key1"] + | | | | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | | | | +- ID[@CanonicalImage = "B", @Image = "b"] + | | | | +- Column[@CanonicalImage = "KEY1", @Image = "key1"] + | | | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] + | | | +- SqlExpression[@CanonicalImage = "E.KEY1", @Image = "e.key1"] + | | | +- PrimaryPrefix[@CanonicalImage = "E.KEY1", @Image = "e.key1", @SelfModifier = false] + | | | +- SimpleExpression[@CanonicalImage = "E.KEY1", @Image = "e.key1"] + | | | +- TableName[@CanonicalImage = "E", @Image = "e"] + | | | | +- ID[@CanonicalImage = "E", @Image = "e"] + | | | +- Column[@CanonicalImage = "KEY1", @Image = "key1"] + | | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] + | | +- Condition[@CanonicalImage = null] + | | +- CompoundCondition[@CanonicalImage = null, @Type = null] + | | +- ComparisonCondition[@CanonicalImage = null, @Operator = "="] + | | +- SqlExpression[@CanonicalImage = "B.LCE_ID", @Image = "b.lce_id"] + | | | +- PrimaryPrefix[@CanonicalImage = "B.LCE_ID", @Image = "b.lce_id", @SelfModifier = false] + | | | +- SimpleExpression[@CanonicalImage = "B.LCE_ID", @Image = "b.lce_id"] + | | | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | | | +- ID[@CanonicalImage = "B", @Image = "b"] + | | | +- Column[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | +- SqlExpression[@CanonicalImage = "E.LCE_ID", @Image = "e.lce_id"] + | | +- PrimaryPrefix[@CanonicalImage = "E.LCE_ID", @Image = "e.lce_id", @SelfModifier = false] + | | +- SimpleExpression[@CanonicalImage = "E.LCE_ID", @Image = "e.lce_id"] + | | +- TableName[@CanonicalImage = "E", @Image = "e"] + | | | +- ID[@CanonicalImage = "E", @Image = "e"] + | | +- Column[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | +- MergeUpdateClause[@CanonicalImage = null] + | | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | | +- ID[@CanonicalImage = "B", @Image = "b"] + | | +- Column[@CanonicalImage = "TEXT", @Image = "text"] + | | | +- ID[@CanonicalImage = "TEXT", @Image = "text"] + | | +- Expression[@CanonicalImage = "E.TEXT", @Image = "e.text"] + | | +- PrimaryPrefix[@CanonicalImage = "E.TEXT", @Image = "e.text", @SelfModifier = false] + | | +- SimpleExpression[@CanonicalImage = "E.TEXT", @Image = "e.text"] + | | +- TableName[@CanonicalImage = "E", @Image = "e"] + | | | +- ID[@CanonicalImage = "E", @Image = "e"] + | | +- Column[@CanonicalImage = "TEXT", @Image = "text"] + | | +- ID[@CanonicalImage = "TEXT", @Image = "text"] + | +- MergeInsertClause[@CanonicalImage = null] + | +- Column[@CanonicalImage = "ID", @Image = "ID"] + | | +- ID[@CanonicalImage = "ID", @Image = "ID"] + | +- Column[@CanonicalImage = "KEY1", @Image = "KEY1"] + | | +- ID[@CanonicalImage = "KEY1", @Image = "KEY1"] + | +- Column[@CanonicalImage = "TEXT", @Image = "TEXT"] + | | +- ID[@CanonicalImage = "TEXT", @Image = "TEXT"] + | +- Column[@CanonicalImage = "LCE_ID", @Image = "LCE_ID"] + | | +- ID[@CanonicalImage = "LCE_ID", @Image = "LCE_ID"] + | +- ValuesClause[@CanonicalImage = null] + | +- Expression[@CanonicalImage = "", @Image = ""] + | | +- PrimaryPrefix[@CanonicalImage = "", @Image = "", @SelfModifier = false] + | | +- SimpleExpression[@CanonicalImage = "", @Image = ""] + | | +- ID[@CanonicalImage = "JHS_SEQ", @Image = "JHS_SEQ"] + | +- Expression[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | +- PrimaryPrefix[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @SelfModifier = false] + | | +- Literal[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | +- StringLiteral[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @String = "PROM_EDIT_PROM_NR"] + | +- Expression[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | +- PrimaryPrefix[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @SelfModifier = false] + | | +- Literal[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | +- StringLiteral[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @String = "Edycja promocji nr"] + | +- Expression[@CanonicalImage = "123123", @Image = "123123"] + | +- PrimaryPrefix[@CanonicalImage = "123123", @Image = "123123", @SelfModifier = false] + | +- Literal[@CanonicalImage = "123123", @Image = "123123"] + | +- NumericLiteral[@CanonicalImage = "123123", @Image = "123123"] + +- Statement[@CanonicalImage = null] + | +- UnlabelledStatement[@CanonicalImage = null] + | +- MergeStatement[@CanonicalImage = null] + | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | +- ID[@CanonicalImage = "B", @Image = "b"] + | +- QueryBlock[@All = false, @CanonicalImage = null, @Distinct = false, @Unique = false] + | | +- SelectList[@CanonicalImage = null] + | | | +- SqlExpression[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | | | +- PrimaryPrefix[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @SelfModifier = false] + | | | | +- Literal[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | | | +- StringLiteral[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @String = "PROM_EDIT_PROM_NR"] + | | | +- ColumnAlias[@CanonicalImage = "KEY1", @Image = "key1"] + | | | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] + | | | +- SqlExpression[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | | | +- PrimaryPrefix[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @SelfModifier = false] + | | | | +- Literal[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | | | +- StringLiteral[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @String = "Edycja promocji nr"] + | | | +- ColumnAlias[@CanonicalImage = "TEXT", @Image = "text"] + | | | | +- ID[@CanonicalImage = "TEXT", @Image = "text"] + | | | +- SqlExpression[@CanonicalImage = "123123", @Image = "123123"] + | | | | +- PrimaryPrefix[@CanonicalImage = "123123", @Image = "123123", @SelfModifier = false] + | | | | +- Literal[@CanonicalImage = "123123", @Image = "123123"] + | | | | +- NumericLiteral[@CanonicalImage = "123123", @Image = "123123"] + | | | +- ColumnAlias[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | +- FromClause[@CanonicalImage = null] + | | +- TableReference[@CanonicalImage = null] + | | +- TableName[@CanonicalImage = "DUAL", @Image = "dual"] + | | +- ID[@CanonicalImage = "DUAL", @Image = "dual"] + | +- TableAlias[@CanonicalImage = "E", @Image = "e"] + | | +- ID[@CanonicalImage = "E", @Image = "e"] + | +- Condition[@CanonicalImage = null] + | | +- CompoundCondition[@CanonicalImage = null, @Type = "AND"] + | | +- ComparisonCondition[@CanonicalImage = null, @Operator = "="] + | | | +- SqlExpression[@CanonicalImage = "B.KEY1", @Image = "b.key1"] + | | | | +- PrimaryPrefix[@CanonicalImage = "B.KEY1", @Image = "b.key1", @SelfModifier = false] + | | | | +- SimpleExpression[@CanonicalImage = "B.KEY1", @Image = "b.key1"] + | | | | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | | | | +- ID[@CanonicalImage = "B", @Image = "b"] + | | | | +- Column[@CanonicalImage = "KEY1", @Image = "key1"] + | | | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] + | | | +- SqlExpression[@CanonicalImage = "E.KEY1", @Image = "e.key1"] + | | | +- PrimaryPrefix[@CanonicalImage = "E.KEY1", @Image = "e.key1", @SelfModifier = false] + | | | +- SimpleExpression[@CanonicalImage = "E.KEY1", @Image = "e.key1"] + | | | +- TableName[@CanonicalImage = "E", @Image = "e"] + | | | | +- ID[@CanonicalImage = "E", @Image = "e"] + | | | +- Column[@CanonicalImage = "KEY1", @Image = "key1"] + | | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] + | | +- Condition[@CanonicalImage = null] + | | +- CompoundCondition[@CanonicalImage = null, @Type = null] + | | +- ComparisonCondition[@CanonicalImage = null, @Operator = "="] + | | +- SqlExpression[@CanonicalImage = "B.LCE_ID", @Image = "b.lce_id"] + | | | +- PrimaryPrefix[@CanonicalImage = "B.LCE_ID", @Image = "b.lce_id", @SelfModifier = false] + | | | +- SimpleExpression[@CanonicalImage = "B.LCE_ID", @Image = "b.lce_id"] + | | | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | | | +- ID[@CanonicalImage = "B", @Image = "b"] + | | | +- Column[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | +- SqlExpression[@CanonicalImage = "E.LCE_ID", @Image = "e.lce_id"] + | | +- PrimaryPrefix[@CanonicalImage = "E.LCE_ID", @Image = "e.lce_id", @SelfModifier = false] + | | +- SimpleExpression[@CanonicalImage = "E.LCE_ID", @Image = "e.lce_id"] + | | +- TableName[@CanonicalImage = "E", @Image = "e"] + | | | +- ID[@CanonicalImage = "E", @Image = "e"] + | | +- Column[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] + | +- MergeUpdateClause[@CanonicalImage = null] + | | +- TableName[@CanonicalImage = "B", @Image = "b"] + | | | +- ID[@CanonicalImage = "B", @Image = "b"] + | | +- Column[@CanonicalImage = "TEXT", @Image = "text"] + | | | +- ID[@CanonicalImage = "TEXT", @Image = "text"] + | | +- Expression[@CanonicalImage = "E.TEXT", @Image = "e.text"] + | | +- PrimaryPrefix[@CanonicalImage = "E.TEXT", @Image = "e.text", @SelfModifier = false] + | | +- SimpleExpression[@CanonicalImage = "E.TEXT", @Image = "e.text"] + | | +- TableName[@CanonicalImage = "E", @Image = "e"] + | | | +- ID[@CanonicalImage = "E", @Image = "e"] + | | +- Column[@CanonicalImage = "TEXT", @Image = "text"] + | | +- ID[@CanonicalImage = "TEXT", @Image = "text"] + | +- MergeInsertClause[@CanonicalImage = null] + | +- Column[@CanonicalImage = "ID", @Image = "ID"] + | | +- ID[@CanonicalImage = "ID", @Image = "ID"] + | +- Column[@CanonicalImage = "KEY1", @Image = "KEY1"] + | | +- ID[@CanonicalImage = "KEY1", @Image = "KEY1"] + | +- Column[@CanonicalImage = "TEXT", @Image = "TEXT"] + | | +- ID[@CanonicalImage = "TEXT", @Image = "TEXT"] + | +- Column[@CanonicalImage = "LCE_ID", @Image = "LCE_ID"] + | | +- ID[@CanonicalImage = "LCE_ID", @Image = "LCE_ID"] + | +- ValuesClause[@CanonicalImage = null] + | +- Expression[@CanonicalImage = "", @Image = ""] + | | +- PrimaryPrefix[@CanonicalImage = "", @Image = "", @SelfModifier = false] + | | +- SimpleExpression[@CanonicalImage = "", @Image = ""] + | | +- ID[@CanonicalImage = "JHS_SEQ", @Image = "JHS_SEQ"] + | +- Expression[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | +- PrimaryPrefix[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @SelfModifier = false] + | | +- Literal[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] + | | +- StringLiteral[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @String = "PROM_EDIT_PROM_NR"] + | +- Expression[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | +- PrimaryPrefix[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @SelfModifier = false] + | | +- Literal[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] + | | +- StringLiteral[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @String = "Edycja promocji nr"] + | +- Expression[@CanonicalImage = "123123", @Image = "123123"] + | +- PrimaryPrefix[@CanonicalImage = "123123", @Image = "123123", @SelfModifier = false] + | +- Literal[@CanonicalImage = "123123", @Image = "123123"] + | +- NumericLiteral[@CanonicalImage = "123123", @Image = "123123"] +- Statement[@CanonicalImage = null] +- UnlabelledStatement[@CanonicalImage = null] +- MergeStatement[@CanonicalImage = null] - +- TableName[@CanonicalImage = "JHS_TRANSLATIONS", @Image = "jhs_translations"] - | +- ID[@CanonicalImage = "JHS_TRANSLATIONS", @Image = "jhs_translations"] - +- TableAlias[@CanonicalImage = "B", @Image = "b"] + +- TableName[@CanonicalImage = "B", @Image = "b"] | +- ID[@CanonicalImage = "B", @Image = "b"] - +- QueryBlock[@All = false, @CanonicalImage = null, @Distinct = false, @Unique = false] - | +- SelectList[@CanonicalImage = null] - | | +- SqlExpression[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] - | | | +- PrimaryPrefix[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @SelfModifier = false] - | | | +- Literal[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'"] - | | | +- StringLiteral[@CanonicalImage = "\'PROM_EDIT_PROM_NR\'", @Image = "\'PROM_EDIT_PROM_NR\'", @String = "PROM_EDIT_PROM_NR"] - | | +- ColumnAlias[@CanonicalImage = "KEY1", @Image = "key1"] - | | | +- ID[@CanonicalImage = "KEY1", @Image = "key1"] - | | +- SqlExpression[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] - | | | +- PrimaryPrefix[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @SelfModifier = false] - | | | +- Literal[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'"] - | | | +- StringLiteral[@CanonicalImage = "\'EDYCJA PROMOCJI NR\'", @Image = "\'Edycja promocji nr\'", @String = "Edycja promocji nr"] - | | +- ColumnAlias[@CanonicalImage = "TEXT", @Image = "text"] - | | | +- ID[@CanonicalImage = "TEXT", @Image = "text"] - | | +- SqlExpression[@CanonicalImage = "123123", @Image = "123123"] - | | | +- PrimaryPrefix[@CanonicalImage = "123123", @Image = "123123", @SelfModifier = false] - | | | +- Literal[@CanonicalImage = "123123", @Image = "123123"] - | | | +- NumericLiteral[@CanonicalImage = "123123", @Image = "123123"] - | | +- ColumnAlias[@CanonicalImage = "LCE_ID", @Image = "lce_id"] - | | +- ID[@CanonicalImage = "LCE_ID", @Image = "lce_id"] - | +- FromClause[@CanonicalImage = null] - | +- TableReference[@CanonicalImage = null] - | +- TableName[@CanonicalImage = "DUAL", @Image = "dual"] - | +- ID[@CanonicalImage = "DUAL", @Image = "dual"] - +- TableAlias[@CanonicalImage = "E", @Image = "e"] + +- TableName[@CanonicalImage = "E", @Image = "e"] | +- ID[@CanonicalImage = "E", @Image = "e"] +- Condition[@CanonicalImage = null] | +- CompoundCondition[@CanonicalImage = null, @Type = "AND"] From f689822d19d4ec0277700e758c84c5a7c87f3bf7 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 19 Jul 2024 16:22:30 +0200 Subject: [PATCH 2/2] [doc] Update release notes (#5121) Refs #5086 --- docs/pages/release_notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index e9e45b1d5f..ab1d137df6 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -47,6 +47,7 @@ This is a {{ site.pmd.release_type }} release. * [#5087](https://github.com/pmd/pmd/pull/5087): \[plsql] Add support for SQL_MACRO - [Arjen Duursma](https://github.com/duursma) (@duursma) * [#5088](https://github.com/pmd/pmd/pull/5088): \[plsql] Add support for 'DEFAULT' clause on the arguments of some oracle functions - [Arjen Duursma](https://github.com/duursma) (@duursma) * [#5107](https://github.com/pmd/pmd/pull/5107): \[doc] Update maven.md - Typo fixed for maven target - [karthikaiyasamy](https://github.com/karthikaiyasamy) (@karthikaiyasamy) +* [#5121](https://github.com/pmd/pmd/pull/5121): \[plsql] Fixed issue with missing optional table alias in MERGE usage - [Arjen Duursma](https://github.com/duursma) (@duursma) {% endtocmaker %}