forked from phoedos/pmd
@ -37,6 +37,8 @@ This is a {{ site.pmd.release_type }} release.
|
||||
* [#1633](https://github.com/pmd/pmd/issues/1633): \[java] UnsynchronizedStaticFormatter reports commons lang FastDateFormat
|
||||
* java-performance
|
||||
* [#1632](https://github.com/pmd/pmd/issues/1632): \[java] ConsecutiveLiteralAppends false positive over catch
|
||||
* plsql
|
||||
* [#1589](https://github.com/pmd/pmd/issues/1589): \[plsql] ParseException with subqueries in WHERE clause
|
||||
|
||||
### API Changes
|
||||
|
||||
|
@ -1414,6 +1414,8 @@ ASTSqlExpression SqlExpression() :
|
||||
LOOKAHEAD(2) Column()
|
||||
|
|
||||
LOOKAHEAD(2) <ROWNUM>
|
||||
|
|
||||
LOOKAHEAD(2) "(" SelectStatement() ")" // see "Scalar Subquery Expressions"
|
||||
|
|
||||
AdditiveExpression() // this can be a literal or a simple expression, but no conditional
|
||||
)
|
||||
|
@ -68,4 +68,11 @@ public class WhereClauseTest extends AbstractPLSQLParserTst {
|
||||
StandardCharsets.UTF_8);
|
||||
ASTInput input = parsePLSQL(code);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSubqueries() throws Exception {
|
||||
String code = IOUtils.toString(this.getClass().getResourceAsStream("WhereClauseSubqueries.pls"),
|
||||
StandardCharsets.UTF_8);
|
||||
ASTInput input = parsePLSQL(code);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
--
|
||||
-- Where Clause with Subqueries
|
||||
--
|
||||
|
||||
BEGIN
|
||||
|
||||
SELECT id INTO v_id FROM table
|
||||
WHERE id = (SELECT id FROM other_table);
|
||||
|
||||
UPDATE table SET name = 'a'
|
||||
WHERE id = (SELECT id FROM other_table);
|
||||
|
||||
END;
|
||||
/
|
Reference in New Issue
Block a user