Skip to content

parallel apply got wrong result when there are multiple columns as primary key #51372

@guo-shaoge

Description

@guo-shaoge

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  drop table if exists t1;
  create table t1 (c1 bigint, c2 int, c3 int, c4 int, primary key(c1, c2), index (c3));
  insert into t1 values(1, 1, 1, 1), (1, 2, 3, 3), (2, 1, 4, 4), (2, 2, 2, 2);

  set @@tidb_enable_parallel_apply = off;
  select (select /*+ NO_DECORRELATE() */ sum(c4) from t1 where t1.c3 = alias.c3) from t1 alias where alias.c1 = 1;

  set @@tidb_enable_parallel_apply = on;
  select (select /*+ NO_DECORRELATE() */ sum(c4) from t1 where t1.c3 = alias.c3) from t1 alias where alias.c1 = 1;

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

Results are same for parallel apply and serial apply.

3. What did you see instead (Required)

Results are different

image

4. What is your TiDB version? (Required)

v7.5.0

Metadata

Metadata

Assignees

Labels

affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.report/customerCustomers have encountered this bug.severity/criticalsig/executionSIG executiontype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions