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

Wrong Result from Tiflash in processing timestamp #57527

Open
Dylan0222 opened this issue Nov 20, 2024 · 2 comments
Open

Wrong Result from Tiflash in processing timestamp #57527

Dylan0222 opened this issue Nov 20, 2024 · 2 comments
Labels

Comments

@Dylan0222
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Drop table if exists t1;
CREATE TABLE t1 (
    id INT PRIMARY KEY AUTO_INCREMENT,
    col1 timestamp DEFAULT NULL
);

ALTER TABLE t1 SET TIFLASH REPLICA 1;

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

I find that the returned information is inconsistent across two queries.

3. What did you see instead (Required)

mysql> SELECT /*+ READ_FROM_STORAGE(TIFLASH[t1])*/
    ->     col1,
    ->     ADDDATE(col1, INTERVAL 12 HOUR_MINUTE) AS modified_col1,
    ->     CASE
    ->         WHEN ADDDATE(col1, INTERVAL 12 HOUR_MINUTE) IS NULL THEN 'NULL VALUE'
    ->         ELSE 'VALID VALUE'
    ->     END AS value_status,
    ->     LENGTH(col1) AS col1_length,
    ->     CONCAT(ADDDATE(col1, INTERVAL 12 HOUR_MINUTE), ' processed') AS processed_value
    -> FROM t1
    -> WHERE
    ->     ADDDATE(col1, INTERVAL 12 HOUR_MINUTE) IS NULL
    ->     OR LENGTH(col1) > 5;
ERROR 1105 (HY000): other error for mpp stream: Code: 0, e.displayText() = DB::TiFlashException: date_add function does not support unit HOUR_MINUTE yet., e.what() = DB::TiFlashException,


mysql> SELECT /*+ READ_FROM_STORAGE(TIKV[t1])*/
    ->     col1,
    ->     ADDDATE(col1, INTERVAL 12 HOUR_MINUTE) AS modified_col1,
    ->     CASE
    ->         WHEN ADDDATE(col1, INTERVAL 12 HOUR_MINUTE) IS NULL THEN 'NULL VALUE'
    ->         ELSE 'VALID VALUE'
    ->     END AS value_status,
    ->     LENGTH(col1) AS col1_length,
    ->     CONCAT(ADDDATE(col1, INTERVAL 12 HOUR_MINUTE), ' processed') AS processed_value
    -> FROM t1
    -> WHERE
    ->     ADDDATE(col1, INTERVAL 12 HOUR_MINUTE) IS NULL
    ->     OR LENGTH(col1) > 5;
Empty set (0.04 sec)

4. What is your TiDB version? (Required)

TiDB v8.4.0

@Dylan0222 Dylan0222 added the type/bug The issue is confirmed as a bug. label Nov 20, 2024
@Dylan0222
Copy link
Author

/label affects-8.4

@Dylan0222
Copy link
Author

/label affects-8.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants