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 2021/03/02 03:30:18 UTC

[GitHub] [shardingsphere] 805950337 opened a new issue #9559: 如何配置才能避免shardingjdbc的全局解析,A表不分库分表,但是A表执行语句会被解析,最终导致报错

805950337 opened a new issue #9559:
URL: https://github.com/apache/shardingsphere/issues/9559


   报错信息:
   ![A](https://user-images.githubusercontent.com/47844125/109592489-4d52cb00-7b4a-11eb-9125-2bd9e80d60ba.jpg)
   ,now())
   Rule Type: sharding
   Logic SQL: insert into t_order (USER_ID,CREATE_TIME)values(?,now())
   Actual SQL: ds1 ::: insert into t_order  (USER_ID, CREATE_TIME) VALUES (?, 'now()') ::: [0]
   com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: 'now()' for column 'CREATE_TIME' at row 1
   
   执行语句:insert into t_order (USER_ID,CREATE_TIME)values(#{userId}
   数据库结构:
   DROP TABLE IF EXISTS `t_order`;
   CREATE TABLE `t_order`  (
     `ID` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
     `USER_ID` bigint(0) NULL DEFAULT NULL COMMENT '用户ID',
     `CREATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
     PRIMARY KEY (`ID`) USING BTREE
   )
   
   额外说明:用传参数方式把时间传进来可以插入,当前demo是为了体现其中一个因为shardingjdbc解析未分库分表的数据表的执行语句导致执行报错,项目改造过程中有太多地方用了shardingjdbc不支持的语法或者不支持的函数,可大部分表都不进行分库分表但是都报错,比如有数据迁移用了INSERT INTO SELECT FROM


----------------------------------------------------------------
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



[GitHub] [shardingsphere] yu199195 closed issue #9559: 如何配置才能避免shardingjdbc的全局解析,A表不分库分表,但是A表执行语句会被解析,最终导致报错

Posted by GitBox <gi...@apache.org>.
yu199195 closed issue #9559:
URL: https://github.com/apache/shardingsphere/issues/9559


   


----------------------------------------------------------------
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



[GitHub] [shardingsphere] 805950337 closed issue #9559: 如何配置才能避免shardingjdbc的全局解析,A表不分库分表,但是A表执行语句会被解析,最终导致报错

Posted by GitBox <gi...@apache.org>.
805950337 closed issue #9559:
URL: https://github.com/apache/shardingsphere/issues/9559


   


----------------------------------------------------------------
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



[GitHub] [shardingsphere] yu199195 commented on issue #9559: 如何配置才能避免shardingjdbc的全局解析,A表不分库分表,但是A表执行语句会被解析,最终导致报错

Posted by GitBox <gi...@apache.org>.
yu199195 commented on issue #9559:
URL: https://github.com/apache/shardingsphere/issues/9559#issuecomment-788654764


   pls in english


----------------------------------------------------------------
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