pingcap / pingcap/tiflash

expression: from_days' behavior is different than mysql and tidb.

Open
#4,934 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component/compute severity/moderate type/bug
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Bug Report

days mysql tidb tiflash
<=365 ZERO_DATE ZERO_DATE ZERO_DATE
[366, 3652424] [0001-01-01, 9999-12-31] [0001-01-01, 9999-12-31] [0001-01-01, 9999-12-31]
[3652425, 3652499] Null [10000-01-01, 10000-03-15] Null
>=3652500 ZERO_DATE ZERO_DATE Null

note that tiflash's fromDays receive an int32 parameter, so it may truncate big integer.

What is your TiFlash version? (Required)

6.1+

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 locating the expression implementation for from_days and the TiFlash fromDays entry point, then compare its results with the MySQL and TiDB ranges shown in the report. Clarify which reference behavior is expected, including the int32 truncation concern, and consider the issue done when the selected compatibility behavior is verified across all listed ranges.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, mysql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.