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

Parser error using PostgreSQL ALL operator #1140

Closed
ricardocorrent opened this issue Mar 25, 2021 · 2 comments
Closed

Parser error using PostgreSQL ALL operator #1140

ricardocorrent opened this issue Mar 25, 2021 · 2 comments

Comments

@ricardocorrent
Copy link

Describe the bug
Attempting to parse SQL Select containing PostgreSQL all operator with (subquery)

To Reproduce
Steps to reproduce the behavior:

  1. Example SQL
    SELECT * FROM table t0 WHERE t0.id != all(?::uuid[]);
  2. Parsing this SQL using JSqlParser with this statements
    Statement statement = CCJSqlParserUtil.parse(sql);
  3. Exception
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "!=" <OP_NOTEQUALSBANG>
    at line 1, column 465.

Was expecting one of:

    "&"
    "&&"
    "::"
    ";"
    "<<"
    ">>"
    "AND"
    "COLLATE"
    "CONNECT"
    "EXCEPT"
    "FOR"
    "GROUP"
    "HAVING"
    "INTERSECT"
    "MINUS"
    "OR"
    "ORDER"
    "START"
    "UNION"
    "["
    "^"
    "|"
    <EOF>

	at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:26538) ~[jsqlparser-4.0.jar:?]
	at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:26377) ~[jsqlparser-4.0.jar:?]
	at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:91) ~[jsqlparser-4.0.jar:?]
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:163) ~[jsqlparser-4.0.jar:?]

Expected behavior
Parsing of sql

System

  • Database you are using: Postgres 12.5
  • Java Version 1.8
  • JSqlParser version 4
@wumpz
Copy link
Member

wumpz commented May 3, 2021

JSqlParser should accept this all as a function name. I think this is a keyword collision. I will look into it.

@wumpz
Copy link
Member

wumpz commented Jun 30, 2021

Sorry. It took a while.

@wumpz wumpz closed this as completed in 1a9173f Jun 30, 2021
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