★ wanayoo — archive 1999 https://github.com/JSQLParser/JSqlParser/issues/933Nouvelle recherche | Portail wanayoo
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

LIMIT value can be an expression #933

Open
SerialVelocity opened this issue Jan 23, 2020 · 0 comments
Open

LIMIT value can be an expression #933

SerialVelocity opened this issue Jan 23, 2020 · 0 comments

Comments

@SerialVelocity
Copy link

@SerialVelocity SerialVelocity commented Jan 23, 2020

Describe the bug
LIMIT can also be values such as SELECT ..., '1', etc

To Reproduce
Steps to reproduce the behavior:

  1. Example SQL:
# SELECT * FROM tmp3 LIMIT (SELECT 2);
 order
-------
     1
     2
(2 rows)
# SELECT * FROM tmp3 LIMIT '2';
 order
-------
     1
     2
(2 rows)
  1. JSQLParser exceptions:
    SELECT * FROM tmp3 LIMIT (SELECT 2):
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "("
    at line 1, column 26.

SELECT * FROM tmp3 LIMIT '2':

Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "\'2\'" <S_CHAR_LITERAL>
    at line 1, column 26.

Expected behavior
For LIMIT to be parsed as an expression

System

  • Database you are using: Postgres
  • Java Version: 11
  • 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.