planner: GRANT PROXY reports an internal Go type instead of an unsupported-feature error

Open Beginner friendly
#71,003 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, sql
Domain
databases

Research direction

Start with PlanBuilder.Build in pkg/planner/core/planbuilder.go and the GRANT PROXY parser rule in pkg/parser/parser.y. Run the SQL reproduction from the issue, then verify that GRANT PROXY reports a clear unsupported-feature error instead of exposing an internal Go type. Done means the diagnostic is corrected without implementing proxy-user support.

Written by the indexing model from the issue text.

Description

component/privilege severity/minor type/bug

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Run the following SQL as an administrative user:

CREATE USER 'proxy_base'@'%' IDENTIFIED BY 'Test12345!';
CREATE USER 'proxy_target'@'%' IDENTIFIED BY 'Test12345!';
GRANT PROXY ON 'proxy_base'@'%' TO 'proxy_target'@'%';

This report concerns the error message for an unsupported statement, not a request to implement proxy-user support.

2. What did you expect to see? (Required)

A clear error explaining that TiDB does not support GRANT PROXY, for example:

This version of TiDB doesn't yet support 'GRANT PROXY'
3. What did you see instead (Required)

The reported execution returned:

ERROR 8108 (HY000): Unsupported type *resolve.NodeW

This exposes an internal Go type without explaining which SQL feature is unsupported.

Source inspection also confirms the same diagnostic problem on master at ebcba3eefb082713e6cf7f7c04511335c563d7e1: the parser accepts GRANT PROXY, but PlanBuilder.Build has no branch for *ast.GrantProxyStmt and falls through to ErrUnsupportedType. That revision formats node.Node, so its expected message is Unsupported type *ast.GrantProxyStmt, rather than the wrapper type in the reported output. This master result is inferred from source, not a local runtime reproduction.

Severity assessment: minor. The confirmed defect is an unclear diagnostic for an unsupported feature. No data corruption, incorrect query results, privilege bypass, or failure of a supported operation has been demonstrated.

4. What is your TiDB version? (Required)

The exact TiDB version for the reported SQL output was not provided.

Master was inspected at ebcba3eefb082713e6cf7f7c04511335c563d7e1. No local TiDB server reproduction was performed.

Dominant language
Go
Stars
40.6k
Forks
6.2k
Avg merge
3d 3h
Merged PRs (30d)
168

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pingcap/tidb

All issues in pingcap/tidb

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.