8000 sql: Fix panic when auto stats are computed on views by andy-kimball · Pull Request #34726 · cockroachdb/cockroach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sql: Fix panic when auto stats are computed on views #34726

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

Merged
merged 1 commit into from
Feb 7, 2019

Conversation

andy-kimball
Copy link
Contributor

At startup, all crdb_internal.tables are enqueued in order to have stats
computed over them, if needed. However, that vtable includes views as well
as tables, and views cause the CREATE STATISTICS code to panic.

This commit fixes the panic (returns an error instead). It also prevents
the auto stats code from continually re-enqueuing the refresh request for
views and vtables, since they will fail every time.

We need to come back and fix this better by not enqueuing views in the
first place. However, that turned out to be problematic because the
crdb_internal.tables vtable has no column that distinguishes view from
tables.

Release note: None

At startup, all crdb_internal.tables are enqueued in order to have stats
computed over them, if needed. However, that vtable includes views as well
as tables, and views cause the CREATE STATISTICS code to panic.

This commit fixes the panic (returns an error instead). It also prevents
the auto stats code from continually re-enqueuing the refresh request for
views and vtables, since they will fail every time.

We need to come back and fix this better by not enqueuing views in the
first place. However, that turned out to be problematic because the
crdb_internal.tables vtable has no column that distinguishes view from
tables.

Release note: None
@andy-kimball andy-kimball requested review from jordanlewis, justinj, rytaft and a team February 7, 2019 22:04
Copy link
Member
@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

LGTM

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@asubiotto asubiotto mentioned this pull request Feb 7, 2019
17 tasks
@andy-kimball
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Feb 7, 2019
34726: sql: Fix panic when auto stats are computed on views r=andy-kimball a=andy-kimball

At startup, all crdb_internal.tables are enqueued in order to have stats
computed over them, if needed. However, that vtable includes views as well
as tables, and views cause the CREATE STATISTICS code to panic.

This commit fixes the panic (returns an error instead). It also prevents
the auto stats code from continually re-enqueuing the refresh request for
views and vtables, since they will fail every time.

We need to come back and fix this better by not enqueuing views in the
first place. However, that turned out to be problematic because the
crdb_internal.tables vtable has no column that distinguishes view from
tables.

Release note: None

Co-authored-by: Andrew Kimball <andyk@cockroachlabs.com>
@craig
Copy link
Contributor
craig bot commented Feb 7, 2019

Build succeeded

@craig craig bot merged commit 3567d2f into cockroachdb:master Feb 7, 2019
@andy-kimball andy-kimball deleted the viewstats branch February 7, 2019 23:06
@rytaft
Copy link
Collaborator
rytaft commented Feb 8, 2019

:lgtm: thanks for fixing this!

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.

5 participants
0