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

encounter ParseException wher parse a page sql #963

Open
whq4123 opened this issue Mar 29, 2020 · 0 comments
Open

encounter ParseException wher parse a page sql #963

whq4123 opened this issue Mar 29, 2020 · 0 comments

Comments

@whq4123
Copy link

@whq4123 whq4123 commented Mar 29, 2020

Describe the bug
when parse a page sql with CCJSqlParserUtil, encounter a ParseException, but the sql is right which can run in my pgSQL

To Reproduce
Steps to reproduce the behavior:

  1. Example SQL:
    select s.* from camera s where s.index_code = '12' limit 10 offset (5 - 1) * 10
  2. Parsing this SQL using JSqlParser with this statements:
    CCJSqlParserUtil.parse(sql);
  3. Exception:
    net.sf.jsqlparser.parser.ParseException: Encountered " "(" "( "" at line 1, column 77.
    Was expecting one of:
    <S_LONG> ...
    "?" ...

Expected behavior
A clear and concise description of what you expected to happen.

util will work when I replace (5 - 1) * 10 in offset with 40, but it should work use this expression

System

  • Database you are using pgSQL
  • Java Version java 8
  • 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.