shadowwinds opened a new issue, #6231: URL: https://github.com/apache/incubator-seata/issues/6231
<!-- Please do not use this issue template to report security vulnerabilities but refer to our [security policy](https://github.com/seata/seata/security/policy). --> - [x] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate. ### Ⅰ. Issue Description When using the seata AT mode, if the column type of a MySQL table is set to json, branchRollback failed. ### Ⅱ. Describe what happened [info] [ i.s.r.d.DataSourceManager: 43] - branchRollback failed. branchType:[AT], xid:[10.xx.xx.xx:30091:5386753064359557942], branchId:[5386753064359557948], resourceId:[jdbc:mysql://10.xx.xx.xx:13306/db_wms0], applicationData:[null]. reason:[Branch session rollback failed and try again later xid = 10.xx.xx.xx:30091:5386753064359557942 branchId = 5386753064359557948 Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.] ### Ⅲ. Describe what you expected to happen The undo log should be able to roll back normally. ### Ⅳ. How to reproduce it (as minimally and precisely as possible) table schema: create table t_pick_plan_detail ( ID bigint not null comment '主键ID' primary key, DATA_ROUTE varchar(20) collate utf8mb4_general_ci not null comment '数据路由', BOC_DATA_ROUTE varchar(20) collate utf8mb4_general_ci null comment '关联波次数据路由', PICK_PLAN_ID bigint null comment 'pick_plan id', BOC_NUMBER varchar(30) collate utf8mb4_general_ci not null comment '波次号', ENTITY_WAREHOUSE_CODE varchar(30) collate utf8mb4_general_ci not null comment '仓库编码', GROUP_NUMBER varchar(30) collate utf8mb4_general_ci null comment '分组号', ORDER_NUMBER text not null comment '发货单号', SYSTEM_PRODUCT_CODE varchar(32) collate utf8mb4_general_ci not null comment '系统产品编码', LOCATION_CODE varchar(30) collate utf8mb4_general_ci null comment '分配推荐库位编码', HU_CODE varchar(30) collate utf8mb4_general_ci null comment '推荐托盘码/分配时占用托盘码', HU_CODE_JSON json null comment '推荐托盘库存明细JSON', ACTUAL_HU_CODE varchar(30) collate utf8mb4_general_ci null comment '源托盘码/实际拣货托盘码', ACTUAL_HU_CODE_JSON json null comment '源托盘明细JSON', DEST_HU_CODE varchar(30) collate utf8mb4_general_ci null comment '目的托盘码', DEST_HU_CODE_JSON json null comment '目的托盘明细JSON', DEST_LOCATION_CODE varchar(30) null comment '目的库位', PICK_QTY decimal(18, 5) null comment '应拣数量', ACTUAL_PICK_QTY decimal(18, 5) default 0.00000 null comment '实际已拣货数量', IMEI1_COLLECT_FLAG char(4) collate utf8mb4_general_ci null comment 'IMEI1是否采集', CONTROL_FLAG varchar(10) collate utf8mb4_general_ci null comment '强管控', CUSTOMER_CODE varchar(50) collate utf8mb4_general_ci null comment '客户编码', ATTRIBUTE varchar(10) collate utf8mb4_general_ci null comment '产品属性', MERGE_KEY varchar(100) collate utf8mb4_general_ci null comment '合品key', STATUS varchar(10) collate utf8mb4_general_ci not null comment '状态【 10:分配失败,20:未拣货,30:部分拣货,40:拣货完成】', IS_DELETED smallint not null comment '是否删除', TASK_USER bigint null comment '任务人ID', TASK_USER_NAME varchar(100) collate utf8mb4_general_ci null comment '任务人姓名', CREATE_TIME datetime null comment '创建时间', LAST_UPDATE_USER bigint null comment '更新人ID', LAST_UPDATE_USER_NAME varchar(100) collate utf8mb4_general_ci null comment '更新人姓名', LAST_UPDATE_TIME datetime null comment '更新时间' ) comment '拣货计划表详情表' charset = utf8mb4; PreparedStatement: com.mysql.cj.jdbc.ServerPreparedStatement[4]: UPDATE t_pick_plan_detail SET DATA_ROUTE = 2023-12-28, PICK_PLAN_ID = 1740317210222018561, BOC_NUMBER = BC2023122800011, ENTITY_WAREHOUSE_CODE = R31, GROUP_NUMBER = JX202401020000001, ORDER_NUMBER = OD20231103000007, SYSTEM_PRODUCT_CODE = YKJ00001920, LOCATION_CODE = R31C2131, HU_CODE = TP1700472806368, HU_CODE_JSON = {"qty": 1.0, "huId": "TP1700472806368", "rowId": null, "snCOS": null, "areaId": "C2", "oldQty": null, "snList": null, "whCode": "R31", "ownerId": "9160001", "areaType": "40", "fromHuId": null, "poNumber": null, "soNumber": null, "bocNumber": "BC2023122800011", "cancelQty": null, "dataRoute": null, "extValues": null, "lotNumber": null, "expiryDate": null, "fromAreaId": null, "hasSownQty": null, "locationId": "R31C2131", "groupNumber": null, "availableQty": null, "customerCode": "QCZNJX", "fromAreaType": null, "itemPropCode": "10", "poLineNumber": null, "soLineNumber": null, "prodLotNumber": null, "destHuCodeJson": null, "e xpirationDate": null, "fromLocationId": null, "productionDate": null, "isPalletPicking": null, "bocProductIdList": null, "pickPlanDetailId": null, "isPickingRecGoods": null, "systemProductCode": "YKJ00001920", "inboundOrderNumber": null, "transportProductId": null, "outboundOrderNumber": "OD20231103000007", "strategySequentialDTO": null}, ACTUAL_HU_CODE = NULL, ACTUAL_HU_CODE_JSON = NULL, DEST_HU_CODE = NULL, DEST_LOCATION_CODE = NULL, PICK_QTY = 1.00000, ACTUAL_PICK_QTY = 0.00000, IMEI1_COLLECT_FLAG = 10, CONTROL_FLAG = 20, ATTRIBUTE = 10, MERGE_KEY = YKJ00001920_10_10, STATUS = 30, TASK_USER = 41809863804477877, TASK_USER_NAME = xx, CREATE_TIME = '2024-01-02 17:04:11', LAST_UPDATE_USER = 41809863804477877, LAST_UPDATE_USER_NAME = hx, LAST_UPDATE_TIME = '2024-01-02 17:07:31' WHERE ID = 1742109520919334914 UPDATE t_pick_plan_detail SET DATA_ROUTE = ?, PICK_PLAN_ID = ?, BOC_NUMBER = ?, ENTITY_WAREHOUSE_CODE = ?, GROUP_NUMBER = ?, ORDER_NUMBER = ?, SYSTEM_PRODUCT_CODE = ?, LOCATION_CODE = ?, HU_CODE = ?, HU_CODE_JSON = ?, ACTUAL_HU_CODE = ?, ACTUAL_HU_CODE_JSON = ?, DEST_HU_CODE = ?, DEST_LOCATION_CODE = ?, PICK_QTY = ?, ACTUAL_PICK_QTY = ?, IMEI1_COLLECT_FLAG = ?, CONTROL_FLAG = ?, ATTRIBUTE = ?, MERGE_KEY = ?, STATUS = ?, TASK_USER = ?, TASK_USER_NAME = ?, CREATE_TIME = ?, LAST_UPDATE_USER = ?, LAST_UPDATE_USER_NAME = ?, LAST_UPDATE_TIME = ? WHERE ID = ? com.mysql.cj.result.Field@768110e7[dbName=null,tableName=null,originalTableName=null,columnName=?,originalColumnName=null,mysqlType=245(FIELD_TYPE_JSON),sqlType=-1,flags= BINARY, charsetIndex=46, charsetName=UTF-8]  ServerPreparedQueryBindValue:  com.mysql.cj.result.Field@4e7d8f6f[dbName=null,tableName=null,originalTableName=null,columnName=?,originalColumnName=null,mysqlType=245(FIELD_TYPE_JSON),sqlType=-1,flags= BINARY, charsetIndex=46, charsetName=UTF-8]  ### Ⅴ. Anything else we need to know? Works fine under mysql-connector-java:8.0.28 version. ### Ⅵ. Environment: - JDK version(e.g. `java -version`): FROM eclipse-temurin:8-jdk openjdk version "1.8.0_312" OpenJDK Runtime Environment (Temurin)(build 1.8.0_312-b07) OpenJDK 64-Bit Server VM (Temurin)(build 25.312-b07, mixed mode) - Seata client/server version: docker.io/seataio/seata-server:1.6.1 seata-spring-boot-starter:1.6.1 - Database version: mysql 8.0.22 - OS(e.g. `uname -a`): 3.10.0-1062.el7.x86_64 - Others: mysql-connector-j:8.0.33 -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
