Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The subquery IN returns an error result #46779

Closed
wuliLSF opened this issue Sep 8, 2023 · 3 comments · Fixed by #46808
Closed

The subquery IN returns an error result #46779

wuliLSF opened this issue Sep 8, 2023 · 3 comments · Fixed by #46808
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. report/community The community has encountered this bug. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@wuliLSF
Copy link

wuliLSF commented Sep 8, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

`CREATE TABLE `in_test` (
  `id` bigint(20) unsigned NOT NULL ,
  `name` varchar(45) NOT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ,
  `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */,
  KEY `inx_name` (`name`),
  KEY `idx_create_time` (`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin 
PARTITION BY HASH (`id`) PARTITIONS 128; `

`insert into in_test(id,name) 
values(6700402571,'张三'),(1624923463,'李四'),(5837848666,'王五'),(6542259574,'赵六');`

`select id,
       `name`
from `in_test`
where id in
      (1624923463, 1624923463, 5837848666, 5837848666, 6700402571, 6700402571, 6542259574,6542259574);`
<!-- a step by step guide for reproducing the bug. -->

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

id               |estRows|actRows|task|access object                            |execution info                                                                                                                                                                                                            |operator info                                                                                                                 |memory|disk|
-----------------+-------+-------+----+-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+------+----+
Batch_Point_Get_1|8.00   |4      |root|table:in_test, partition:p11,p71,p90,p118|time:2.66ms, loops:2, BatchGet:{num_rpc:4, total_time:6.66ms}, tikv_wall_time: 1.48ms, scan_detail: {total_process_keys: 4, total_process_keys_size: 256, total_keys: 4, get_snapshot_time: 217.9µs, rocksdb: {block: {}}}|handle:[1624923463 1624923463 5837848666 5837848666 6700402571 6700402571 6542259574 6542259574], keep order:false, desc:false|N/A   |N/A |

3. What did you see instead (Required)

id               |estRows|actRows|task|access object                            |execution info                                                                                                                                                                                                                                             |operator info                                                                                                                 |memory|disk|
-----------------+-------+-------+----+-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------+------+----+
Batch_Point_Get_1|8.00   |1      |root|table:in_test, partition:p11,p71,p90,p118|time:918.7µs, loops:2, RU:0.500977, BatchGet:{num_rpc:2, total_time:1.58ms}, tikv_wall_time: 988.5µs, scan_detail: {total_process_keys: 1, total_process_keys_size: 64, total_keys: 4, get_snapshot_time: 617.1µs, rocksdb: {block: {cache_hit_count: 25}}}|handle:[1624923463 1624923463 5837848666 5837848666 6700402571 6700402571 6542259574 6542259574], keep order:false, desc:false|N/A   |N/A |

4. What is your TiDB version? (Required)

7.1.1 / 7.1.0

@wuliLSF wuliLSF added the type/bug The issue is confirmed as a bug. label Sep 8, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Sep 11, 2023
@Defined2014 Defined2014 added affects-7.1 This bug affects the 7.1.x(LTS) versions. and removed may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Sep 11, 2023
@Defined2014
Copy link
Contributor

Caused by #42506

@seiya-annie
Copy link

/found community

1 similar comment
@seiya-annie
Copy link

/found community

@ti-chi-bot ti-chi-bot bot added the report/community The community has encountered this bug. label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. report/community The community has encountered this bug. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants