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
Hello, when I parse a mysql which contains "on duplicate key", jsqlparser throw a exception.
There is my code:
String sql = "INSERT INTO TempPropInt0 (UserId, Key, Value) VALUES (51311, 'T_211', 18) ON DUPLICATE KEY UPDATE Value = 18;";
Insert insert = (Insert)CCJSqlParserUtil.parse(sql);
StringBuilder builder = new StringBuilder();
ExpressionDeParser eDeparser = new ExpressionDeParser();
SelectDeParser sDeparser = new SelectDeParser();
InsertDeParser iDeParser = new InsertDeParser();
eDeparser.setBuffer(builder);
eDeparser.setSelectVisitor(sDeparser);
sDeparser.setBuffer(builder);
sDeparser.setExpressionVisitor(eDeparser);
iDeParser.setBuffer(builder);
iDeParser.setExpressionVisitor(eDeparser);
iDeParser.setSelectVisitor(sDeparser);
iDeParser.deParse(insert);
System.out.println(builder.toString());
There is the exception:
net.sf.jsqlparser.JSQLParserException
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:51)
at com.baitian.realtime.dc.parse.custom.CustomParserTest.test4(CustomParserTest.java:160)
...
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered " "ON" "ON "" at line 1, column 81.
Was expecting one of:
"RETURNING" ...
jsqlparser version is 0.9.4
The text was updated successfully, but these errors were encountered:
Hello, when I parse a mysql which contains "on duplicate key", jsqlparser throw a exception.
There is my code:
String sql = "INSERT INTO
TempPropInt0
(UserId,Key
,Value
) VALUES (51311, 'T_211', 18) ON DUPLICATE KEY UPDATEValue
= 18;";There is the exception:
net.sf.jsqlparser.JSQLParserException
at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:51)
at com.baitian.realtime.dc.parse.custom.CustomParserTest.test4(CustomParserTest.java:160)
...
Caused by: net.sf.jsqlparser.parser.ParseException: Encountered " "ON" "ON "" at line 1, column 81.
Was expecting one of:
"RETURNING" ...
jsqlparser version is 0.9.4
The text was updated successfully, but these errors were encountered: