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

different result between tikv and tiflash #48332

Closed
aytrack opened this issue Nov 6, 2023 · 1 comment · Fixed by tikv/tikv#16187
Closed

different result between tikv and tiflash #48332

aytrack opened this issue Nov 6, 2023 · 1 comment · Fixed by tikv/tikv#16187
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@aytrack
Copy link
Contributor

aytrack commented Nov 6, 2023

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `UK_PRECISION19237` (
  `COL1` decimal(37,4) DEFAULT NULL COMMENT 'NUMERIC WITH PRECISION',
  `COL2` varchar(20) DEFAULT NULL,
  `COL4` datetime DEFAULT NULL,
  `COL3` bigint(20) DEFAULT NULL,
  `COL5` float DEFAULT NULL,
  UNIQUE KEY `UK_COL1` (`COL1`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
INSERT INTO `UK_PRECISION19237` VALUES (999999999999999999999999999999999.9999,'狪萖秐臾諮羶懝彃惾膁綥繷绿鄟鸚姶圪疪郛釦','8847-09-16 22:32:17',4567224115423045463,5.34134e37);
alter table UK_PRECISION19237 set tiflash replica 1;
set tidb_isolation_read_engines='tikv';
select * from UK_PRECISION19237 where col1 * 766507373740683764182618847769240.9770 != -604793534779049308874387484528661.3368;
set tidb_isolation_read_engines='tiflash';
select * from UK_PRECISION19237 where col1 * 766507373740683764182618847769240.9770 != -604793534779049308874387484528661.3368;

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

have the same result

3. What did you see instead (Required)

[19:48:37]TiDB root:test> set tidb_isolation_read_engines='tikv';
Query OK, 0 rows affected
Time: 0.002s
[19:48:39]TiDB root:test> select * from UK_PRECISION19237 where col1 * 766507373740683764182618847769240.9770 != -604793534779049308874387484528661.3368;
(1105, 'Data Truncated')
[19:48:49]TiDB root:test> alter table UK_PRECISION19237 set tiflash replica 1;
Query OK, 0 rows affected
Time: 0.284s
[19:48:51]TiDB root:test> set tidb_isolation_read_engines='tiflash';
Query OK, 0 rows affected
Time: 0.001s
[19:48:52]TiDB root:test> select * from UK_PRECISION19237 where col1 * 766507373740683764182618847769240.9770 != -604793534779049308874387484528661.3368;
+----------------------------------------+------------------------------------------+---------------------+---------------------+-------------+
| COL1                                   | COL2                                     | COL4                | COL3                | COL5        |
+----------------------------------------+------------------------------------------+---------------------+---------------------+-------------+
| 999999999999999999999999999999999.9999 | 狪萖秐臾諮羶懝彃惾膁綥繷绿鄟鸚姶圪疪郛釦 | 8847-09-16 22:32:17 | 4567224115423045463 | 5.34134e+37 |
+----------------------------------------+------------------------------------------+---------------------+---------------------+-------------+
1 row in set
Time: 0.140s
[19:48:52]TiDB root:test>

4. What is your TiDB version? (Required)

master
v7.5.0
v7.1.2

@aytrack aytrack added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/major labels Nov 6, 2023
@ti-chi-bot ti-chi-bot bot added may-affects-5.3 This bug maybe affects 5.3.x versions. 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 labels Nov 6, 2023
@aytrack aytrack added affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. and removed may-affects-5.3 This bug maybe affects 5.3.x versions. 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 labels Nov 6, 2023
ti-chi-bot bot pushed a commit to tikv/tikv that referenced this issue Jan 3, 2024
…in arithmetic operators (#16187)

close #16268, close pingcap/tidb#48332

omit truncating error when handling decimal multiplication in arithmetic operators

Signed-off-by: TONG, Zhigao <[email protected]>

Co-authored-by: Liqi Geng <[email protected]>
@solotzg
Copy link
Contributor

solotzg commented Jan 4, 2024

Duplicated with tikv/tikv#16268. Close this issue.

@XuHuaiyu XuHuaiyu closed this as completed Jan 4, 2024
pingandb pushed a commit to pingandb/tikv that referenced this issue Jan 18, 2024
…in arithmetic operators (tikv#16187)

close tikv#16268, close pingcap/tidb#48332

omit truncating error when handling decimal multiplication in arithmetic operators

Signed-off-by: TONG, Zhigao <[email protected]>

Co-authored-by: Liqi Geng <[email protected]>
Signed-off-by: pingandb <[email protected]>
ti-chi-bot bot pushed a commit to tikv/tikv that referenced this issue Jan 25, 2024
…in arithmetic operators (#16187) (#16275)

close #16268, close pingcap/tidb#48332

omit truncating error when handling decimal multiplication in arithmetic operators

Signed-off-by: TONG, Zhigao <[email protected]>

Co-authored-by: TONG, Zhigao <[email protected]>
Co-authored-by: tonyxuqqi <[email protected]>
ti-chi-bot bot added a commit to tikv/tikv that referenced this issue Feb 4, 2024
…in arithmetic operators (#16187) (#16277)

close #16268, close pingcap/tidb#48332

omit truncating error when handling decimal multiplication in arithmetic operators

Signed-off-by: TONG, Zhigao <[email protected]>

Co-authored-by: TONG, Zhigao <[email protected]>
Co-authored-by: tonyxuqqi <[email protected]>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
ti-chi-bot bot added a commit to tikv/tikv that referenced this issue Feb 27, 2024
…in arithmetic operators (#16187) (#16276)

close #16268, close pingcap/tidb#48332

omit truncating error when handling decimal multiplication in arithmetic operators

Co-authored-by: tonyxuqqi <[email protected]>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
3 participants