Skip to content

Missing RootTaskType for agg causes Can't find a proper physical plan error(2) #41014

@AilinKid

Description

@AilinKid

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

this issue seems similar as #38478 at the very first sight, but after digging deep inside, we found it has something related with virtual-column

CREATE TABLE `tai1` (
  `aid` int(11) DEFAULT NULL,
  `rid` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 

CREATE TABLE `tai2` (
  `rid` int(11) DEFAULT NULL,
  `prilan` varchar(20) DEFAULT NULL,
  KEY `idx` ((lower(`prilan`)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 

set both tables tiflash replica 1/ or mock the getPossiblePath in tidb code

alter table tai2 add index idx((lower(prilan)));  // important

set @@tidb_opt_distinct_agg_push_down = 1;

select count(distinct tai1.aid) as cb from tai1 inner join tai2 on tai1.rid = tai2.rid where lower(prilan)  LIKE LOWER('%python%');
(1815, "Internal : Can't find a proper physical plan for this query")

The important thing is that there is a expression-index side table of tai2

 KEY `idx` ((lower(`prilan`)))
which will create a hidden virtual column as lower(`prilan`)

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

show the plan out

3. What did you see instead (Required)

(1815, "Internal : Can't find a proper physical plan for this query")

4. What is your TiDB version? (Required)

master

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions