Closed
Description
Describe the bug
LIMIT
can also be values such as SELECT ...
, '1'
, etc
To Reproduce
Steps to reproduce the behavior:
- Example SQL:
# SELECT * FROM tmp3 LIMIT (SELECT 2);
order
-------
1
2
(2 rows)
# SELECT * FROM tmp3 LIMIT '2';
order
-------
1
2
(2 rows)
- 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