apache / apache/incubator-seata
AT模式下使用mysql的YEAR类型,在二阶段执行回滚更新数据库时出错
- Dominant language
- Java
- Stars
- 26k
- Forks
- 8.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 4
Description
- [ ] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.
### Ⅰ. Issue Description
针对issue#4402 对AT模式下的mysql type做了一轮测试 https://github.com/seata/seata/pull/4402,发现问题。
1)构造前置镜像时,对于YEAR类型,jdbc会将其自动转为DATE类型;在二阶段回滚时按照date类型更新数据时会报data truncated错误。应该是jdbc的bug。参考:https://github.com/jOOQ/jOOQ/issues/9738;https://bugs.mysql.com/bug.php?id=95045
### Ⅱ. Describe what happened

### Ⅲ. Describe what you expected to happen
### Ⅳ. How to reproduce it (as minimally and precisely as possible)
在Mysql5及Mysql8下都可以复现该问题,可以使用https://github.com/seata/seata/pull/4402中的测试用例进行测试
### Ⅴ. Anything else we need to know?
### Ⅵ. Environment:
- JDK version :jdk8
- Seata version: 1.4.2
- OS :windows
- Others:
-mysql: 5.7.24或8.0.12
Contributor guide
Research direction
Start with the test cases from PR #4402 and reproduce the rollback failure on MySQL 5.7 or 8.0 in AT mode. Trace how YEAR values are read into the before image and then written during second-phase rollback; done means rollback completes without a data-truncated error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, mysql
- Domain
- databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100