Skip to content
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

net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "=" "=" #948

Open
balzaron opened this issue Feb 13, 2020 · 0 comments
Open

Comments

@balzaron
Copy link

@balzaron balzaron commented Feb 13, 2020

Describe the bug
jsqlparser cannot parse the expression with "=" in select statement.
To Reproduce
Steps to reproduce the behavior:

  1. Example SQL select sum(case when companyid not in (null) then 1 else 0 end)=1 as validate_companyid from table1;

  2. Parsing this SQL using JSqlParser with this statements
    CCJSqlParserManager ccjSqlParserManager = new CCJSqlParserManager();
    Statement statement;
    List columns = new ArrayList();
    try {
    statement = ccjSqlParserManager.parse(new StringReader(singleSql));

  3. Exception
    Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "=" "="
    at line 1, column 64.
    Was expecting one of:

    "&"
    ","
    "."
    "::"
    ";"
    "<<"
    ">>"
    ...
    Expected behavior

System

  • Database you are using postgres
  • Java Version 1.8_222
  • JSqlParser version 3.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.