Conversation
Arawoof06
requested review from
jbonofre,
laurentgo,
lidavidm and
wgtmac
as code owners
September 30, 2026 10:24
This comment has been minimized.
This comment has been minimized.
jbonofre
approved these changes
Oct 2, 2026
jbonofre
left a comment
Member
There was a problem hiding this comment.
LGTM.
Using Locale.ROOT in formatInternalYear and formatIntervalDay is the right fix, since %d otherwise follows the default locale and can emit non-ASCII digits (e.g. ar-EG). The new test covers that case, and the expected values (+021-02, +001 18:25:16.766) check out.
Nit (non blocking): testFormatIntervalIgnoresDefaultLocale calls Locale.setDefault, which is JVM-global. It restores the locale in finally, so this is only a concern if JUnit parallel execution is enabled for this module. If it is, consider @ResourceLock(Resources.LOCALE).
jbonofre
force-pushed
the
interval-string-locale-root
branch
from
October 2, 2026 15:57
404213c to
f63a207
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's Changed
formatIntervalYearandformatIntervalDaybuild the Oracle-style interval strings the JDBC interval accessor returns fromgetString()/getObject()withString.formatand no explicit locale, sojava.util.Formatterrenders the%ddigits using the JVM default locale. On a JVM whose default locale uses non-ASCII digits (ar-EG,bn-BD,mr-IN, ...) an interval comes back as+٠٢١-٠٢instead of+021-02, which corrupts the value handed to JDBC clients and breaks anything parsing it as ASCII. PassLocale.ROOTto both calls, the same fix GH-1300 applied to the C Data Interface format strings.Closes #1311.