Skip to content
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 logic to collect stats on system.jobs #108139

Merged
merged 1 commit into from Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions pkg/sql/create_stats.go
Expand Up @@ -233,12 +233,6 @@ func (n *createStatsNode) makeJobRecord(ctx context.Context) (*jobs.Record, erro
)
}

if tableDesc.GetID() == keys.JobsTableID {
return nil, pgerror.New(
pgcode.WrongObjectType, "cannot create statistics on system.jobs",
)
}

if tableDesc.GetID() == keys.ScheduledJobsTableID {
return nil, pgerror.New(
pgcode.WrongObjectType, "cannot create statistics on system.scheduled_jobs",
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/distsql_stats
Expand Up @@ -1657,8 +1657,8 @@ ANALYZE system.lease
statement error pq: cannot create statistics on system.table_statistics
ANALYZE system.table_statistics

# Collecting stats on system.jobs is disallowed.
statement error pq: cannot create statistics on system.jobs
# Collecting stats on system.jobs is allowed.
statement ok
ANALYZE system.jobs

# Collecting stats on system.scheduled_jobs is disallowed.
Expand Down