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

opt: Fix bug in function interning. #30530

Merged
merged 1 commit into from
Sep 27, 2018
Merged

Conversation

andy-kimball
Copy link
Contributor

Some builtin function overloads have a return type that's dependent on
the type of its parameters (e.g. unnest). This means that two FuncOpDef
structs with the same overload can have different Type fields. Therefore,
the FuncOpDef interning needs to incorporate that type.

Release note: None

@andy-kimball andy-kimball requested a review from a team as a code owner September 22, 2018 16:31
@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! 0 of 0 LGTMs obtained (and 1 stale)

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale)


pkg/sql/opt/memo/private_storage_test.go, line 567 at r1 (raw file):

	// Same type, different overloads.
	funcDef3 := &FuncOpDef{Name: "bar", Type: ttuple2, Properties: nowProps, Overload: &nowOvls[1]}

now this is a different type from funcDef2

Some builtin function overloads have a return type that's dependent on
the type of its parameters (e.g. unnest). This means that two FuncOpDef
structs with the same overload can have different Type fields. Therefore,
the FuncOpDef interning needs to incorporate that type.

Release note: None
Copy link
Contributor Author

@andy-kimball andy-kimball left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained


pkg/sql/opt/memo/private_storage_test.go, line 567 at r1 (raw file):

Previously, rytaft wrote…

now this is a different type from funcDef2

Whoops, good catch. Fixed.

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale)

@andy-kimball
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Sep 27, 2018
30530: opt: Fix bug in function interning. r=andy-kimball a=andy-kimball

Some builtin function overloads have a return type that's dependent on
the type of its parameters (e.g. unnest). This means that two FuncOpDef
structs with the same overload can have different Type fields. Therefore,
the FuncOpDef interning needs to incorporate that type.

Release note: None

30608: sqlbase: introduce RowFetcher.Reset() r=jordanlewis a=jordanlewis

In preparation for pooling tableReader objects and reusing internal
allocated memory.

Broken out from #30556.

Release note: None

30727: cli: Make "unknown sub-command" error clearer for empty subcommands r=a-robinson a=a-robinson

I ran `cockroach zone` to try and get the list of available sub-commands
printed as help text, but ended up getting confused by what it printed:

Error: unknown sub-command:
Failed running "zone"

I wasn't really sure what this meant. Now it'll print:

Error: unknown sub-command: ""
Failed running "zone"

It may also be better to say something like "unknown or missing
sub-command". Let me know if you'd prefer that.

Release note: None

---

Along these lines, how come the available subcommands don't get printed anymore? I can't get them listed either with `cockroach zone` or `cockroach zone -h`. I could have sworn we used to list them. Did cobra change? Maybe I'm conflating cockroach with other tools. It'd certainly be nice if we did, though.

Co-authored-by: Andrew Kimball <andyk@cockroachlabs.com>
Co-authored-by: Jordan Lewis <jordanthelewis@gmail.com>
Co-authored-by: Alex Robinson <alexdwanerobinson@gmail.com>
@craig
Copy link
Contributor

craig bot commented Sep 27, 2018

Build succeeded

@craig craig bot merged commit 77dce3f into cockroachdb:master Sep 27, 2018
@andy-kimball andy-kimball deleted the internfix branch September 27, 2018 21:37
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