Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The result of max(time) group by a constant value is wrong #1796

Closed
lilinghai opened this issue Apr 19, 2021 · 1 comment · Fixed by #1821
Closed

The result of max(time) group by a constant value is wrong #1796

lilinghai opened this issue Apr 19, 2021 · 1 comment · Fixed by #1821
Labels
severity/critical type/bug The issue is confirmed as a bug.

Comments

@lilinghai
Copy link

Mini reproduce:

create table t1(a timestamp,b int);
alter table t1 set tiflash replica 1;
insert into t1 values("2018-11-22 16:55:24",1);
insert into t1 values("2018-11-23 00:55:24",1);
select max(a) from t1 group by "a";  -- expect 2018-11-23 00:55:24 ; but got 2018-11-22 16:55:24

TiFlash
Release Version: v5.0.0-nightly-53-g37740f794
Edition: Community
Git Commit Hash: 37740f7
Git Branch: master
UTC Build Time: 2021-04-15 10:16:48
Profile: RELWITHDEBINFO

Raft Proxy
Git Commit Hash: 3bb85b07bb9d9a5da2a3595457c3587183ff36d9
Git Commit Branch: HEAD
UTC Build Time: 2021-04-15 09:56:37
Rust Version: rustc 1.51.0-nightly (bc39d4d9c 2021-01-15)
Storage Engine: tiflash
Prometheus Prefix: tiflash_proxy_
Profile: release

@lilinghai lilinghai added the type/bug The issue is confirmed as a bug. label Apr 19, 2021
@windtalker
Copy link
Contributor

The is triggered by unexpected time_zone cast, the trigger condition is:

  1. TiDB push down a in-consistent type in DAG request(by in-consistent I mean the return type in DAG request is not the same as the running time type of TiFlash, take issue Randgen: block schema mismatch  #1567 for example)
  2. The return column contains a timestamp column and current timezone is not UTC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/critical type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants