unexpected tiflash error when explaining
- 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 TABLE `tl4473af0a` (
`col_1` varbinary(492) NOT NULL DEFAULT 's&slnLnImorA3R',
`col_2` datetime DEFAULT NULL,
`col_3` blob NOT NULL,
`col_4` json DEFAULT NULL,
`col_5` int unsigned NOT NULL DEFAULT '690344269',
`col_6` tinyblob NOT NULL,
`col_7` timestamp NOT NULL,
`col_8` varchar(244) NOT NULL DEFAULT '~Xu-bU3WP$$0',
UNIQUE KEY `idx_1` (`col_2`,`col_7`) /*T![global_index] GLOBAL */,
PRIMARY KEY (`col_5`) /*T![clustered_index] NONCLUSTERED */,
KEY `idx_3` (`col_5`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
PARTITION BY RANGE (`col_5`)
(PARTITION `p0` VALUES LESS THAN (3673666291));
CREATE TABLE `tl7de69d16` (
`col_9` decimal(8,8) DEFAULT '0',
`col_10` text COLLATE utf8_unicode_ci DEFAULT NULL,
`col_11` decimal(62,22) NOT NULL,
`col_12` time NOT NULL DEFAULT '00:28:31',
`col_13` double DEFAULT NULL,
`col_14` int NOT NULL,
`col_15` tinyint DEFAULT '1',
`col_16` tinyint(1) DEFAULT '0',
`col_17` char(75) COLLATE utf8_unicode_ci DEFAULT NULL,
`col_18` time DEFAULT NULL,
KEY `idx_4` (`col_14`,`col_12`,`col_10`(4)),
KEY `idx_5` (`col_14`,`col_9`,`col_17`),
PRIMARY KEY (`col_14`,`col_12`) /*T![clustered_index] NONCLUSTERED */,
UNIQUE KEY `idx_7` (`col_14`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
PARTITION BY RANGE (`col_14`)
(PARTITION `p0` VALUES LESS THAN (-1873310305),
PARTITION `p1` VALUES LESS THAN (-1290642423),
PARTITION `p2` VALUES LESS THAN (2116766117),
PARTITION `p3` VALUES LESS THAN (MAXVALUE));
CREATE TABLE `tl9af58c29` (
`col_9` decimal(8,8) DEFAULT '0',
`col_10` text COLLATE utf8_unicode_ci DEFAULT NULL,
`col_11` decimal(62,22) NOT NULL,
`col_12` time NOT NULL DEFAULT '00:28:31',
`col_13` double DEFAULT NULL,
`col_14` int NOT NULL,
`col_15` tinyint DEFAULT '1',
`col_16` tinyint(1) DEFAULT '0',
`col_17` char(75) COLLATE utf8_unicode_ci DEFAULT NULL,
`col_18` time DEFAULT NULL,
KEY `idx_4` (`col_14`,`col_12`,`col_10`(4)),
KEY `idx_5` (`col_14`,`col_9`,`col_17`),
PRIMARY KEY (`col_14`,`col_12`) /*T![clustered_index] NONCLUSTERED */,
UNIQUE KEY `idx_7` (`col_14`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
PARTITION BY RANGE (`col_14`)
(PARTITION `p0` VALUES LESS THAN (-1873310305),
PARTITION `p1` VALUES LESS THAN (-1290642423),
PARTITION `p2` VALUES LESS THAN (2116766117),
PARTITION `p3` VALUES LESS THAN (MAXVALUE));
CREATE TABLE `tl6d21413c` (
`col_9` decimal(8,8) DEFAULT '0',
`col_10` text COLLATE utf8_unicode_ci DEFAULT NULL,
`col_11` decimal(62,22) NOT NULL,
`col_12` time NOT NULL DEFAULT '00:28:31',
`col_13` double DEFAULT NULL,
`col_14` int NOT NULL,
`col_15` tinyint DEFAULT '1',
`col_16` tinyint(1) DEFAULT '0',
`col_17` char(75) COLLATE utf8_unicode_ci DEFAULT NULL,
`col_18` time DEFAULT NULL,
KEY `idx_4` (`col_14`,`col_12`,`col_10`(4)),
KEY `idx_5` (`col_14`,`col_9`,`col_17`),
PRIMARY KEY (`col_14`,`col_12`) /*T![clustered_index] NONCLUSTERED */,
UNIQUE KEY `idx_7` (`col_14`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
PARTITION BY RANGE (`col_14`)
(PARTITION `p0` VALUES LESS THAN (-1873310305),
PARTITION `p1` VALUES LESS THAN (-1290642423),
PARTITION `p2` VALUES LESS THAN (2116766117),
PARTITION `p3` VALUES LESS THAN (MAXVALUE));
set tiflash replica;
explain format=brief select /*+ read_from_storage(tiflash[ tl4473af0a ]) */ /*+ */ /*+ NO_HASH_JOIN( tl4473af0a , st_278 */ count( tl4473af0a.col_5 ) as r0 , min( st_278.r0 ) as r1 , bit_or( tl4473af0a.col_5 ) as r2 from tl4473af0a join ( select tl7de69d16.col_14 as r0 , tl7de69d16.col_14 as r1 from tl7de69d16 limit 494923064 ) st_278 on tl4473af0a.col_2 = st_278.r0 where tl4473af0a.col_5 <> ( select /*+ read_from_storage(tiflash[ tl9af58c29,tl6d21413c ]) */ /*+ use_index_merge( tl9af58c29,tl6d21413c ) */ /*+ */ /*+ HASH_JOIN_PROBE( tl9af58c29 ) */ octet_length( tl9af58c29.col_12 ) as r0 from tl9af58c29 join tl6d21413c on tl9af58c29.col_10 = tl6d21413c.col_16 where tl6d21413c.col_9 between 0.9378 and 0.669 order by r0 ) and tl4473af0a.col_7 < '1995-11-12' group by st_278.r1,st_278.r0 limit 332151120;
```
### 2. What did you expect to see? (Required)
No error
### 3. What did you see instead (Required)
``` SQL
mysql> explain format=brief select /*+ read_from_storage(tiflash[ tl4473af0a ]) */ /*+ */ /*+ NO_HASH_JOIN( tl4473af0a , st_278 */ count( tl4473af0a.col_5 ) as r0 , min( st_278.r0 ) as r1 , bit_or( tl4473af0a.col_5 ) as r2 from tl4473af0a join ( select tl7de69d16.col_14 as r0 , tl7de69d16.col_14 as r1 from tl7de69d16 limit 494923064 ) st_278 on tl4473af0a.col_2 = st_278.r0 where tl4473af0a.col_5 <> ( select /*+ read_from_storage(tiflash[ tl9af58c29,tl6d21413c ]) */ /*+ use_index_merge( tl9af58c29,tl6d21413c ) */ /*+ */ /*+ HASH_JOIN_PROBE( tl9af58c29 ) */ octet_length( tl9af58c29.col_12 ) as r0 from tl9af58c29 join tl6d21413c on tl9af58c29.col_10 = tl6d21413c.col_16 where tl6d21413c.col_9 between 0.9378 and 0.669 order by r0 ) and tl4473af0a.col_7 < '1995-11-12' group by st_278.r1,st_278.r0 limit 332151120;
ERROR 1105 (HY000): DB::TiFlashException: in tree based request, executor id `Projection` duplicate, which is unexpected.
```
### 4. What is your TiDB version? (Required)
911d5a1cd8d92008d425a74d6752cf823f5e9b61
Contributor guide
Assessment
This issue has not been assessed yet.