8000 Wrong result in Tiflash when processing timestamp · Issue #57653 · pingcap/tidb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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 in Tiflash when processing timestamp #57653

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

Wrong result in Tiflash when processing timestamp #57653

Dylan0222 opened this issue Nov 23, 2024 · 2 comments
Labels
affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. impact/inconsistency incorrect/inconsistency/inconsistent may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@Dylan0222
Copy link
Dylan0222 commented Nov 23, 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 (
    c0 TIMESTAMP, 
    c1 DOUBLE, 
    c2 TIMESTAMP AS (c0) VIRTUAL NOT NULL, 
    c3 INT UNSIGNED NOT NULL, 
    c4 VARCHAR(255), 
    c5 JSON, 
    PRIMARY KEY (c3), 
    UNIQUE INDEX idx1 (c2, c0),
    INDEX idx2 (c4)
);

ALTER TABLE t1 SET TIFLASH REPLICA 1;
INSERT IGNORE INTO t1(c1, c3, c4, c5) 
VALUES 
    (-10.0, 2900, 'example', '{"key": "value"}'),
    (232.0, 3921, 'test', '{"key": "test"}'),
    (12222.0, 2123, 'demo', '{"key": "demo"}');

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(tikv[t1]) */ c0
    -> FROM t1
    -> WHERE c1 = -10 and c2 IS NOT NULL or JSON_UNQUOTE(JSON_EXTRACT(c5, '$.key')) = 'value';
+---------------------+
| c0                  |
+---------------------+
| 0000-00-00 00:00:00 |
+---------------------+
1 row in set (0.05 sec)

mysql> SELECT /*+ READ_FROM_STORAGE(tiflash[t1]) */ c0
    -> FROM t1
    -> WHERE c1 = -10 and c2 IS NOT NULL or JSON_UNQUOTE(JSON_EXTRACT(c5, '$.key')) = 'value';
+------+
| c0   |
+------+
| NULL |
+------+
1 row in set (0.05 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 23, 2024
@Dylan0222
Copy link
Author

/label affects-8.4
/label affects-8.5

@ti-chi-bot ti-chi-bot bot added affects-8.4 affects-8.5 This bug affects the 8.5.x(LTS) versions. labels Nov 23, 2024
@jebter jebter added sig/execution SIG execution severity/major impact/inconsistency incorrect/inconsistency/inconsistent labels Nov 26, 2024
@yibin87
Copy link
Contributor
yibin87 commented Nov 27, 2024

It's strange for the following queries from tikv storage.

mysql> select c0 is null from t1;
+------------+
| c0 is null |
+------------+
|          1 |
|          1 |
|          1 |
+------------+
3 rows in set (0.00 sec)

mysql> select c0 from t1;
+---------------------+
| c0                  |
+---------------------+
| 0000-00-00 00:00:00 |
| 0000-00-00 00:00:00 |
| 0000-00-00 00:00:00 |
+---------------------+
3 rows in set (0.00 sec)

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. impact/inconsistency incorrect/inconsistency/inconsistent may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants
0