Skip to content

Conversation

@rkistner
Copy link
Contributor

Tests currently fail if the MySQL server is configured with a timezone other than UTC.

The issue is that MySQL always returns timestamps in the session timezone, without any timezone indicator. So there is no way to know what we should configure the client timezone with if we don't know the server timezone.

The current tests also stored timestamps in the default/server timezone, but expected them to be returned in UTC timezone.

This changes:

  1. Fix the tests to use +00:00 timezone in literals.
  2. Always set the timezone on the mysql connection used for queries: SET time_zone = "+00:00". This is somehow not needed for zongji. This is currently set on every query - not sure if there is a more efficient way to do this with a pool.

@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2024

⚠️ No Changeset found

Latest commit: d3c8659

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rkistner
Copy link
Contributor Author

Superseded by #170.

@rkistner rkistner closed this Dec 31, 2024
@rkistner rkistner deleted the mysql-timezone-consistency branch December 31, 2024 13:15
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

Successfully merging this pull request may close these issues.

1 participant