Skip to content

After adding a column with a default value, querying the value of this column will yield an error result in disaggregated mode #9665

@zimulala

Description

@zimulala

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
create table t(a int, c int);
insert into t values(1, 1), (2, 2), (3, 3);
alter table t set tiflash replica 1;
set session tidb_isolation_read_engines='tiflash';
select * from INFORMATION_SCHEMA.TIFLASH_REPLICA where TABLE_NAME='t';

Wait until PROGRESS's value is 1.

 alter table t add column col1 int default 30; 
 alter table t add column col2 year not null;
 alter table t add column col3 decimal(6,2) not null;
 alter table t add column col4 decimal(6,2) default "1.234";
 alter table t add column col5 int default 123;
 alter table t add column col6 varchar(255) default 'sss';
 alter table t add column col7 timestamp default '2017-02-11';
 alter table t add column col8 datetime default '2018-11-04 23:12:03';
 alter table t add column col9 year default '2012';
 alter table t add column col10 set('value1', 'value2', 'value3') default 'value3';
 alter table t add column col11 enum('value1', 'value2', 'value3') default 'value1';
 alter table t add column col12 datetime default '2018-11-04 23:12:03';
 alter table t add column col13 time default  '2017-02-23 12:18:30';
 alter table t add column col14 time default null;
set session tidb_isolation_read_engines='tiflash'; select col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11, col12, col13, col14, hex(col15) from test.t;

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

+------+------+------+------+------+------+---------------------+---------------------+------+--------+--------+---------------------+----------+-------+------------+
| col1 | col2 | col3 | col4 | col5 | col6 | col7                | col8                | col9 | col10  | col11  | col12               | col13    | col14 | hex(col15) |
+------+------+------+------+------+------+---------------------+---------------------+------+--------+--------+---------------------+----------+-------+------------+
|   30 | 0000 | 0.00 | 1.23 |  123 | sss  | 2017-02-11 00:00:00 | 2018-11-04 23:12:03 | 2012 | value3 | value1 | 2018-11-04 23:12:03 | 12:18:30 | NULL  | 10203      |
|   30 | 0000 | 0.00 | 1.23 |  123 | sss  | 2017-02-11 00:00:00 | 2018-11-04 23:12:03 | 2012 | value3 | value1 | 2018-11-04 23:12:03 | 12:18:30 | NULL  | 10203      |
|   30 | 0000 | 0.00 | 1.23 |  123 | sss  | 2017-02-11 00:00:00 | 2018-11-04 23:12:03 | 2012 | value3 | value1 | 2018-11-04 23:12:03 | 12:18:30 | NULL  | 10203      |
+------+------+------+------+------+------+---------------------+---------------------+------+--------+--------+---------------------+----------+-------+------------+

3. What did you see instead (Required)

+------+------+------+------+------+-------+------+------+------+-------+-------+-------+----------+----------+-------+
| col1 | col2 | col3 | col4 | col5 | col6  | col7 | col8 | col9 | col10 | col11 | col12 | col13    | col14    |col15 |
+------+------+------+------+------+-------+------+------+------+-------+-------+-------+----------+----------+-------+
|    0 | 0000 | 0.00 | 0.00 |    0 | sss | NULL | NULL | 0000 |       |       | NULL  | 00:00:00 | 00:00:00 | NULL  |
|    0 | 0000 | 0.00 | 0.00 |    0 | sss | NULL | NULL | 0000 |       |       | NULL  | 00:00:00 | 00:00:00 | NULL  |
|    0 | 0000 | 0.00 | 0.00 |    0 | sss | NULL | NULL | 0000 |       |       | NULL  | 00:00:00 | 00:00:00 | NULL  |
+------+------+------+------+------+-------+------+------+------+-------+-------+-------+----------+----------+-------+

4. What is your TiFlash version? (Required)

master

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.component/storageseverity/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