cockroachdb / cockroachdb/cockroach

sql: support database-scope privileges in (rowid) overload of {delete|enable}_statement_hints

Open
#172,171 0 comments 0 reactions 1 assignee Claimed by @michae2 View on GitHub
A-plan-management A-statement-hint C-enhancement T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

We're adding a new STATEMENTHINTS privilege which allows use of the following builtin functions:

- `information_schema.crdb_rewrite_inline_hints`
- `information_schema.crdb_delete_statement_hints`
- `information_schema.crdb_enable_statement_hints`
- `information_schema.crdb_set_session_variable_hint`
- `information_schema.crdb_pin_plan_gist`
- `information_schema.crdb_pin_plan_gram`

STATEMENTHINTS can be global or database-scoped. Initially we'll only allow the database-scoped STATEMENTHINTS to use the overloads of these builtins that take an extra database argument. But there's a special case for `crdb_delete_statement_hints` and `crdb_enable_statement_hints` that we should support: the (rowid) overload. For this overload, we could first look up the indicated statement hint to see whether it is limited to a database before the permission check.

Jira issue: CRDB-65317

Epic: CRDB-66266

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.