Skip to content

[BUG] JSQLParser 5.0: RDBMS : SQL was automatically intercepted #2193

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
CodergreenV opened this issue Mar 19, 2025 · 1 comment
Closed

[BUG] JSQLParser 5.0: RDBMS : SQL was automatically intercepted #2193

CodergreenV opened this issue Mar 19, 2025 · 1 comment

Comments

@CodergreenV
Copy link

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

Failing SQL Feature:

SQL was automatically intercepted

SQL Example:

select * from user
         WHERE  userId = ?







                and (
                userHead like '%' || ? || '%'
                or itemName like '%' || ? || '%'
                or itemCode like '%' || ? || '%'
                )

Software Information:

  • JSqlParser 5.0
  • Database MySQL

Tips:

When there are more than 2 consecutive /n, the SQL will be automatically truncated. I use System. out. println (statement); printed the results

My Demo is

String sql = "select * from user\n" +
                "         WHERE  userId = ?\n" +
                "\n" +
                "\n" +
                "\n" +
                "\n" +
                "\n" +
                "\n" +
                "\n" +
                "                and (\n" +
                "                userHead like '%' || ? || '%'\n" +
                "                or itemName like '%' || ? || '%'\n" +
                "                or itemCode like '%' || ? || '%'\n" +
                "                )";
        CCJSqlParser parser = CCJSqlParserUtil.newParser(sql);
        parser.withSquareBracketQuotation(true);
        try {
            Statement statement = parser.Statement();
            System.out.println(statement);
        }catch (ParseException e) {
            throw new RuntimeException(e);
        }
@manticore-projects
Copy link
Contributor

Duplicate #1988

2 empty lines \n\n terminate a statement.

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