New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plsql] ParseException when parsing VIEW #981

Closed
dvdtknsn opened this Issue Mar 16, 2018 · 0 comments

Comments

Projects
None yet
3 participants
@dvdtknsn

dvdtknsn commented Mar 16, 2018

Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex].
If not specific to a language, you can use [core].

Affects PMD Version:
6.1.0
Rule:
Issue parsing a .sql file that has a CREATE OR REPLACE VIEW
Description:
net.sourceforge.pmd.PMDException: Error while parsing D:\flOraGithubRepo\HR_WF\Database\HR\Views\EMP_DETAILS_VIEW.sql
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:98)
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:50)
at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:75)
at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:23)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: net.sourceforge.pmd.lang.plsql.ast.ParseException: Encountered "" at line 8, column 2.
Was expecting one of:
"/" ...
";" ...

at net.sourceforge.pmd.lang.plsql.ast.PLSQLParser.generateParseException(PLSQLParser.java:40789)
at net.sourceforge.pmd.lang.plsql.ast.PLSQLParser.jj_consume_token(PLSQLParser.java:40643)
at net.sourceforge.pmd.lang.plsql.ast.PLSQLParser.View(PLSQLParser.java:22737)
at net.sourceforge.pmd.lang.plsql.ast.PLSQLParser.Input(PLSQLParser.java:182)
at net.sourceforge.pmd.lang.plsql.PLSQLParser.parse(PLSQLParser.java:48)
at net.sourceforge.pmd.SourceCodeProcessor.parse(SourceCodeProcessor.java:110)
at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:173)
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:95)

Code Sample demonstrating the issue:
Note that the SQL below was generated using Oracle SQL Developer so I'd have hoped that this is valid.

CREATE OR REPLACE FORCE VIEW "HR_DEV1"."EMP_DETAILS_VIEW" ("EMPLOYEE_ID") AS
SELECT
e.employee_id
FROM
employees e
WITH READ ONLY
;

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
windows command line: >call Tools\pmd\bin\pmd -d "Database\HR\Procedures,Database\HR\Functions,Database\HR\Packages,Database\HR\PackageBodies,Database\HR\Triggers,Database\HR\Views" -l plsql -R pmd_ruleset.xml -f summaryhtml -r Artifacts\static_analysis_report.html

@jsotuyod jsotuyod added the a:bug label Mar 18, 2018

@adangel adangel changed the title from [plsql] plsql.ast.ParseException when parsing VIEW to [plsql] ParseException when parsing VIEW Jul 15, 2018

adangel added a commit to adangel/pmd that referenced this issue Jul 15, 2018

adangel added a commit to adangel/pmd that referenced this issue Jul 15, 2018

@adangel adangel added the has:pr label Jul 15, 2018

@adangel adangel added this to the 6.6.0 milestone Jul 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment