pingcap / pingcap/tidb

index name can be ignored in USE_INDEX hint

Open
#45,362 2 comments 0 reactions 0 assignees View on GitHub
sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)
```sql
CREATE GLOBAL BINDING FOR select * from t where ... USING select /*+ USE_INDEX(t) */ * from t where ...
```
### 2. What did you expect to see? (Required)
Bind statement above should be invalid, there must have a index name for USE_INDEX(t, indexname, [indexname...])
### 3. What did you see instead (Required)
Bind statement above was applied, and sql start with table full scan.
### 4. What is your TiDB version? (Required)
Server version: 5.7.25-TiDB-v5.2.3

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.