-
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
sql: fix CTAS when selecting from some internal virtual tables #105324
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 2 of 2 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @ecwall 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.
Thanks for fixing this, you beat me to it.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @ecwall and @michae2)
This commit fixes an oversight where we forgot to set the SQL stats provider in some code paths (namely when `NewInternalPlanner` is called, one example is backfilling query into table that powers CREATE TABLE AS and CREATE MATERIALIZED VIEW AS features), and this is now fixed. Release note (bug fix): Previously, CockroachDB would crash when evaluating CREATE TABLE .. AS or CREATE MATERIALIZED VIEW .. AS statements when AS clause selected data from `crdb_internal.cluster_statement_statistics` or `crdb_internal.cluster_transaction_statistics` virtual tables. The bug has been present since at least 22.1 and is now fixed.
e2bff4d
to
cb097b5
Compare
As it turns out, I was the one who papered over this problem two years ago in 03ca31b 😅 TFTRs! bors r+ |
Build failed: |
Seems like unrelated flake. bors r+ |
Build failed: |
Hm, perhaps the failure on
Let's try one more time, and if that doesn't work, I'll need help from SQL Foundations friends. bors r+ |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from cb097b5 to blathers/backport-release-22.2-105324: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 22.2.x failed. See errors above. error setting reviewers, but backport branch blathers/backport-release-23.1-105324 is ready: POST https://api.github.com/repos/cockroachdb/cockroach/pulls/105325/requested_reviewers: 422 Reviews may only be requested from collaborators. One or more of the teams you specified is not a collaborator of the cockroachdb/cockroach repository. [] Backport to branch 23.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
This commit fixes an oversight where we forgot to set the SQL stats provider in some code paths (namely when
NewInternalPlanner
is called, one example is backfilling query into table that powers CREATE TABLE AS and CREATE MATERIALIZED VIEW AS features), and this is now fixed.Fixes: #76710.
Release note (bug fix): Previously, CockroachDB would crash when evaluating CREATE TABLE .. AS or CREATE MATERIALIZED VIEW .. AS statements when AS clause selected data from
crdb_internal.cluster_statement_statistics
orcrdb_internal.cluster_transaction_statistics
virtual tables. The bug has been present since at least 22.1 and is now fixed.