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

Extract a common error message pattern for conflicted SQL hints and hint alias #11632

Open
foreyes opened this issue Aug 6, 2019 · 1 comment
Assignees

Comments

@foreyes
Copy link
Contributor

foreyes commented Aug 6, 2019

Feature Request

Is your feature request related to a problem? Please describe:

When adding new optimizer hints #11364 , we have these warnings messages:
"Optimizer aggregation hints are conflicted" for TIDB_HASHAGG and TIDB_STREAMAGG.
"Join hints are conflict, you can only specify one type of join" for Join Hints.

Describe the feature you'd like:

Extract a common error message pattern for conflicted SQL hints, for example:

errMsgPattern := "Conflicted SQL Hints for %s. You can only specify one of these hints: %s"
errConflictedSQLHints := terror.ClassOptimizer.New(codeInternal, errMsgPattern)
errConflictedSQLHints.GenWithStackByArgs(
	"Aggregate",
	strings.Join([]string{"TIDB_HASHAGG()", "TIDB_STREAMAGG()"}, ","),
)
errConflictedSQLHints.GenWithStackByArgs(
	"Join",
	strings.Join([]string{"TIDB_HJ()", "TIDB_SMJ()", "TIDB_INLJ()"}, ","),
)

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

@foreyes foreyes self-assigned this Aug 6, 2019
@foreyes
Copy link
Contributor Author

foreyes commented Aug 13, 2019

Maybe we need take Hint Alias into considering too.

@foreyes foreyes changed the title Extract a common error message pattern for conflicted SQL hints Extract a common error message pattern for conflicted SQL hints and hint Aug 13, 2019
@foreyes foreyes changed the title Extract a common error message pattern for conflicted SQL hints and hint Extract a common error message pattern for conflicted SQL hints and hint alias Aug 13, 2019
@ghost ghost added this to Issue Backlog: Need Triage in SIG Planner Kanban via automation Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SIG Planner Kanban
  
Issue Backlog: Need Triage
Development

No branches or pull requests

1 participant