Skip to content

GH-1311: Use Locale.ROOT when formatting JDBC interval strings - #1312

Open
Arawoof06 wants to merge 1 commit into
apache:mainfrom
Arawoof06:interval-string-locale-root
Open

Arawoof06 wants to merge 1 commit into
apache:mainfrom
Arawoof06:interval-string-locale-root

Conversation

@Arawoof06

Copy link
Copy Markdown
Contributor

What's Changed

formatIntervalYear and formatIntervalDay build the Oracle-style interval strings the JDBC interval accessor returns from getString()/getObject() with String.format and no explicit locale, so java.util.Formatter renders the %d digits 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. Pass Locale.ROOT to both calls, the same fix GH-1300 applied to the C Data Interface format strings.

Closes #1311.

@github-actions

This comment has been minimized.

@lidavidm lidavidm added the bug-fix PRs that fix a big. label Oct 1, 2026
@github-actions github-actions Bot added this to the 20.0.0 milestone Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PRs that fix a big.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flight SQL JDBC interval strings use the default locale for digits [C Data] Format.asString emits locale dependent digits in format strings

2 participants