Skip to content
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

release-19.2: sql: fix parsing of 0000-01-01 as Time/TimeTZ #42918

Merged
merged 1 commit into from
Dec 10, 2019

Conversation

otan
Copy link
Contributor

@otan otan commented Dec 3, 2019

Backport 1/1 commits from #42762.

/cc @cockroachdb/release


Resolves #42749

Since lib/pq outputs time.Time for time datums as 0000-01-01, we
should be able to parse this in. However, pgdate library cannot do
that - so we hack around it for now by replacing the year for these
kinds of dates.

Release note (bug fix): Previously, attempting to parse 0000-01-01 00:00 when involving time did not work as pgdate does not
understand 0000 as a year. This PR will fix that behaviour.

@otan otan requested review from solongordon and a team December 3, 2019 18:14
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@otan otan force-pushed the backport19.2-42762 branch from a06eba3 to 905cc9b Compare December 3, 2019 19:01
Since `lib/pq` outputs `time.Time` for time datums as 0000-01-01, we
should be able to parse this in. However, `pgdate` library cannot do
that - so we hack around it for now by replacing the year for these
kinds of dates.

Release note (bug fix): Previously, attempting to parse `0000-01-01
00:00` when involving `time` did not work as `pgdate` does not
understand `0000` as a year. This PR will fix that behaviour.
@otan otan force-pushed the backport19.2-42762 branch from 905cc9b to c09280f Compare December 4, 2019 00:06
@otan otan merged commit fa0782d into cockroachdb:release-19.2 Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants