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

[mysql] can't parse convert function in order by clause #688

Closed
HiwayChe opened this issue Oct 8, 2018 · 1 comment · Fixed by #1778
Closed

[mysql] can't parse convert function in order by clause #688

HiwayChe opened this issue Oct 8, 2018 · 1 comment · Fixed by #1778

Comments

@HiwayChe
Copy link

HiwayChe commented Oct 8, 2018

Actual Behavior

 String sql2 = "select * from a order by convert(a.name using gbk) desc";
CCJSqlParserUtil.parse(sql2);

above code throws an exception:

Caused by:
net.sf.jsqlparser.parser.ParseException: Encountered " "(" "( "" at line 1, column 33.
Was expecting one of:
    <EOF> 
    "ASC" ...
    "DESC" ...
    "FOR" ...
    "UNION" ...
    "ORDER" ...
    "INTERSECT" ...
    "EXCEPT" ...
    "MINUS" ...
    "NULLS" ...
    ";" ...
    "," ...
    "|" ...
    "&" ...
    "^" ...
    "::" ...

    at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:16395)

Expected Behavior

I hope jsqlparse can support order by convert(column using charset) desc/asc

Steps to Reproduce the Problem

  1. use jsqlparse, version:1.0, (jsqlparse-1.3 has same issue)
  2. execute above code in IDE(java)
  3. throws exception

Specifications

  • Version:1.0
  • Platform:Windows, jdk8
  • Subsystem:
@wumpz
Copy link
Member

wumpz commented Oct 8, 2018

JSqlParser does not (yet) support functions with nonstandard parameters, like f(a in b) or yours f(a using b).

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

Successfully merging a pull request may close this issue.

2 participants