Skip to content

Incorrect result of floor function #10365

@ChangRui-Ryan

Description

@ChangRui-Ryan

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(id int, a decimal(15,0), b decimal(52,30));
alter table t set tiflash replica 1;
insert into t values(1,78,144.00000000000000000000000000000000000000000000000000000000);
set tidb_isolation_read_engines='tidb,tiflash';
select floor(a*b), a*b from t;

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

mysql> set tidb_isolation_read_engines='tidb,tikv';
Query OK, 0 rows affected (0.02 sec)
mysql> select floor(a*b), a*b from t;
+------------+--------------------------------------+
| floor(a*b) | a*b                                  |
+------------+--------------------------------------+
|      11232 | 11232.000000000000000000000000000000 |
+------------+--------------------------------------+
1 row in set (0.02 sec)

3. What did you see instead (Required)

mysql> set tidb_isolation_read_engines='tidb,tiflash';
Query OK, 0 rows affected (0.01 sec)
mysql> select floor(a*b), a*b from t;
+------------+--------------------------------------+
| floor(a*b) | a*b                                  |
+------------+--------------------------------------+
|      11231 | 11232.000000000000000000000000000000 |
+------------+--------------------------------------+
1 row in set (0.03 sec)

4. What is your TiFlash version? (Required)

8.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-5.4This bug affects the 5.4.x(LTS) versions.affects-6.1This bug affects the 6.1.x(LTS) versions.affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.component/computeimpact/wrong-resultseverity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions