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 when process Time #9657

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

Wrong Result from Tiflash when process Time #9657

Dylan0222 opened this issue Nov 20, 2024 · 3 comments
Labels
affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/compute severity/moderate type/bug The issue is confirmed as a bug.

Comments

@Dylan0222
Copy link

Dylan0222 commented Nov 20, 2024

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 TIME DEFAULT NULL
);

insert into t1 values(1, '838:59:59');
insert into t1 values(2, '-838:59:59');
insert into t1 values(3, '0');
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]) */
    ->     id,
    ->     col1,
    ->     ADDDATE(col1, INTERVAL 12 HOUR_MINUTE) AS updated_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 NOT NULL;
+----+------------+--------------+--------------+-------------+----------------------+
| id | col1       | updated_col1 | value_status | col1_length | processed_value      |
+----+------------+--------------+--------------+-------------+----------------------+
|  1 | 838:59:59  | 839:09:59    | VALID VALUE  |           9 | 839:11:59 processed  |
|  2 | -838:59:59 | -838:49:59   | VALID VALUE  |          10 | -838:47:59 processed |
|  3 | 00:00:00   | 00:10:00     | VALID VALUE  |           8 | 00:12:00 processed   |
+----+------------+--------------+--------------+-------------+----------------------+
3 rows in set (0.04 sec)

mysql> SELECT /*+ READ_FROM_STORAGE(TIKV[t1]) */
    ->     id,
    ->     col1,
    ->     ADDDATE(col1, INTERVAL 12 HOUR_MINUTE) AS updated_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 NOT NULL;
+----+------------+--------------+--------------+-------------+----------------------+
| id | col1       | updated_col1 | value_status | col1_length | processed_value      |
+----+------------+--------------+--------------+-------------+----------------------+
|  2 | -838:59:59 | -838:47:59   | VALID VALUE  |          10 | -838:47:59 processed |
|  3 | 00:00:00   | 00:12:00     | VALID VALUE  |           8 | 00:12:00 processed   |
+----+------------+--------------+--------------+-------------+----------------------+
2 rows in set, 1 warning (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 Dylan0222 changed the title Wrong Result from Tiflash when process Wrong Result from Tiflash when process Time Nov 20, 2024
@Dylan0222
Copy link
Author

/label affects-8.5

@ti-chi-bot ti-chi-bot bot added the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Nov 20, 2024
@Dylan0222
Copy link
Author

/label affects-8.4

@Dylan0222
Copy link
Author

I have found some additional bugs in TiFlash, which have been submitted in the TiDB repository. Could you please help check them as well? Thanks a lot, @JaySon-Huang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. component/compute severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants