incubator-seata
incubator-seata copied to clipboard
Add AT transaction mode tests to support database data types (MySQL n…
…umeric types)
- [ ] I have registered the PR changes.
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fixes #4363
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
测了numeric type,麻烦review一下,思路没问题的话,我接着测其它类型
这个测试先按照数据库的粒度分,在此之内再区分数据类型的方式会不会更清晰一点,比如MySQL作为一个Test文件,其中再具体到支持的类型测试,目前所有的数据库都聚在一起感觉有点乱,毕竟不同数据库的数据类型支持差异性还是挺大的
这个测试先按照数据库的粒度分,在此之内再区分数据类型的方式会不会更清晰一点,比如MySQL作为一个Test文件,其中再具体到支持的类型测试,目前所有的数据库都聚在一起感觉有点乱,毕竟不同数据库的数据类型支持差异性还是挺大的
好的,我拆分一下
…umeric types)
- [ ] I have registered the PR changes.
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fixes #4363
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
这个测试先按照数据库的粒度分,在此之内再区分数据类型的方式会不会更清晰一点,比如MySQL作为一个Test文件,其中再具体到支持的类型测试,目前所有的数据库都聚在一起感觉有点乱,毕竟不同数据库的数据类型支持差异性还是挺大的
好的,我拆分一下 测试完成后,发现以下问题: 1)构造前置镜像时,对于YEAR类型,jdbc会将其自动转为DATE类型;在二阶段回滚时按照date类型更新数据时会报date truncated错误。应该是jdbc的bug
参考:https://github.com/JOOQ/JOOQ/issues/9738; https://bugs.mysql.com/bug.php?id=95045 2)fastJson序列化时,对于DATE相关类型全部序列化成了字符串,导致镜像对比出错;目前convertType中未对DATE和TIME类型做特殊处理
3)对于BIT(M)类型,数据可以有多位的情况,由于BIT(M)类型在查出来时转为了byte[]数组类型,在undo回滚使用ps.setObject(undoIndex,value,type)时,还是按照byte类型强转为Number类型导致出错。可以在ps.setObject时不强制指定类型,通过自动类型判断解决。 参考:https://github.com/pgjdbc/pgjdbc/issues/908
…umeric types)
- [ ] I have registered the PR changes.
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fixes #4363
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
这个测试先按照数据库的粒度分,在此之内再区分数据类型的方式会不会更清晰一点,比如MySQL作为一个Test文件,其中再具体到支持的类型测试,目前所有的数据库都聚在一起感觉有点乱,毕竟不同数据库的数据类型支持差异性还是挺大的
好的,我拆分一下 测试完成后,发现以下问题: 1)构造前置镜像时,对于YEAR类型,jdbc会将其自动转为DATE类型;在二阶段回滚时按照date类型更新数据时会报date truncated错误。应该是jdbc的bug
参考:jOOQ/jOOQ#9738; https://bugs.mysql.com/bug.php?id=95045 2)fastJson序列化时,对于DATE相关类型全部序列化成了字符串,导致镜像对比出错;目前convertType中未对DATE和TIME类型做特殊处理
3)对于BIT(M)类型,数据可以有多位的情况,由于BIT(M)类型在查出来时转为了byte[]数组类型,在undo回滚使用ps.setObject(undoIndex,value,type)时,还是按照byte类型强转为Number类型导致出错。可以在ps.setObject时不强制指定类型,通过自动类型判断解决。 参考:pgjdbc/pgjdbc#908
相关的问题可以提成issues,有兴趣的话你也可以另外提PR修复
…umeric types)
- [ ] I have registered the PR changes.
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fixes #4363
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
这个测试先按照数据库的粒度分,在此之内再区分数据类型的方式会不会更清晰一点,比如MySQL作为一个Test文件,其中再具体到支持的类型测试,目前所有的数据库都聚在一起感觉有点乱,毕竟不同数据库的数据类型支持差异性还是挺大的
好的,我拆分一下 测试完成后,发现以下问题: 1)构造前置镜像时,对于YEAR类型,jdbc会将其自动转为DATE类型;在二阶段回滚时按照date类型更新数据时会报date truncated错误。应该是jdbc的bug
参考:jOOQ/jOOQ#9738; https://bugs.mysql.com/bug.php?id=95045 2)fastJson序列化时,对于DATE相关类型全部序列化成了字符串,导致镜像对比出错;目前convertType中未对DATE和TIME类型做特殊处理
3)对于BIT(M)类型,数据可以有多位的情况,由于BIT(M)类型在查出来时转为了byte[]数组类型,在undo回滚使用ps.setObject(undoIndex,value,type)时,还是按照byte类型强转为Number类型导致出错。可以在ps.setObject时不强制指定类型,通过自动类型判断解决。 参考:pgjdbc/pgjdbc#908
相关的问题可以提成issues,有兴趣的话你也可以另外提PR修复
好的,那我分开提3个issue吗?另外测试代码已提交,还麻烦review一下
个人数据库的敏感信息记得去除一下
…umeric types)
- [ ] I have registered the PR changes.
Ⅰ. Describe what this PR did
Ⅱ. Does this pull request fix one issue?
fixes #4363
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews
这个测试先按照数据库的粒度分,在此之内再区分数据类型的方式会不会更清晰一点,比如MySQL作为一个Test文件,其中再具体到支持的类型测试,目前所有的数据库都聚在一起感觉有点乱,毕竟不同数据库的数据类型支持差异性还是挺大的
好的,我拆分一下 测试完成后,发现以下问题: 1)构造前置镜像时,对于YEAR类型,jdbc会将其自动转为DATE类型;在二阶段回滚时按照date类型更新数据时会报date truncated错误。应该是jdbc的bug
参考:jOOQ/jOOQ#9738; https://bugs.mysql.com/bug.php?id=95045 2)fastJson序列化时,对于DATE相关类型全部序列化成了字符串,导致镜像对比出错;目前convertType中未对DATE和TIME类型做特殊处理
3)对于BIT(M)类型,数据可以有多位的情况,由于BIT(M)类型在查出来时转为了byte[]数组类型,在undo回滚使用ps.setObject(undoIndex,value,type)时,还是按照byte类型强转为Number类型导致出错。可以在ps.setObject时不强制指定类型,通过自动类型判断解决。 参考:pgjdbc/pgjdbc#908
相关的问题可以提成issues,有兴趣的话你也可以另外提PR修复
好的,那我分开提3个issue吗?另外测试代码已提交,还麻烦review一下
可以
这里的要考虑一下update之后,还要执行一次数据库delete进行数据清理
这里的要考虑一下update之后,还要执行一次数据库delete进行数据清理
好的
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
4 out of 5 committers have signed the CLA.
:white_check_mark: renliangyu857
:white_check_mark: funky-eyes
:white_check_mark: wangliang181230
:white_check_mark: caohdgege
:x: unknown
unknown seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 5 committers have signed the CLA.
:x: unknown
:x: a364176773
:x: renliangyu857
:x: wangliang181230
:x: caohdgege
unknown seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.