-
Notifications
You must be signed in to change notification settings - Fork 24
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
Aligns timezone behavior with JDBC #240
Aligns timezone behavior with JDBC #240
Conversation
Would it be possible to consider setting the default value for the connectionTimeZone property to 'LOCAL', aligning with the default used by mysql-connector-j? to enhance consistency for developers familiar with mysql-connector-j's defaults. |
2c87dd5
to
3dfebff
Compare
This will break the current behavior. Currently, the configuration option If we do, existing users (without |
In my personal opinion, I think we only need to write a migration guide wiki for new users who switch from jdbc to r2dbc. It should contain:
This also helps us clarify what we should do next. WDYT? @jchrys |
d776881
to
819c1b7
Compare
I 100% agree with your solution. I cannot deny that is the right way. |
8399327
to
cfe05a2
Compare
@jchrys , the default The default type mappings of |
@mirromutth |
@jchrys Based on the discussion in micronaut-projects/micronaut-data#2388, I realized that if we tried to use different time zone modes by default, it might cause more complicated problems for some existing projects. Like I said, in my opinion, So, keep things simple. |
@mirromutth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall lgtm.
just a nit and suggestions.
r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/ConnectionContext.java
Outdated
Show resolved
Hide resolved
r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/MySqlConnectionConfiguration.java
Show resolved
Hide resolved
r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/MySqlConnectionConfiguration.java
Outdated
Show resolved
Hide resolved
r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/MySqlConnectionConfiguration.java
Show resolved
Hide resolved
r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/MySqlConnectionConfiguration.java
Show resolved
Hide resolved
r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/codec/LocalDateTimeCodec.java
Outdated
Show resolved
Hide resolved
r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/codec/ZonedDateTimeCodec.java
Outdated
Show resolved
Hide resolved
r2dbc-mysql/src/main/java/io/asyncer/r2dbc/mysql/internal/util/StringUtils.java
Show resolved
Hide resolved
r2dbc-mysql/src/test/java/io/asyncer/r2dbc/mysql/TimeZoneIntegrationTest.java
Show resolved
Hide resolved
- Add `preserveInstants`, `connectionTimeZone` and `forceConnectionTimeZoneToSession` - Default `connectionTimeZone` to "LOCAL" - Mark `serverZoneId` as deprecated. It will notice users to use `connectionTimeZone` instead - Add `TimeZoneIntegrationTest` to test JDBC alignment of time zone behavior - Correct `OffsetTimeCodec` to not convert time zone
cfe05a2
to
5a9b931
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Given this changes default behavior(?), which version do you think best suits this change? (wonder if 1.1.2 would be enough for this changes WDYT?)
I think we can release it and #243 on 1.1.2. This version mainly deals with date time and time zone problems. While this may bring some breaking changes, we can add some wiki for it. |
Got it. Thanks :D |
Motivation:
Aligns timezone behavior with
mysql-connector-j
See also #190
Modification:
preserveInstants
,connectionTimeZone
andforceConnectionTimeZoneToSession
supportconnectionTimeZone
to "LOCAL"serverZoneId
as deprecated. It will notice users to useconnectionTimeZone
insteadTimeZoneIntegrationTest
to test JDBC alignment of time zone behaviorOffsetTimeCodec
to not convert time zone,OffsetTime
is not an instant valueResult:
Users can now specify the local time zone to connection, allowing forcing the specified connection time zone on session.