-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sqlbase: add interesting datums for all scalar types #44459
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rohany and @yuzefovich)
pkg/sql/sem/tree/datum.go, line 1485 at r1 (raw file):
} var DMinUUID = NewDUuid(DUuid{uuid.UUID{}})
These will probably need comments (to satisfy the linter).
pkg/sql/sqlbase/testutils.go, line 579 at r1 (raw file):
specials, ok := randInterestingDatums[typ.Family()] if !ok || len(specials) == 0 { panic(fmt.Sprintf("no interesting datum for type %s found", typ.String()))
Not all type families are present in the generation, so I think it's not valid to panic here. You could check whether typ
is one of scalar types and then panic, or add all families to "interesting families", or not panic at all.
I guess I'd vote for not panicking here.
I think @mjibson wanted to panic here, but maybe checking if it is a scalar type and then panicking is good first step. |
a28755d
to
6db2dd4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @rohany)
This seems to have uncovered a bug around TimeTZ! I talked to @otan about it and we'll wait on that fix before merging. |
fwiw, Filed #44530, will get to it next week. |
This PR extends randInterestingDatums to include at least one interesting datum for all scalar types to ensure that edge cases don't break things. Additionally, this PR adds a panic to randInterestingDatums if an interesting datum for a type could not be found, so that we continue to have coverage for all of our types. Part of work for cockroachdb#44322. Release note: None
bors r+ |
44459: sqlbase: add interesting datums for all scalar types r=rohany a=rohany This PR extends randInterestingDatums to include at least one interesting datum for all scalar types to ensure that edge cases don't break things. Additionally, this PR adds a panic to randInterestingDatums if an interesting datum for a type could not be found, so that we continue to have coverage for all of our types. Part of work for #44322. Release note: None Co-authored-by: Rohan Yadav <[email protected]>
Build succeeded |
This PR extends randInterestingDatums to include at least
one interesting datum for all scalar types to ensure that
edge cases don't break things. Additionally, this PR adds
a panic to randInterestingDatums if an interesting datum
for a type could not be found, so that we continue to have
coverage for all of our types.
Part of work for #44322.
Release note: None