-
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
sqlsmith: add DELETE FROM ... USING and UPDATE ... FROM support #98914
Conversation
bf1aa42
to
584202d
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.
I used cmd/smith
to see how the new statements look (thanks Michael for that addition!), and they looked reasonable. Should I also actually run something (a command or a unit test) so that generated queries are executed against some DB, or is it ok to just let the nightly tests do that for us?
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @mgartner and @michae2)
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.
If you really want to run against a DB you could do something like:
# first shell
cockroach demo movr
# second shell
smith -url 'postgresql://demo:[email protected]:26257/movr?options=...'
But it's fine with me if we want to let the nightly tests try this out.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @mgartner)
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 1 files at r1, all commit messages.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @yuzefovich)
This commit makes it so that the sqlsmith can now generate statements of the form `DELETE FROM ... USING` and `UPDATE ... FROM`. We toss a coin every time before deciding to add another table (meaning in 50% cases these forms are not used, in 25% we have 1 extra table, etc). It also adjusts the generation of the RETURNING clause for DELETE and UPDATE to be able to pick from any of the table sources. Release note: None
584202d
to
c3304de
Compare
TFTRs! I'll let nightly run tell us if anything is wrong (and will also backport to 23.1 but after a few days of baking on master). bors r+ |
Build failed (retrying...): |
Build failed (retrying...): |
Build succeeded: |
This seems to have found one bug on master, but otherwise didn't destabilize the tests, so I think it's worth backporting to 23.1. |
blathers backport 23.1 |
This commit makes it so that the sqlsmith can now generate statements of the form
DELETE FROM ... USING
andUPDATE ... FROM
. We toss a coin every time before deciding to add another table (meaning in 50% cases these forms are not used, in 25% we have 1 extra table, etc). It also adjusts the generation of the RETURNING clause for DELETE and UPDATE to be able to pick from any of the table sources.Fixes: #98910.
Release note: None