fix(timezone): add UTC fast path in str_to_offset to fix error 1298 on Windows#881
Open
ep-12221 wants to merge 1 commit into
Open
fix(timezone): add UTC fast path in str_to_offset to fix error 1298 on Windows#881ep-12221 wants to merge 1 commit into
ep-12221 wants to merge 1 commit into
Conversation
…n Windows Root cause: On Windows, when the timezone system table data is not loaded or is incomplete, executing `SET @@session.time_zone='UTC'` would result in ER_UNKNOWN_TIME_ZONE (1298). This is because `str_to_offset` correctly identifies 'UTC' as a non-offset format and returns OB_ERR_UNKNOWN_TIME_ZONE. Subsequently, `find_pos_time_zone` attempts to look up 'UTC' as a timezone name, which fails due to the unloaded timezone system data. Fix: Added a fast path for 'UTC' in `str_to_offset`, treating 'UTC' as offset=0 (equivalent to '+00:00'). UTC is a fixed timezone without DST transitions, with an offset always of 0. This fast path does not rely on the timezone system table data. Scope of impact: Only affects timezone offset string parsing; does not affect other timezone name lookup logic. DIMA: 2026042200115621510
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.
Task Description
Fix the issue where executing
SET @@session.time_zone='UTC'on Windows returnsER_UNKNOWN_TIME_ZONE (1298)when the timezone system table data is not loaded or is incomplete.Solution Description
The root cause is that
str_to_offsetcorrectly identifies 'UTC' as a non-offset format and returnsOB_ERR_UNKNOWN_TIME_ZONE. Subsequently,find_pos_time_zoneattempts to look up 'UTC' as a timezone name, which fails because the timezone system data is not loaded.The fix adds a fast path for 'UTC' within the
str_to_offsetfunction, treating 'UTC' as an offset of 0 (equivalent to '+00:00'). UTC is a fixed timezone without DST transitions, so its offset is always 0. This fast path does not depend on the timezone system table data.Passed Regressions
Upgrade Compatibility
Other Information
DIMA: 2026042200115621510
Release Note