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: opt: pass Const type explicitly #49331

Merged
merged 1 commit into from
May 21, 2020

Conversation

rafiss
Copy link
Collaborator

@rafiss rafiss commented May 20, 2020

Backport 1/1 commits from #48652.

/cc @cockroachdb/release


The Const operator infers its type using Datum.ResolvedType(). The Datum's
type loses information in some cases (e.g. see #48563). We now pass the type
explicitly to ConstructConst, similar to the Null operator.

Since Const already had a private member, optgen needed to be modified to
tolerate a Typ field in this case (only allowed for Scalars). Note that this
field was already special - for any Scalar that doesn't have a Typ field, one
is added automatically and InferType is used to populate it.

Release note: None

The `Const` operator infers its type using `Datum.ResolvedType()`. The Datum's
type loses information in some cases (e.g. see cockroachdb#48563). We now pass the type
explicitly to `ConstructConst`, similar to the `Null` operator.

Since Const already had a private member, optgen needed to be modified to
tolerate a Typ field in this case (only allowed for Scalars). Note that this
field was already special - for any Scalar that doesn't have a `Typ` field, one
is added automatically and `InferType` is used to populate it.

Release note: None
@rafiss rafiss requested a review from RaduBerinde May 20, 2020 17:35
@rafiss rafiss requested a review from a team as a code owner May 20, 2020 17:35
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @RaduBerinde)

@rafiss rafiss merged commit 9059857 into cockroachdb:release-20.1 May 21, 2020
@rafiss rafiss deleted the backport20.1-48652 branch May 21, 2020 03:34
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