pingcap / pingcap/tiflash

FROM_UNIXTIME parameter range is inconsistent on tidb and tiflash

Open
#6,023 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

affects-6.4 affects-6.5 affects-6.6 affects-7.0 affects-7.1 affects-7.5 affects-8.1 component/compute may-affects-4.0 may-affects-5.0 may-affects-5.1 may-affects-5.2 may-affects-5.3 may-affects-5.4 may-affects-6.0 may-affects-6.1 may-affects-6.2 may-affects-6.3 severity/major type/bug
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)
> create table tfrom_unixtime(tchar varchar(40));
> ALTER table tfrom_unixtime SET tiflash replica 1;
> insert into tfrom_unixtime values("32536771199.1");
> SELECT FROM_UNIXTIME(tchar) from tfrom_unixtime ;
+----------------------+
| FROM_UNIXTIME(tchar) |
+----------------------+
| NULL                 |
+----------------------+
> set @@tidb_allow_mpp=0; set @@tidb_enforce_mpp=0 ;
> SELECT FROM_UNIXTIME(tchar) from tfrom_unixtime ;
+----------------------------+
| FROM_UNIXTIME(tchar)       |
+----------------------------+
| 3001-01-19 07:59:59.100000 |
+----------------------------+
1 row in set (0.03 sec)
2. What did you expect to see? (Required)

The results of tidb and tiflash should be same

+----------------------------+
| FROM_UNIXTIME(tchar)       |
+----------------------------+
| 3001-01-19 07:59:59.100000 |
+----------------------------+
3. What did you see instead (Required)

tiflash:

> SELECT FROM_UNIXTIME(tchar) from tfrom_unixtime ;
+----------------------+
| FROM_UNIXTIME(tchar) |
+----------------------+
| NULL                 |
+----------------------+

tidb:

> SELECT FROM_UNIXTIME(tchar) from tfrom_unixtime ;
+----------------------------+
| FROM_UNIXTIME(tchar)       |
+----------------------------+
| 3001-01-19 07:59:59.100000 |
+----------------------------+
4. What is your TiFlash version? (Required)
TiFlash
Release Version: v6.2.0-alpha-353-gf8ab1f1-dirty
Edition:         Community
Git Commit Hash: f8ab1f179d3273b579520e528ceecdcb79b76d5f
Git Branch:      master
UTC Build Time:  2022-09-15 02:26:04
Enable Features: jemalloc failpoints avx avx512 unwind
Profile:         DEBUG

Raft Proxy
Git Commit Hash:   91c7f1ec241f1e40b76c55c1cde70b048adc4a2f
Git Commit Branch: HEAD
UTC Build Time:    2022-09-15 01:35:32
Rust Version:      rustc 1.60.0-nightly (1e12aef3f 2022-02-13)
Storage Engine:    tiflash
Prometheus Prefix: tiflash_proxy_
Profile:           release

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the FROM_UNIXTIME query with the provided table and value, comparing the TiFlash/MPP result with the TiDB result when MPP is disabled. Trace the two execution paths and verify completion when both return 3001-01-19 07:59:59.100000 instead of NULL.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.