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/07/24 01:26:46 UTC
[GitHub] [incubator-shardingsphere] Belief-WangWei commented on issue #2745:
Error updating database. Cause:
com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation:
Incorrect datetime value: 'now()' for column 'UPDATE_TIME' at row 1
Belief-WangWei commented on issue #2745: Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: 'now()' for column 'UPDATE_TIME' at row 1
URL: https://github.com/apache/incubator-shardingsphere/issues/2745#issuecomment-514442229
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
----------------------------------------------------------------
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