pingcap / pingcap/tidb

DDL reorg does not respect @@timestamp variable

Open
#56,066 0 comments 0 reactions 0 assignees View on GitHub
component/ddl severity/moderate 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)

```
> set @@time_zone='UTC';
> create table t(a int);
> insert into t values(NULL);
> set @@timestamp=36000;
> alter table t modify column a timestamp not null;
> select a from t;
```

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

In MySQL:

```
mysql> select a from t;
+---------------------+
| a |
+---------------------+
| 1970-01-01 10:00:00 |
+---------------------+
```

### 3. What did you see instead (Required)

In TiDB, it still use the system time ignoring the `@@timestamp`

```
> select a from t;
+---------------------+
| a |
+---------------------+
| 2024-09-13 12:42:49 |
+---------------------+
```

### 4. What is your TiDB version? (Required)

```
t> select tidb_version();
+-----------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------+
| Release Version: v8.2.0 |
| Edition: Community |
| Git Commit Hash: 821e491a20fbab36604b36b647b5bae26a2c1418 |
| Git Branch: HEAD |
| UTC Build Time: 2024-07-05 09:16:37 |
| GoVersion: go1.21.10 |
| Race Enabled: false |
| Check Table Before Drop: false |
| Store: tikv |
+-----------------------------------------------------------+
```

But I think it affects all versions of tidb

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.