Closed felipebz closed 8 years ago
@nmorais do you already know what file is causing the problem in the analysis, right?
Could you open the problematic file in the sslr-plsql-toolkit and parse it, please?
If I broke the parser, the sslr-plsql-tookit will get stuck too.
@felipebz, sslr-plsql-toolkit got stuck too.
I have found what was freezing it in the file. After cutting several parts of the file, i have found that a subquery inside an EXISTS clause was the problem.
In previous commits, the parser simply failed because a AT as table alias. I dont know how the parser does not failed again, but moving the AT keyword to non reserved solved the problem.
As I have thousands of ATs used as table alias in my code, I have to support it anyway.
Finally, as it is supported, I'm making pull request #13 to move it to non reserved.
@nmorais just to be clear, the cause of the freezing is the use "AT" as a table alias? Or the problem with the subquery inside an EXISTS clause that you mentioned is another situation?
Anyway, you made me realize that I made a wrong assumption in the PlSqlKeyword class.
Actually there are two sets of reserved keywords:
"AT" is a reserved keyword in PL/SQL (we can't declare a "PROCEDURE AT(...)"), but it isn't reserved in SQL. Thanks for the pull request, I'll review it soon.
@felipebz, I have found that the cause was the AT keyword itself. This file has 1k+ lines and the keyword appears dozens of times. Parsing runned instantly after replacing the AT keyword for other alias.
Hi @felipebz!
I think this issue can be closed.
This problem surfaced again in the same file last week. It was related to a issue in a CASE statement. When the implementation the the CASE statement was fixed, the filed parsed fast.
It seems a problem that can appear when parser fails in complex files, not a bug of this plugin.
Since 98% of my code base is parsing successfully, I hope this problem never appear again! :)
Since it can't be reproduced anymore, I will close this issue. ;-)
@nmorais on https://github.com/felipebz/sonar-plsql/issues/8#issuecomment-251512705: