Skip to content

Disaggrate TiFlash query result is wrong when query missing columns with default value #9085

@Lloyd-Pottiger

Description

@Lloyd-Pottiger

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
CREATE TABLE `relationships` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id2` int(11) NOT NULL,
  PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci AUTO_INCREMENT=90001;
insert into relationships (id2) values (1), (2), (3);
insert into relationships (id2) select id2 from relationships;
insert into relationships (id2) select id2 from relationships;
insert into relationships (id2) select id2 from relationships;
insert into relationships (id2) select id2 from relationships;
insert into relationships (id2) select id2 from relationships;
insert into relationships (id2) select id2 from relationships;
alter table relationships set tiflash replica 1;
alter table relationships add column weight int default '0';
select * from information_schema.tiflash_replica where TABLE_NAME = 'relationships';
set @@tidb_isolation_read_engines='tiflash'; select count(*) from relationships where weight = 0;

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

set @@tidb_isolation_read_engines='tiflash'; select count(*) from relationships where weight = 0;
+----------+
| count(*) |
+----------+
|      192 |
+----------+

3. What did you see instead (Required)

set @@tidb_isolation_read_engines='tiflash'; select count(*) from relationships where weight = 0;
+----------+
| count(*) |
+----------+
|      0 |
+----------+

4. What is your TiFlash version? (Required)

master

Metadata

Metadata

Labels

affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.severity/majortype/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