使用Doris 2.1.7 执行SQL报错,java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException

Viewed 93

Doris:2.1.7
SQL:SHOW VARIABLES like '%max_allowed_packet%'
MySQL驱动版本:8.0.25 jdbc参数中有useServerPrepStmts=true
报错信息:

SQL: SHOW VARIABLES like '%max_allowed_packet%'
Cause: java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException
; java.lang.ArrayIndexOutOfBoundsException; nested exception is java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException

com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:440)
com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)
com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)

当去掉useServerPrepStmts=true参数时正常。
使用doris 2.1.5时加上useServerPrepStmts=true也是正常的。
请帮忙看下这个问题,谢谢!

2 Answers

推荐使用 MySQL Connector/J 8.0.31 及以上版本的驱动试试。

感谢回答!抱歉,再补充些信息。一开始项目中使用的8.0.33的MySQL驱动,测试环境doris从2.1.5升级到了2.1.7后,也是报类似的信息。
The error occurred while setting parameters
SQL: DESCRIBE DATA_xxxxx
Cause: java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException
; java.lang.ArrayIndexOutOfBoundsException; nested exception is java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:110) ~[spring-jdbc-5.2.12.RELEASE.jar!/:5.2.12.RELEASE]

Caused by: java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:130) ~[mysql-connector-j-8.0.33.jar!/:8.0.33]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:98) ~[mysql-connector-j-8.0.33.jar!/:8.0.33]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:90) ~[mysql-connector-j-8.0.33.jar!/:8.0.33]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:64) ~[mysql-connector-j-8.0.33.jar!/:8.0.33]
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:74) ~[mysql-connector-j-8.0.33.jar!/:8.0.33]
at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:362) ~[mysql-connector-j-8.0.33.jar!/:8.0.33]
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:354) ~[mysql-connector-j-8.0.33.jar!/:8.0.33]

2.1.5版本的Doris集群表现正常。
目前这个情况会block Doris生产集群的升级。