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

MySQL Connector/J8.0.22有时区BUG #58

Open
KoalaJas opened this issue Mar 14, 2024 · 1 comment
Open

MySQL Connector/J8.0.22有时区BUG #58

KoalaJas opened this issue Mar 14, 2024 · 1 comment

Comments

@KoalaJas
Copy link

KoalaJas commented Mar 14, 2024

这两天升级到了8.0.33,发现存量的工单、confluence文章附件时间等都减了13小时,搜索一番发现是JDBC和Mysql协商CST是否会混乱。
看了mysql官网发现这个bug在8.0.23修复了:
https://dev.mysql.com/doc/relnotes/connector-j/8.0/en/news-8-0-23.html

After upgrading from Connector/J 5.1 to 8.0, the results of saving and then retrieving and values became different sometimes. It was because while Connector/J 5.1 does not preserve a time instant by default, Connector/J 8.0.22 and earlier tried to do so by converting a timestamp to the server's session time zone before sending its value to the server. In this release, new mechanisms for controlling timezone conversion has been introduced—see Preserving Time Instants for details. Under this new mechanism, the default behavior of Connector/J 5.1 in this respect is preserved by setting the connection property preserveInstants=false. (Bug #30962953, Bug #98695, Bug #30573281, Bug #95644)DATETIMETIMESTAMP

测试了两种解决方法:要不然就升级JDBC,要不然就要在docker-compose.yml里添加参数--default-time-zone = '+08:00'
@haxqer

@haxqer
Copy link
Owner

haxqer commented Mar 20, 2024

m.....d
这周六还要加班,我只能这周日试试你给出的方案了

感谢你

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants