-
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
tree: formatting of TableIndexName
seems wrong
#58496
Comments
cc @knz |
How is this a logging issue and not a sql experience issue? |
Updated. Offline we confirmed that the existing logic when the table is missing is totally bogus. I'm inclined to fix the bug before following through on the annotation as that is somewhat more involved. |
yes that would be nice |
@ajwerner @the-ericwang35 just curious -- are there plans to fix the FQName formatting in time for 21.1? |
Hmm this feels like a good thing for @fqazi to pick up. I’m going to tentatively assign him. |
Fixes: cockroachdb#58496 Previously, the object name information for TableIndexName, was not populated in multiple contexts leading to incorrect formatting of index names in event log messages. To address this, this patch modifies code paths for resolving table indexes to add this information during the planning phase. Release note: None
61776: sql: formatting of `TableIndexName` can be wrong in certain contexts r=postamar a=fqazi Fixes: #58496 Previously, the object name information for TableIndexName, was not populated in multiple contexts leading to incorrect formatting of index names in event log messages. To address this, this patch modifies code paths for resolving table indexes to add this information during the planning phase. Release note: None 61830: bench/ddl_analysis: de-flake, clean up format, improve usability r=ajwerner a=ajwerner See individual commits. Fixes #57771. Co-authored-by: Faizan Qazi <[email protected]> Co-authored-by: Andrew Werner <[email protected]>
Fixes: cockroachdb#58496 Previously, the object name information for TableIndexName, was not populated in multiple contexts leading to incorrect formatting of index names in event log messages. To address this, this patch modifies code paths for resolving table indexes to add this information during the planning phase. Release note: None
Describe the problem
A table index name with no table specified will end up being formatted like:
""."".<index name>
when using theFQName
flag for formatting. That is bogus and doesn't refer to an index. There's also logic for formatting the prefix in this bogus is we have a schema, but it's not clear when that can happen.See the below code:
cockroach/pkg/sql/sem/tree/table_name.go
Lines 191 to 195 in c08088d
Preferred Solution
Ideally we'd annotate the
TableIndexName
tree node as at some point during planning we do end up resolving this index to a real table. If we had proper annotations then in the event log context which motivated this issue we'd be able to properly format the name. On the way to that solution, we should stop writing this bogus format which will be interpreted as an object name for an index.Additional context
This arose in the context of #58472 to fix #57740.
The text was updated successfully, but these errors were encountered: