You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSqlParser doesn't support convert function used as converting a value to a specified character set #1257
Describe the bug
ParseException occurs when parse SQL
To Reproduce
Steps to reproduce the behavior:
Example SQL
SELECT id,name,version,identity,type,desc,enable,content FROM tbl_template
WHERE (name like ?) ORDER BY convert(name using GBK) ASC
2. Parsing this SQL using JSqlParser with this statements
CCJSqlParserUtil.parse(String.class)
3. Exception
Exception in thread "main" net.sf.jsqlparser.JSQLParserException: Encountered unexpected token: "(" "("
at line 3, column 38.
Was expecting one of:
"&"
"&&"
","
"::"
";"
"<<"
">>"
"AND"
"ASC"
"AT"
"COLLATE"
"DESC"
"FOR"
"NULLS"
"OR"
"ORDER"
"XOR"
"["
"^"
"|"
<EOF>
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:190)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:63)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:38)
at com.bes.enterprise.infra.amdb.open.cmd.SqlTest.main(SqlTest.java:12)
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "("
at line 3, column 38.
Was expecting one of:
"&"
"&&"
","
"::"
";"
"<<"
">>"
"AND"
"ASC"
"AT"
"COLLATE"
"DESC"
"FOR"
"NULLS"
"OR"
"ORDER"
"XOR"
"["
"^"
"|"
<EOF>
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:26917)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:26753)
at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:93)
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:188)
... 3 more
Expected behavior
Return instance of net.sf.jsqlparser.statement.select.Select
changed the title [-]net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "("[/-][+]JSqlParser doesn't support converting a value to a specified character set[/+]on Jul 8, 2021
changed the title [-]JSqlParser doesn't support converting a value to a specified character set[/-][+]JSqlParser doesn't support convert function used as converting a value to a specified character set[/+]on Jul 8, 2021
Activity
manticore-projects commentedon Jul 8, 2021
MySQL CONVERT() character sets is not supported. https://www.w3schools.com/mysql/func_mysql_convert.asp
Please change the Caption of this issues to point on the correct problem.
[-]net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "(" "("[/-][+]JSqlParser doesn't support converting a value to a specified character set[/+][-]JSqlParser doesn't support converting a value to a specified character set[/-][+]JSqlParser doesn't support convert function used as converting a value to a specified character set[/+]csxcsx00 commentedon Jul 9, 2021
Thanks for your answer, caption has been changed.
Are there any plans to fix this problem in the next version?
manticore-projects commentedon Jul 9, 2021
I work though the open issue from time to time and try to add the most useful statements with a focus on wide application and SQL standard compliance.
PRs are alsways most welcome and you best chance for exotic features like the MySQL specific Convert() function.