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-20.1: pgdate: allow parsing of dates with year 0 #56743

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

yuzefovich
Copy link
Member

Backport 1/1 commits from #56636.

/cc @cockroachdb/release


We support two formats for specifying the year: ISO8601 and AD/BC
notation while PG supports only the latter. Year 0000 in ISO is 1 BC in
AD/BC, year 0 in AD/BC notation is invalid. Previously we were erroring
out if year 0 is used in ISO notation which could lead to internal
errors when trying to deserialize a date with year 1 BC, and this is now
fixed by allowing year 0 to be used (we still check that it is invalid
in AD/BC notation).

Fixes: #56554.

Release note (bug fix): CockroachDB previously could encounter an
internal error when date/timestamp/timestamptz that is of year 1 BC was
sent between nodes for execution. Additionally, previously it was not
possible to specify the date/timestamp/timestamptz with year 1 BC
without using AD/BC notation. This is now fixed.

@yuzefovich yuzefovich requested a review from otan November 16, 2020 18:45
@cockroach-teamcity
Copy link
Member

This change is Reviewable

We support two formats for specifying the year: ISO8601 and AD/BC
notation while PG supports only the latter. Year 0000 in ISO is 1 BC in
AD/BC, year 0 in AD/BC notation is invalid. Previously we were erroring
out if year 0 is used in ISO notation which could lead to internal
errors when trying to deserialize a date with year 1 BC, and this is now
fixed by allowing year 0 to be used (we still check that it is invalid
in AD/BC notation).

Release note (bug fix): CockroachDB previously could encounter an
internal error when date/timestamp/timestamptz that is of year 1 BC was
sent between nodes for execution. Additionally, previously it was not
possible to specify the date/timestamp/timestamptz with year 1 BC
without using AD/BC notation. This is now fixed.
@yuzefovich yuzefovich merged commit d7d07d3 into cockroachdb:release-20.1 Nov 17, 2020
@yuzefovich yuzefovich deleted the backport20.1-56636 branch November 17, 2020 06:41
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.

None yet

3 participants