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

fix(mariadb): named timezone connection bug #10705

Merged
merged 2 commits into from Apr 8, 2019

Conversation

javiertury
Copy link
Contributor

Mariadb doesn't support named timezones. Previous workaround missed connectionConfig.timezone. It didn't show on online tests, because they use UTC.

@codecov
Copy link

codecov bot commented Apr 5, 2019

Codecov Report

Merging #10705 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10705      +/-   ##
==========================================
+ Coverage    96.3%   96.31%   +0.01%     
==========================================
  Files          93       93              
  Lines        8976     8976              
==========================================
+ Hits         8644     8645       +1     
+ Misses        332      331       -1
Impacted Files Coverage Δ
lib/dialects/mariadb/connection-manager.js 100% <100%> (ø) ⬆️
lib/dialects/mariadb/data-types.js 100% <0%> (+1.96%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b6c9117...60e7968. Read the comment docs.

Copy link
Contributor

@sushantdhiman sushantdhiman left a comment

Choose a reason for hiding this comment

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

enable this test for mariadb

@sushantdhiman sushantdhiman merged commit 175da2d into sequelize:master Apr 8, 2019
@sushantdhiman
Copy link
Contributor

🎉 This PR is included in version 5.2.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rusher
Copy link
Contributor

rusher commented May 7, 2019

hmm, that PR doesn't really solve the issue, but create more problems.
timezone is now initialized to some offset, but for timezone with daylight saving time (DST) for example, that will result in having new offset when changing to summer/winter time for example.

Last driver release now support IANA timezone.

Better to revert that change

@javiertury
Copy link
Contributor Author

@rusher I think your points are valid. However this pull request didn't decide to convert named timezones to hour offsets. That was probably decided earlier in another commit. This pull request addresses how they are converted.

Previously the connection was initialized using raw options.timezone, and the timezone was immediately changed to an hour offset using SET time_zone = '${tzOffset}';. This pull request initializes the connection with an hour offset directly, so the connection doesn't crash. Before and after this commit, the final timezone has always been an hour offset. The difference is that the driver doesn't throw any errors.

@javiertury javiertury deleted the mariadb_con_tz branch September 3, 2019 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants