Skip to content

[BUG] JSQLParser Version : 5.1 RDBMS : parser crashing when more than 2 line breaks in FROM clause #2156

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

Closed
blav opened this issue Feb 3, 2025 · 1 comment

Comments

@blav
Copy link

blav commented Feb 3, 2025

Always check against the Latest SNAPSHOT of JSQLParser and the Syntax Diagram

Failing SQL Feature:

  • Parser crashes when more than 2 line breaks in FROM clause
  • Example: SELECT * FROM\n\n\ntable_name; can't be parsed

SQL Example:

  • Simplified Query Example, focusing on the failing feature

    select * from
    
    
    
    table_name;
    import net.sf.jsqlparser.JSQLParserException;
    import net.sf.jsqlparser.parser.CCJSqlParserUtil;
    
    class CrashOnTooManyLineBreaks {
      public static void main (String[] args) throws JSQLParserException {
        // works
        CCJSqlParserUtil.parse ("SELECT * FROM\n\ntable_name;");
        
        // fails
        CCJSqlParserUtil.parse ("SELECT * FROM\n\n\ntable_name;");
      }
    }

Software Information:

  • JSqlParser version 5.1
  • Database (PostgreSQL)
@manticore-projects
Copy link
Contributor

Greetings!

2 empty lines \n\n terminate a statement. Please see #1988

Duplicate #1988

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants