Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: 'now()' for column 'UPDATE_TIME' at row 1
Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: 'now()' for column 'UPDATE_TIME' at row 1
The error may involve defaultParameterMap
The error occurred while setting parameters
SQL: insert into ts_anshitianxia_node_data(ID, PARENT_ID,NODE_ID,TAGS, IMAGE, NAME, ALIAS, UNIT,NUM,TS_NODE_PATH,COMPANY_ID,TABLE_NAME,GOODS_ID,UPDATE_TIME,CREATE_USER,UPDATE_USER,IS_DEL,HASHCODE,PRODUCT_COMP_CODE,SLA_COMP_CODE,COMPANY_CODE) values (?,?,?,?,?,?,?,?,?,?,?,?,?,now(),?,?,0,?,?,?,?)
Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: 'now()' for column 'UPDATE_TIME' at row 1
; Data truncation: Incorrect datetime value: 'now()' for column 'UPDATE_TIME' at row 1; nested exception is com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: 'now()' for column 'UPDATE_TIME' at row 1
Is the now() expression not supported in insert statements?
Can you fill necessary information which template provide?
Template:
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed GitHub issues.
- Read documentation: ShardingSphere Doc.
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?
Which project did you use? Sharding-JDBC or Sharding-Proxy?
Expected behavior
Actual behavior
Reason analyze (If you can)
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Example codes for reproduce this issue (such as a github link).
Which version of ShardingSphere did you use? 4.0.0-RC1
Which project did you use? Sharding-JDBC or Sharding-Proxy? Sharding-JDBC Expected behavior insert or update data only using a shard table strategy , and insert udpate_time column with now expression Actual behavior Is not work Reason analyze (If you can) I use mybatis and MySQL, I think ShardingSphere explain now() expression as a string,and the UPDATE_TIME column type is datetime,but now() expression is work with getting current time when I dont use Sharding-JDBC Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. SQL: insert into ts_anshitianxia_node_data(ID, PARENT_ID,NODE_ID,TAGS, IMAGE, NAME, ALIAS, UNIT,NUM,TS_NODE_PATH,COMPANY_ID,TABLE_NAME,GOODS_ID,UPDATE_TIME,CREATE_USER,UPDATE_USER,IS_DEL,HASHCODE,PRODUCT_COMP_CODE,SLA_COMP_CODE,COMPANY_CODE) values (?,?,?,?,?,?,?,?,?,?,?,?,?,now(),?,?,0,?,?,?,?) Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: 'now()' for column 'UPDATE_TIME' at row 1
Template:
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed GitHub issues.
- Read documentation: ShardingSphere Doc.
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?
Which project did you use? Sharding-JDBC or Sharding-Proxy?
Expected behavior
Actual behavior
Reason analyze (If you can)
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
Example codes for reproduce this issue (such as a github link).
Which version of ShardingSphere did you use? 4.0.0-RC1
Which project did you use? Sharding-JDBC or Sharding-Proxy? Sharding-JDBC Expected behavior insert or update data only using a shard table strategy , and insert udpate_time column with now expression Actual behavior Is not work Reason analyze (If you can) I use mybatis and MySQL, I think ShardingSphere explain now() expression as a string,and the UPDATE_TIME column type is datetime,but now() expression is work with getting current time when I dont use Sharding-JDBC Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. SQL: insert into ts_anshitianxia_node_data(ID, PARENT_ID,NODE_ID,TAGS, IMAGE, NAME, ALIAS, UNIT,NUM,TS_NODE_PATH,COMPANY_ID,TABLE_NAME,GOODS_ID,UPDATE_TIME,CREATE_USER,UPDATE_USER,IS_DEL,HASHCODE,PRODUCT_COMP_CODE,SLA_COMP_CODE,COMPANY_CODE) values (?,?,?,?,?,?,?,?,?,?,?,?,?,now(),?,?,0,?,?,?,?) Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: 'now()' for column 'UPDATE_TIME' at row 1
Duplicate with https://github.com/apache/incubator-shardingsphere/issues/2225 and https://github.com/apache/incubator-shardingsphere/issues/1497
Is this problem fixed?