forked from phoedos/pmd
[plsql] Add support for 'DEFAULT' clause on the arguments of some oracle functions (#5088)
Merge pull request #5088 from duursma:DEFAULT_ARGUMENT
This commit is contained in:
commit
adfb9568b7
@ -18,12 +18,14 @@ This is a {{ site.pmd.release_type }} release.
|
||||
* plsql
|
||||
* [#5086](https://github.com/pmd/pmd/pull/5086): \[plsql] Fixed issue with missing optional table alias in MERGE usage
|
||||
* [#5087](https://github.com/pmd/pmd/pull/5087): \[plsql] Add support for SQL_MACRO
|
||||
* [#5088](https://github.com/pmd/pmd/pull/5088): \[plsql] Add support for 'DEFAULT' clause on the arguments of some oracle functions
|
||||
|
||||
### 🚨 API Changes
|
||||
|
||||
### ✨ External Contributions
|
||||
* [#5086](https://github.com/pmd/pmd/pull/5086): \[plsql] Fixed issue with missing optional table alias in MERGE usage - [Arjen Duursma](https://github.com/duursma) (@duursma)
|
||||
* [#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)
|
||||
|
||||
{% endtocmaker %}
|
||||
|
||||
|
@ -3872,10 +3872,13 @@ ASTArgument Argument() :
|
||||
{
|
||||
//[LOOKAHEAD(2) UnqualifiedID() "=>"] Expression()
|
||||
[LOOKAHEAD(2) (simpleNode = UnqualifiedID()) ("=>" | <AS> ) ]
|
||||
(Expression() )
|
||||
Expression()
|
||||
// e.g. TO_NUMBER allows a DEFAULT clause within an argument
|
||||
// https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/TO_NUMBER.html#GUID-D4807212-AFD7-48A7-9AED-BEC3E8809866
|
||||
[ <_DEFAULT> Expression() <ON> KEYWORD("CONVERSION") "ERROR" ]
|
||||
//Allow Using CharacterSet suffix clause
|
||||
[
|
||||
( <USING> )
|
||||
<USING>
|
||||
( <CHAR_CS> | <NCHAR_CS> )
|
||||
]
|
||||
{
|
||||
|
@ -66,4 +66,9 @@ class PlsqlTreeDumpTest extends BaseTreeDumpTest {
|
||||
void sqlMacroClause() {
|
||||
doTest("SqlMacroClause");
|
||||
}
|
||||
|
||||
@Test
|
||||
void parseSelectExpression() {
|
||||
doTest("SelectExpressions");
|
||||
}
|
||||
}
|
||||
|
@ -15,11 +15,6 @@ import net.sourceforge.pmd.lang.plsql.AbstractPLSQLParserTst;
|
||||
|
||||
class SelectExpressionsTest extends AbstractPLSQLParserTst {
|
||||
|
||||
@Test
|
||||
void parseSelectExpression() {
|
||||
plsql.parseResource("SelectExpressions.pls");
|
||||
}
|
||||
|
||||
@Test
|
||||
void parseSelectSimpleExpression() {
|
||||
ASTInput input = plsql.parseResource("SelectSimpleExpression.pls");
|
||||
|
@ -108,4 +108,11 @@ SELECT CASE
|
||||
INTO VAL
|
||||
FROM dual;
|
||||
END;
|
||||
/
|
||||
|
||||
SELECT
|
||||
TO_NUMBER$('xyz' default 0 on conversion error) BOGUS
|
||||
INTO some_record
|
||||
FROM some_table;
|
||||
|
||||
/
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user