Skip to content

Wrong default value behavior in disaggregated mode #9084

@breezewish

Description

@breezewish

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

tiup playground:nightly nightly --mode=tidb-cse
mysql> create table c(a int);
Query OK, 0 rows affected (0.06 sec)

mysql> insert into c values (1);
Query OK, 1 row affected (0.00 sec)

mysql> alter table c set tiflash replica 1;
Query OK, 0 rows affected (0.04 sec)

mysql> select * from information_schema.tiflash_replica;
+--------------+------------+----------+---------------+-----------------+-----------+----------+
| TABLE_SCHEMA | TABLE_NAME | TABLE_ID | REPLICA_COUNT | LOCATION_LABELS | AVAILABLE | PROGRESS |
+--------------+------------+----------+---------------+-----------------+-----------+----------+
| test         | c          |      104 |             1 |                 |         1 |        1 |
+--------------+------------+----------+---------------+-----------------+-----------+----------+
1 row in set (0.00 sec)

mysql> alter table c add column test_c1 int default 0;
Query OK, 0 rows affected (0.10 sec)

mysql> set @@tidb_isolation_read_engines="tidb,tiflash";
Query OK, 0 rows affected (0.00 sec)

mysql> select count(*) from c where test_c1 = 0;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.04 sec)

mysql> select count(*) from c where test_c1 is null;
+----------+
| count(*) |
+----------+
|        1 |
+----------+
1 row in set (0.01 sec)

mysql> set @@tidb_isolation_read_engines="tidb,tikv";
Query OK, 0 rows affected (0.00 sec)

mysql> select count(*) from c where test_c1 = 0;
+----------+
| count(*) |
+----------+
|        1 |
+----------+
1 row in set (0.01 sec)

mysql> select count(*) from c where test_c1 is null;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.01 sec)

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

TiFlash and TiKV should produce same result.

3. What did you see instead (Required)

4. What is your TiFlash version? (Required)

nightly

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/criticaltype/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