pingcap / pingcap/tidb

Incorrect unix_timestamp result when utc time can be mapped to multi time in one zone

Open
#59,340 1 comment 0 reactions 0 assignees View on GitHub
impact/wrong-result may-affects-5.4 may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major sig/execution 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
set time_zone="Europe/Vilnius";
select unix_timestamp("2020-10-25 3:45");
```

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

```
mysql> select unix_timestamp("2020-10-25 3:45");
+-----------------------------------+
| unix_timestamp("2020-10-25 3:45") |
+-----------------------------------+
| 1603586700 |
+-----------------------------------+
```

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

```
mysql> select unix_timestamp("2020-10-25 3:45");
+-----------------------------------+
| unix_timestamp("2020-10-25 3:45") |
+-----------------------------------+
| 1603590300 |
+-----------------------------------+
```

Returned time should be another mapped time.

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

nightly(fc8bdb54c60)

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.