pingcap / pingcap/tidb

ERROR 8066 when create binding for select statement with high_priority

Open
#57,427 3 comments 0 reactions 2 assignees Claimed by @qw4990 View on GitHub
epic/sql-plan-management report/customer severity/moderate sig/planner type/bug
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)

```
mysql> create table t(a int, b int, key `i_a`(a));
Query OK, 0 rows affected (0.03 sec)

mysql> explain select /*+ use_index(t, i_a) */ high_priority * from t;
+-------------------------------+----------+-----------+-----------------------+--------------------------------+
| id | estRows | task | access object | operator info |
+-------------------------------+----------+-----------+-----------------------+--------------------------------+
| IndexLookUp_6 | 10000.00 | root | | |
| ├─IndexFullScan_4(Build) | 10000.00 | cop[tikv] | table:t, index:i_a(a) | keep order:false, stats:pseudo |
| └─TableRowIDScan_5(Probe) | 10000.00 | cop[tikv] | table:t | keep order:false, stats:pseudo |
+-------------------------------+----------+-----------+-----------------------+--------------------------------+
3 rows in set (0.00 sec)

mysql> create binding for select high_priority * from t using select /*+ use_index(t, i_a) */ high_priority * from t;
ERROR 8066 (HY000): Optimizer hint can only be followed by certain keywords like SELECT, INSERT, etc.
```

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

NO ERROR

### 3. What did you see instead (Required)

ERROR 8066

### 4. What is your TiDB version? (Required)

v8.3.0

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.