When I use Server Prepared Statements, that is set useServerPrepStmts=true, if the select statement's field list contains the Enum type, the client will report an error.
I expect the TiDB to return the correct query result.
What did you see instead?
The client reported the following error message:
Exception in thread "main" java.sql.SQLException: Unknown type '247' in column '1' of '2' in binary-encoded result set.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:115)
at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1299)
at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:701)
at com.mysql.cj.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1923)
at com.apusic.test.CursorExample.main(CursorExample.java:27)
What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
----------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.0-alpha-75-g41f8ac195
Git Commit Hash: 41f8ac19523386d0eb6ca871397f49f834958169
Git Branch: master
UTC Build Time: 2018-06-26 07:08:04
GoVersion: go version go1.10.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e |
+------------------------------------------------------------------------------------
When I use Server Prepared Statements, that is set
useServerPrepStmts=true
, if the select statement's field list contains theEnum
type, the client will report an error.Java Code snippet:
MySQL Connector/J version:
I expect the TiDB to return the correct query result.
The client reported the following error message:
tidb-server -V
or runselect tidb_version();
on TiDB)?----------------------------------------------------------------------------------------------------------------+ | Release Version: v2.1.0-alpha-75-g41f8ac195 Git Commit Hash: 41f8ac19523386d0eb6ca871397f49f834958169 Git Branch: master UTC Build Time: 2018-06-26 07:08:04 GoVersion: go version go1.10.1 darwin/amd64 Race Enabled: false TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e | +------------------------------------------------------------------------------------