Simbafa opened a new issue #3801: "useServerPrepStmts=true" doesn't work
URL: https://github.com/apache/incubator-shardingsphere/issues/3801
 
 
   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/incubator-shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more 
details. 
   If no response **more than 7 days** and we cannot reproduce it on current 
information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   4.0.0-RC1
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-Proxy
   ### Expected behavior
   can get datetime/timestamp correctly
   ### Actual behavior
   
![image](https://user-images.githubusercontent.com/37646009/71435819-a1337a00-2725-11ea-8866-d139eb618036.png)
   
    `[DEBUG] 14:33:14.155 [ShardingSphere-Command-0] 
o.a.s.s.f.m.c.MySQLCommandExecutorFactory - Execute packet type: 
COM_STMT_PREPARE, value: 
MySQLComStmtPreparePacket(sql=/*{"Cookie":"cookie"}*/select * from dbrest)
   [ERROR] 14:33:14.159 [ShardingSphere-Command-0] 
o.a.s.s.f.c.CommandExecutorTask - Exception occur: 
   java.lang.ClassCastException: 
org.apache.shardingsphere.shardingproxy.backend.schema.TransparentSchema cannot 
be cast to org.apache.shardingsphere.shardingproxy.backend.schema.ShardingSchema
   `
   
   After fixing the issue, following error occures at client.
   Caused by: java.lang.ArrayIndexOutOfBoundsException: 8       at 
com.mysql.jdbc.ResultSetRow.getNativeTimestamp(ResultSetRow.java:614)
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   1. configuration:
   schemaName: test
   dataSources:
     ds_0:
       url: jdbc:mysql://192.168.1.46:3306/test
       username: root
       password: test
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
   
   2. JDBC url:
   
jdbc:mysql://192.168.1.46:3307/test?user=root&password=root&useServerPrepStmts=true&zeroDateTimeBehavior=convertToNull
   ** useServerPrepStmts=true** should be used.
   3. data 
   CREATE TABLE IF NOT EXISTS `dbrest` (
     `fid` varchar(50) DEFAULT NULL,
     `fint` int(11) DEFAULT NULL,
     `ffloat` float DEFAULT NULL,
     `ftext` text,
     `fdate` date DEFAULT NULL,
     `fdatetime` datetime DEFAULT NULL,
     `ftimestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
     `ftime` time DEFAULT NULL,
     `fblob` varchar(50) DEFAULT NULL
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
   
   INSERT INTO `dbrest` (`fid`, `fint`, `ffloat`, `ftext`, `fdate`, 
`fdatetime`, `ftimestamp`, `ftime`, `fblob`) VALUES
        ('1', 1, 1, '1', NULL, NULL, '2019-12-25 14:20:43', NULL, NULL);
   
   **If there are no "null" value, it can return correctly.**
   
   ### Example codes for reproduce this issue (such as a github link).
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to