Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: fix fastjson serialization of time data types #4505

Merged
merged 1 commit into from
Apr 21, 2022
Merged

bugfix: fix fastjson serialization of time data types #4505

merged 1 commit into from
Apr 21, 2022

Conversation

xjlgod
Copy link
Contributor

@xjlgod xjlgod commented Mar 27, 2022

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

Detail is in issue 4443

Ⅱ. Does this pull request fix one issue?

fixes #4443

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly slievrly changed the title Fix fastjson for date and time type bugfix: fix fastjson serialization of time data types Apr 3, 2022
@slievrly
Copy link
Member

slievrly commented Apr 3, 2022

@slievrly slievrly added the first-time contributor first-time contributor label Apr 3, 2022
@xjlgod
Copy link
Contributor Author

xjlgod commented Apr 3, 2022

@slievrly
Copy link
Member

slievrly commented Apr 4, 2022

@slievrly
Copy link
Member

slievrly commented Apr 4, 2022

@xjlgod thanks for your contribution.

@xjlgod
Copy link
Contributor Author

xjlgod commented Apr 4, 2022

#4505 (comment)
I have done it.

}
if (f1Type == Types.TIME && f1.getValue().getClass().equals(String.class)) {
f1.setValue(Time.valueOf(f1.getValue().toString()));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date处理了类似 2022-04-08 12:23:33 的情况,time不需要处理吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time本身就是12:23:33这种类型,不需要做处理。主要是fastJson序列化出来的字符串需要转成time类型来比较。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

数据库是datetime类型的如何处理?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#4505 (comment)
解决的issue里没涉及对datetime类型错误的描述,datetime是相当于TIMESTAMP进行处理的

@codecov-commenter
Copy link

Codecov Report

Merging #4505 (8ac278f) into develop (53d65bf) will increase coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4505      +/-   ##
=============================================
+ Coverage      49.35%   49.39%   +0.03%     
- Complexity      4073     4075       +2     
=============================================
  Files            731      731              
  Lines          25465    25475      +10     
  Branches        3156     3160       +4     
=============================================
+ Hits           12569    12584      +15     
+ Misses         11559    11550       -9     
- Partials        1337     1341       +4     
Impacted Files Coverage Δ
.../java/io/seata/rm/datasource/DataCompareUtils.java 64.94% <0.00%> (-7.47%) ⬇️
...erver/storage/file/session/FileSessionManager.java 49.01% <0.00%> (-0.66%) ⬇️
...er/src/main/java/io/seata/server/ServerRunner.java 50.00% <0.00%> (ø)
...very/registry/zk/ZookeeperRegisterServiceImpl.java 61.76% <0.00%> (+0.73%) ⬆️
...o/seata/server/coordinator/DefaultCoordinator.java 55.39% <0.00%> (+5.39%) ⬆️

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@funky-eyes funky-eyes added this to the 1.5.0 milestone Apr 21, 2022
@funky-eyes funky-eyes added type: bug Category issues or prs related to bug. module/rm-datasource rm-datasource module labels Apr 21, 2022
@funky-eyes
Copy link
Contributor

你的分支过老了,我无法帮你合并最新的develop代码
image
请尽快合并最新seata develop分支代码并推送到此分支,以便我们进行合并pr

@funky-eyes funky-eyes merged commit 496d08c into apache:develop Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor module/rm-datasource rm-datasource module type: bug Category issues or prs related to bug.
Projects
None yet
6 participants