sql: add database overload of information_schema.crdb_rewrite_inline_hints#164562
Open
michae2 wants to merge 3 commits intocockroachdb:masterfrom
Open
sql: add database overload of information_schema.crdb_rewrite_inline_hints#164562michae2 wants to merge 3 commits intocockroachdb:masterfrom
michae2 wants to merge 3 commits intocockroachdb:masterfrom
Conversation
Factor out the shared logic from the rewriteInlineHintsOverload closure into a standalone rewriteInlineHintsImpl function. This makes it easier to add additional overloads that share the same core logic. No functional change. Epic: None Release note: None Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Contributor
|
Merging to
|
Member
Add a 3-arg overload of crdb_internal.inject_hint and information_schema.crdb_rewrite_inline_hints that accepts a database name. When specified, the hint is scoped to only apply when the current database matches. Changes: - InsertHintIntoDB gains an optDatabase parameter; when non-empty and the cluster version supports it, includes the database in the INSERT. - InsertStatementHint interface and implementations updated accordingly. - New 3-arg overload registered for both builtin names. - RewriteInlineHints proto event gains a database field. Part of: cockroachdb#163522 Release note: None Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
Add test cases to statement_hint_builtins verifying that: - The 3-arg overload of crdb_rewrite_inline_hints sets the database column in system.statement_hints. - The 2-arg overload leaves the database column NULL. - The 3-arg overload of crdb_internal.inject_hint also sets the database column. Part of: cockroachdb#163522 Release note: None Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
357ae2b to
1af513f
Compare
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sql: extract rewriteInlineHintsImpl from rewriteInlineHintsOverload
Factor out the shared logic from the rewriteInlineHintsOverload closure
into a standalone rewriteInlineHintsImpl function. This makes it easier
to add additional overloads that share the same core logic.
No functional change.
Epic: None
Release note: None
Co-Authored-By: roachdev-claude roachdev-claude-bot@cockroachlabs.com
sql: add database parameter to statement hint insertion
Add a 3-arg overload of crdb_internal.inject_hint and
information_schema.crdb_rewrite_inline_hints that accepts a database
name. When specified, the hint is scoped to only apply when the current
database matches.
Changes:
the cluster version supports it, includes the database in the INSERT.
Part of: #163522
Release note: None
Co-Authored-By: roachdev-claude roachdev-claude-bot@cockroachlabs.com
sql: add tests for 3-arg overload database column in statement hints
Add test cases to statement_hint_builtins verifying that:
column in system.statement_hints.
database column.
Part of: #163522
Release note: None
Co-Authored-By: roachdev-claude roachdev-claude-bot@cockroachlabs.com