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: bugfix to fractional year interval parsing #56250

Closed
wants to merge 1 commit into from

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented Nov 3, 2020

Backport 1/1 commits from #55230.

/cc @cockroachdb/release


Previously, parsing an interval with a fractional year would produce an
interval that was "too precise" compared to Postgres, which we aim to be
compatible with. Postgres truncates the precision of fractional years in
intervals to months; we did not.

This commit fixes the issue. For example, '1.1 year'::interval will
become '1 year 1 month' instead of a quantity with days and hours.

Closes #55226.

Release note (sql change): parsing intervals with fractional years now
produces intervals with no more precision than months, to match the
behavior of Postgres.

Previously, parsing an interval with a fractional year would produce an
interval that was "too precise" compared to Postgres, which we aim to be
compatible with. Postgres truncates the precision of fractional years in
intervals to months; we did not.

This commit fixes the issue. For example, '1.1 year'::interval will
become '1 year 1 month' instead of a quantity with days and hours.

Release note (sql change): parsing intervals with fractional years now
produces intervals with no more precision than months, to match the
behavior of Postgres.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rafiss
Copy link
Collaborator Author

rafiss commented Nov 11, 2020

There's no more scheduled 19.2 releases so I'll just close this.

It's failing bc of a TeamCity thing i think

/home/agent/work/.go/src/github.com/cockroachdb/cockroach/build/teamcity-test.sh: line 28: go-test-teamcity: command not found

@rafiss rafiss closed this Nov 11, 2020
@rafiss rafiss deleted the backport19.2-55230 branch November 11, 2020 19:27
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.

4 participants