pingcap / pingcap/tidb

Inconsistent results while executing same query on table having different partition strategy.

Open
#65,662 2 comments 0 reactions 0 assignees View on GitHub
component/tablepartition contribution may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major sig/sql-infra type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)
```sql
create table t004(a date);
delete from t004 where t004.a limit 2005316159;

replace into t004 values (null), (2063014959);
alter table t004 add primary key(a);
alter table t004 modify a tinyint;
alter table t004 order by a desc;

create table t004_oracle(a date) partition by list columns(a) ( partition pmax values in (default));
delete from t004_oracle where t004_oracle.a limit 2005316159;

replace into t004_oracle values (null), (2063014959);
alter table t004_oracle modify a tinyint;
alter table t004_oracle order by a desc;

select t004.a from t004 where 0.057279176242997165;
select t004_oracle.a from t004_oracle where 0.057279176242997165;
```

### 2. What did you expect to see? (Required)
Two queries return same results.

### 3. What did you see instead (Required)
```sql
mysql> select t004.a from t004 where 0.057279176242997165;
+------+
| a |
+------+
| NULL |
| 0 |
+------+
2 rows in set (0.00 sec)

mysql> select t004_oracle.a from t004_oracle where 0.057279176242997165;
+------------+
| a |
+------------+
| NULL |
| 0000-00-00 |
+------------+
2 rows in set (0.00 sec)
```

### 4. What is your TiDB version? (Required)
8.0.11-TiDB-v9.0.0-beta.1.pre-640-g24903d6b24

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.