Repository navigation
fix(jsonb): dump timestamps with time zones - #7977
Open
dongyikuan919 wants to merge 1 commit into
Open
dongyikuan919 wants to merge 1 commit into
dongyikuan919 wants to merge 1 commit into
Conversation
This branch has not been deployed
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 this PR does / why we need it?
Fixes #7976. A
ZonedDateTimeserialized byJSONB.toBytescan be parsed from JSONB, butJSONB.toJSONStringthrew onBC_TIMESTAMP_WITH_TIMEZONE. This also happens in raw mode.Summary of your change
Reuse the existing zoned timestamp reader for that token, write the resulting JSON time string with the existing writer, and advance the dump cursor to the next value. Regression tests cover normal and raw scalar output, plus an array with an integer following the timestamp.
The two new tests failed before the change. All 69 targeted Maven tests passed on JDK 17 with zero Checkstyle violations. A JDK 8 smoke check also passed for scalar, raw, and array output.
Please indicate you've done the following:
中文说明
修复 #7976。
JSONB.toJSONString遇到带时区的时间戳时,复用现有读取器和 JSON 时间写入逻辑,再同步读取位置。新增用例验证普通与 raw 模式,以及数组中紧随时间戳的元素。JDK 17 下 69 项 Maven 定向测试全部通过,Checkstyle 无违规。JDK 8 下三个场景的冒烟验证也通过。OpenAI Codex assisted with reproduction, implementation, and testing.