-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
sqlsmith: Various usability and bug fixes. #120504
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? Thank you for updating your pull request. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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.
Just two small comments.
Reviewed 5 of 8 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @miretskiy and @rytaft)
pkg/internal/sqlsmith/sqlsmith.go
line 460 at r2 (raw file):
// EnableLimits causes the Smither to probabilistically emit LIMIT clauses. var EnableLimits = simpleOption("enable LIMIT", func(s *Smither) { s.disableLimits = true
Should this be false?
pkg/internal/sqlsmith/type.go
line 62 at r2 (raw file):
switch t { case types.Box2D, types.Geography, types.Geometry, types.INet, types.PGLSN, types.RefCursor, types.TSQuery, types.TSVector:
suggestion: I think it would be better to construct this as an approval list rather than subtracting a disapproval list from all scalar types, because we're likely to keep adding types in the future and those types will most likely skew toward "fancy".
Yup.
|
bors r+ |
🔒 Permission denied Existing reviewers: click here to make miretskiy a reviewer |
@michae2 -- looks like I can't merge it; will you do the honors? |
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.
Yes! I will rebase it and then merge.
Reviewed 6 of 6 files at r3, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @rytaft)
This PR adds various command line flags and sqlsmith options to improve usability and correctness: * Add `--schema` command line argument to sqlsmith so that the running database instance is not required in order to populate existing table information. * Add `--prefix` command line argument which will add prefix to every statement/expression generated by sqlsmith (this can be used for example to generalte sqllogic format) * Add a new smither option `SimpleScalarTypes` which eschews "complex types" -- such as GEOMETRY, GEOGRAPHY, and other less common types. * Fix a bug where `DisableIndexHints` option was not respected (all tables had index flags). * Fix a bug where pretty printing (query or expression) did not respect `PostgresMode`, thus producing queries that are not compatible w/ postgres (e.g. they always included type annotations). Epic: None Release note: None
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
bors r=michae2 a=miretskiy |
This PR adds various command line flags and
sqlsmith options to improve usability and correctness:
--schema
command line argument to sqlsmith so that the running database instance is not required in order to populate existing table information.--prefix
command line argument which will add prefix to every statement/expression generated by sqlsmith (this can be used for example to generalte sqllogic format)SimpleScalarTypes
which eschews "complex types" -- such as GEOMETRY, GEOGRAPHY, and other less common types.DisableIndexHints
option was not respected (all tables had index flags).PostgresMode
, thus producing queries that are not compatible w/ postgres (e.g. they always included type annotations).Epic: None
Release note: None