Caused by: com.alibaba.druid.sql.parser.ParserException: syntax error, expect RPAREN, actual LITERAL_INT pos 885, line 46, column 29, token LITERAL_INT
at com.alibaba.druid.sql.parser.SQLExprParser.accept(SQLExprParser.java:2860)
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:369)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primary(OracleExprParser.java:516)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:157)
at com.alibaba.druid.sql.parser.SQLExprParser.parseSelectItem(SQLExprParser.java:3485)
at com.alibaba.druid.sql.parser.SQLSelectParser.parseSelectList(SQLSelectParser.java:937)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.query(OracleSelectParser.java:316)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.select(OracleSelectParser.java:92)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.parseTableSourcePrimary(OracleSelectParser.java:639)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.parseTableSourceRest(OracleSelectParser.java:910)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.parseTableSource(OracleSelectParser.java:627)
at com.alibaba.druid.sql.parser.SQLSelectParser.parseFrom(SQLSelectParser.java:957)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.query(OracleSelectParser.java:321)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.select(OracleSelectParser.java:92)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.parseTableSourcePrimary(OracleSelectParser.java:639)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.parseTableSource(OracleSelectParser.java:624)
at com.alibaba.druid.sql.parser.SQLSelectParser.parseFrom(SQLSelectParser.java:957)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.query(OracleSelectParser.java:321)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleSelectParser.select(OracleSelectParser.java:92)
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:671)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primary(OracleExprParser.java:516)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:157)
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:353)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primary(OracleExprParser.java:516)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:157)
at com.alibaba.druid.sql.parser.SQLExprParser.exprList(SQLExprParser.java:1476)
at com.alibaba.druid.sql.parser.SQLExprParser.methodRest(SQLExprParser.java:1210)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.methodRest(OracleExprParser.java:554)
at com.alibaba.druid.sql.parser.SQLExprParser.primaryRest(SQLExprParser.java:1049)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primaryRest(OracleExprParser.java:722)
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:885)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primary(OracleExprParser.java:516)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:157)
at com.alibaba.druid.sql.parser.SQLExprParser.exprList(SQLExprParser.java:1470)
at com.alibaba.druid.sql.parser.SQLExprParser.methodRest(SQLExprParser.java:1210)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.methodRest(OracleExprParser.java:554)
at com.alibaba.druid.sql.parser.SQLExprParser.primaryRest(SQLExprParser.java:1049)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primaryRest(OracleExprParser.java:722)
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:885)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primary(OracleExprParser.java:516)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:157)
at com.alibaba.druid.sql.parser.SQLExprParser.exprList(SQLExprParser.java:1476)
at com.alibaba.druid.sql.parser.SQLExprParser.methodRest(SQLExprParser.java:1210)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.methodRest(OracleExprParser.java:554)
at com.alibaba.druid.sql.parser.SQLExprParser.primaryRest(SQLExprParser.java:1049)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primaryRest(OracleExprParser.java:722)
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:885)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primary(OracleExprParser.java:516)
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:157)
at com.alibaba.druid.sql.parser.SQLExprParser.parseUpdateSetItem(SQLExprParser.java:1891)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseUpdateSet(SQLStatementParser.java:2594)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleUpdateParser.parseUpdateStatement(OracleUpdateParser.java:56)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser.parseUpdateStatement(OracleStatementParser.java:2870)
at com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser.parseStatementList(OracleStatementParser.java:207)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:182)
at com.alibaba.druid.wall.WallProvider.checkInternal(WallProvider.java:624)
at com.alibaba.druid.wall.WallProvider.check(WallProvider.java:578)
at com.alibaba.druid.wall.WallFilter.checkInternal(WallFilter.java:793)
... 141 more
Druid过滤器发现使用了sql默认保留的关键字 会报这个异常
在下面找到token后面的关键字对应的符号 然后在mapper中搜索 找到后使用``包裹即可
public enum Token {
FOR("FOR"),
IF("IF"),
INDEX("INDEX"),
PRIMARY("PRIMARY"),
KEY("KEY"),
DEFAULT("DEFAULT"),
CONSTRAINT("CONSTRAINT"),
CHECK("CHECK"),
VIEW("VIEW"),
CREATE("CREATE"),
ALTER("ALTER"),
DROP("DROP"),
TABLE("TABLE"),
UPDATE("UPDATE"),
SET("SET"),
SELECT("SELECT"),
FROM("FROM"),
WHERE("WHERE"),
ORDER("ORDER"),
BY("BY"),
GROUP("GROUP"),
HAVING("HAVING"),
INSERT("INSERT"),
INTO("INTO"),
NULL("NULL"),
NOT("NOT"),
AS("AS"),
DELETE("DELETE"),
DISTINCT("DISTINCT"),
UNIQUE("UNIQUE"),
FOREIGN("FOREIGN"),
REFERENCES("REFERENCES"),
ALL("ALL"),
UNION("UNION"),
INTERSECT("INTERSECT"),
MINUS("MINUS"),
INNER("INNER"),
LEFT("LEFT"),
RIGHT("RIGHT"),
FULL("FULL"),
OUTER("OUTER"),
JOIN("JOIN"),
ON("ON"),
SCHEMA("SCHEMA"),
CAST("CAST"),
COLUMN("COLUMN"),
USE("USE"),
DATABASE("DATABASE"),
AND("AND"),
OR("OR"),
XOR("XOR"),
CASE("CASE"),
WHEN("WHEN"),
THEN("THEN"),
ELSE("ELSE"),
END("END"),
EXISTS("EXISTS"),
IN("IN"),
NEW("NEW"),
ASC("ASC"),
DESC("DESC"),
IS("IS"),
LIKE("LIKE"),
ESCAPE("ESCAPE"),
BETWEEN("BETWEEN"),
VALUES("VALUES"),
INTERVAL("INTERVAL"),
LOCK("LOCK"),
SOME("SOME"),
ANY("ANY"),
TRUNCATE("TRUNCATE"),
// mysql
TRUE("TRUE"),
FALSE("FALSE"),
LIMIT("LIMIT"),
KILL("KILL"),
IDENTIFIED("IDENTIFIED"),
PASSWORD("PASSWORD"),
DUAL("DUAL"),
//postgresql
WINDOW("WINDOW"),
OFFSET("OFFSET"),
ROW("ROW"),
ROWS("ROWS"),
ONLY("ONLY"),
FIRST("FIRST"),
NEXT("NEXT"),
FETCH("FETCH"),
OF("OF"),
SHARE("SHARE"),
NOWAIT("NOWAIT"),
RECURSIVE("RECURSIVE"),
TEMPORARY("TEMPORARY"),
TEMP("TEMP"),
UNLOGGED("UNLOGGED"),
RESTART("RESTART"),
IDENTITY("IDENTITY"),
CONTINUE("CONTINUE"),
CASCADE("CASCADE"),
RESTRICT("RESTRICT"),
USING("USING"),
CURRENT("CURRENT"),
RETURNING("RETURNING"),
COMMENT("COMMENT"),
OVER("OVER"),
// oracle
START("START"),
PRIOR("PRIOR"),
CONNECT("CONNECT"),
WITH("WITH"),
EXTRACT("EXTRACT"),
CURSOR("CURSOR"),
MODEL("MODEL"),
MERGE("MERGE"),
MATCHED("MATCHED"),
ERRORS("ERRORS"),
REJECT("REJECT"),
UNLIMITED("UNLIMITED"),
BEGIN("BEGIN"),
EXCLUSIVE("EXCLUSIVE"),
MODE("MODE"),
WAIT("WAIT"),
ADVISE("ADVISE"),
SESSION("SESSION"),
PROCEDURE("PROCEDURE"),
LOCAL("LOCAL"),
SYSDATE("SYSDATE"),
DECLARE("DECLARE"),
EXCEPTION("EXCEPTION"),
GRANT("GRANT"),
LOOP("LOOP"),
GOTO("GOTO"),
COMMIT("COMMIT"),
SAVEPOINT("SAVEPOINT"),
CROSS("CROSS"),
// transact-sql
TOP("TOP"),
// hive
EOF,
ERROR,
IDENTIFIER,
HINT,
VARIANT,
LITERAL_INT,
LITERAL_FLOAT,
LITERAL_HEX,
LITERAL_CHARS,
LITERAL_NCHARS,
LITERAL_ALIAS,
LINE_COMMENT,
MULTI_LINE_COMMENT,
// Oracle
BINARY_FLOAT,
BINARY_DOUBLE,
LPAREN("("),
RPAREN(")"),
LBRACE("{"),
RBRACE("}"),
LBRACKET("["),
RBRACKET("]"),
SEMI(";"),
COMMA(","),
DOT("."),
DOTDOT(".."),
DOTDOTDOT("..,"),
EQ("="),
GT(">"),
LT("<"),
BANG("!"),
TILDE("~"),
QUES("?"),
COLON(":"),
COLONEQ(":="),
EQEQ("=="),
LTEQ("<="),
LTEQGT("<=>"),
LTGT("<>"),
GTEQ(">="),
BANGEQ("!="),
BANGGT("!>"),
BANGLT("!<"),
AMPAMP("&&"),
BARBAR("||"),
PLUS("+"),
SUB("-"),
STAR("*"),
SLASH("/"),
AMP("&"),
BAR("|"),
CARET("^"),
PERCENT("%"),
LTLT("<<"),
GTGT(">>"),
MONKEYS_AT("@");
public final String name;
Token(){
this(null);
}
Token(String name){
this.name = name;
}
}