No longer accept arbitrary lines as SQL*Plus commands.

This commit is contained in:
hvbargen
2021-02-25 14:43:09 +01:00
parent c4fe303393
commit 387dee88f1
2 changed files with 8 additions and 2 deletions

View File

@ -333,7 +333,6 @@ ASTSqlPlusCommand SqlPlusCommand() :
| <GRANT>
| <REVOKE>
| <DROP>
| <IDENTIFIER>
// Attach Library
| "." <ATTACH>
)

View File

@ -7,6 +7,8 @@ package net.sourceforge.pmd.lang.plsql.ast;
import org.junit.Test;
import net.sourceforge.pmd.lang.plsql.AbstractPLSQLParserTst;
import net.sourceforge.pmd.lang.ast.ParseException;
public class SelectIntoStatementTest extends AbstractPLSQLParserTst {
@ -17,7 +19,12 @@ public class SelectIntoStatementTest extends AbstractPLSQLParserTst {
@Test
public void testParsingExample1() {
plsql.parseResource("SelectIntoStatementExample1.pls");
try {
plsql.parseResource("SelectIntoStatementExample1.pls");
throw new AssertionError("The last line of this example must cause a ParseException.");
} catch (ParseException e) {
// This is expected, because the last line of the example is valid only inside BEGIN END.
}
}
@Test