Skip to content

format throw data truncated error #4891

@windtalker

Description

@windtalker

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> create table format_test(id int, value decimal(7,4));
Query OK, 0 rows affected (0.09 sec)

mysql> insert into format_test values(1,999.9999);
Query OK, 1 row affected (0.02 sec)

mysql> select format(value,0) from format_test;
+-----------------+
| format(value,0) |
+-----------------+
| 1,000           |
+-----------------+
1 row in set (0.00 sec)

mysql> alter table format_test set tiflash replica 1;
Query OK, 0 rows affected (0.09 sec)
mysql> set tidb_enforce_mpp=1;
Query OK, 0 rows affected (0.00 sec)

mysql> explain select format(value,0) from format_test;
+---------------------------+----------+--------------+-------------------+---------------------------------------------+
| id                        | estRows  | task         | access object     | operator info                               |
+---------------------------+----------+--------------+-------------------+---------------------------------------------+
| TableReader_11            | 10000.00 | root         |                   | data:ExchangeSender_10                      |
| └─ExchangeSender_10       | 10000.00 | mpp[tiflash] |                   | ExchangeType: PassThrough                   |
|   └─Projection_4          | 10000.00 | mpp[tiflash] |                   | format(test.format_test.value, 0)->Column#4 |
|     └─TableFullScan_9     | 10000.00 | mpp[tiflash] | table:format_test | keep order:false, stats:pseudo              |
+---------------------------+----------+--------------+-------------------+---------------------------------------------+
4 rows in set (0.00 sec)

mysql>  select format(value,0) from format_test;
ERROR 1105 (HY000): other error for mpp stream: DB::TiFlashException: Data truncated

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

mysql> select format(value,0) from format_test;
+-----------------+
| format(value,0) |
+-----------------+
| 1,000           |
+-----------------+

3. What did you see instead (Required)

mysql>  select format(value,0) from format_test;
ERROR 1105 (HY000): other error for mpp stream: DB::TiFlashException: Data truncated

4. What is your TiFlash version? (Required)

master @ b8e58eb

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions