pingcap / pingcap/tidb

The query block within the `read_from_storage` hint is not being applied

Open
#41,944 0 comments 0 reactions 1 assignee Claimed by @hawkingrei View on GitHub
epic/hint 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)
```
create table t(a int, b int);
select /*+ read_from_storage(tikv[t1, t2@sel_2]), hash_join_build(t2@sel_2) */ a from t t1 where t1.a in (select a from t t2);
```

### 2. What did you expect to see? (Required)
No warning is generated.

### 3. What did you see instead (Required)
```
mysql> show warnings;
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1815 | There are no matching table names for (t2) in optimizer hint /*+ READ_FROM_STORAGE(tikv[t1, t2]) */. Maybe you can use the table alias name |
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```

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

latest master

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.