You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/12/02 02:49:42 UTC

[GitHub] [incubator-shardingsphere] lightning-pro commented on issue #3550: Timestamp miss milliseconds

lightning-pro commented on issue #3550: Timestamp miss milliseconds
URL: https://github.com/apache/incubator-shardingsphere/issues/3550#issuecomment-560205038
 
 
   1.I have tested by connnecting to MySQL directly, it work perfect
   2.Yes, my last response is the pure java main test demo,it purely use the DriverManager to get an connection from Connector/J.you can just copy it and run it from any ide you want
   3,yes,there is a bug in sharding-proxy, the bug is not related with any connection pool,it is related to the version checking of mysql server version. 
   4.I think i haved descript the root case is very clear.but let me describe it again in Chinese:|
   
   原因就是mysql-connector-j里的com.mysql.jdbc.PreparedStatement的变量serverSupportsFracSecs在方法
   `protected void detectFractionalSecondsSupport() throws SQLException {
           this.serverSupportsFracSecs = this.connection != null && this.connection.versionMeetsMinimum(5, 6, 4);
       }`
   里设置的值为false。直接连数据库设置的值为true。之所以链接sharding-proxy的值为false,是因为this.connection.versionMeetsMinimum(5, 6, 4);这个条件比较满足不了。应该是sharding-proxy没返回版本号?
   如果要进一步追踪,就是在MysqlIO.java里的doHandshake(String user, String password, String database)方法,第1043行 this.serverVersion = buf.readString("ASCII", getExceptionInterceptor());
   读取到的值为 '5.6.0-Sharding-Proxy 4.0.0-RC2'。我想是sharding-proxy里hard code了版本号???。这里导致读取到的版本号为5.6.0,然而我真实的mysql数据库版本号应该是5.7.25.
   sharding-proxy返回5.6.0的版本号满足不了mysql jdbc driver的5.6.4版本号的最低要求检查,导致时间戳毫秒数丢失。我想这里描述应该非常的清楚了吧?能否安排解决一下?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services