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

[tpcc] "Data Truncated" error from delivery.c #14

Closed
george24601 opened this issue Jul 31, 2017 · 2 comments
Closed

[tpcc] "Data Truncated" error from delivery.c #14

george24601 opened this issue Jul 31, 2017 · 2 comments

Comments

@george24601
Copy link

george24601 commented Jul 31, 2017

I got MySQL error code 1265, "Data Truncated" error when running tpcc.

Direct cause is the precision of ol_total in delivery.c.

I tried tpcc-mysql and got the same problem. I modified that line in delivery.c to bypass this problem.

Environment:
mysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper
mysql_config 5.7.19
tikv commit hash: e2d2867140cd84c3fa9dcbb10b72b33e1d586f5e
tidb commit hash: 488365285a0a6a843b3d53c8bf6a196609214fc1
pd commit hash: e28329cf7eb86f47161f682b506837a1b4e71da5
OS: CentOS Linux release 7.3.1611 (Core)

@george24601
Copy link
Author

I modified delivery.c to bypass this problem. However, it would be good to know if the issue is caused by tidb itself

@nanne007
Copy link

Same problem here.
There is a difference between mysql and tidb on the update statement.

behavior of mysql

mysql> desc decimals;
+-------+---------------+------+-----+---------+-------+
| Field | Type          | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| a     | decimal(20,0) | NO   |     | NULL    |       |
+-------+---------------+------+-----+---------+-------+
1 row in set (0.06 sec)

mysql> select * from decimals;
+-----+
| a   |
+-----+
| 201 |
+-----+
1 row in set (0.00 sec)

mysql> update decimals set a = a + 1.23;
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

mysql> select * from decimals;
+-----+
| a   |
+-----+
| 202 |
+-----+
1 row in set (0.00 sec)

behavior of tidb

mysql> desc decimals;
+-------+-------------+------+------+---------+-------+
| Field | Type        | Null | Key  | Default | Extra |
+-------+-------------+------+------+---------+-------+
| a     | decimal(20) | NO   |      | NULL    |       |
+-------+-------------+------+------+---------+-------+
1 row in set (0.00 sec)

mysql> select * from decimals;
+-----+
| a   |
+-----+
| 201 |
+-----+
1 row in set (0.00 sec)

mysql> update decimals set a = a + 1.23;
ERROR 1265 (01000): Data Truncated
mysql> select * from decimals;
+-----+
| a   |
+-----+
| 201 |
+-----+
1 row in set (0.00 sec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants