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

TiDB using TiUP doesn't return an error for max allow packet overflow #34864

Closed
espresso98 opened this issue May 20, 2022 · 4 comments
Closed
Labels
may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. 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.0 may-affects-6.1 severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@espresso98
Copy link
Collaborator

espresso98 commented May 20, 2022

Bug Report

1. Minimal reproduce step

DROP TABLE IF EXISTS t3;
set @max_allowed_packet=@@global.max_allowed_packet;
set @net_buffer_length=@@global.net_buffer_length;
CREATE TABLE t3 (c31 INT NOT NULL, c32 LONGTEXT,
                 PRIMARY KEY (c31)) charset latin1;
INSERT INTO t3 VALUES(100,'a');
INSERT INTO t3 VALUES(111,'abcd');
INSERT INTO t3 VALUES(122,'b');
UPDATE t3 SET c32= CONCAT(c32, REPEAT('a', @max_allowed_packet-1)); 
SELECT c31, LENGTH(c32) FROM t3;
DROP TABLE t3;

2. What did you expect to see?

mysql> UPDATE t3 SET c32= CONCAT(c32, REPEAT('a', @max_allowed_packet-1)); 
SELECT c31, LENGTH(c32) FROM t3;
DROP TABLE t3;
ERROR 1301 (HY000): Result of concat() was larger than max_allowed_packet (67108864) - truncated
mysql> SELECT c31, LENGTH(c32) FROM t3;
+-----+-------------+
| c31 | LENGTH(c32) |
+-----+-------------+
| 100 |           1 |
| 111 |           4 |
| 122 |           1 |
+-----+-------------+
3 rows in set (0.00 sec)

3. What did you see instead

tidb> UPDATE t3 SET c32= CONCAT(c32, REPEAT('a', @max_allowed_packet-1)); 
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0

tidb> SELECT c31, LENGTH(c32) FROM t3;
+-----+-------------+
| c31 | LENGTH(c32) |
+-----+-------------+
| 100 |        NULL |
| 111 |        NULL |
| 122 |        NULL |
+-----+-------------+
3 rows in set (0.00 sec)

4. What is your TiDB version?

tidb_version(): Release Version: v6.0.0
Edition: Community
Git Commit Hash: 36a9810441ca0e496cbd22064af274b3be771081
Git Branch: heads/refs/tags/v6.0.0
UTC Build Time: 2022-03-31 10:27:58
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
@espresso98 espresso98 added the type/bug The issue is confirmed as a bug. label May 20, 2022
@espresso98 espresso98 changed the title TiDB with TiUP doesn't return an error for max allow packet TiDB using TiUP doesn't return an error for max allow packet overflow May 20, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. 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.0 may-affects-6.1 labels May 23, 2022
@zanmato1984
Copy link
Contributor

I ran the case in my local, in one mysql client (interactive mode, so all the statements are in the same session. The result is as expected.

Were you running those statements in separate sessions? (So that set @max_allowed_packet=@@global.max_allowed_packet; won't affect the subsequent statements.)

@espresso98

@zanmato1984
Copy link
Contributor

I'm lowering the severity to minor before further information is supplied.

@morgo
Copy link
Contributor

morgo commented May 24, 2022

I believe this was fixed in #33651

Note that to get this test case to work correctly, you will need to modify your tidb.toml configuration file to change the txn-entry-size-limit to greater than 64M (the default for max-allowed-packet).

It is scheduled to be cherry picked to 6.0, but has not happened yet.. but because it's fixed in master I believe we can close this issue.

@zanmato1984
Copy link
Contributor

Thank you @morgo . Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. 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.0 may-affects-6.1 severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants