Bug #10555 SET net_buffer_length=4096000; silently cuts the values
Submitted: 11 May 2005 13:47 Modified: 11 May 2005 17:43
Reporter: Martin Mokrejs Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.11 OS:Linux (linux-2.6.11.6)
Assigned to: CPU Architecture:Any

[11 May 2005 13:47] Martin Mokrejs
Description:
I'm facing a problem with the 

Traceback (most recent call last):
  File "test20.py", line 51, in ?
    _c.query("SELECT sha1, md5, size, sequence_id, sequence_string FROM sequence WHERE sequence_id = 79")
_mysql_exceptions.OperationalError: (2020, "Got packet bigger than 'max_allowed_packet' bytes")

I can issue the SELECT interactively and it works - return data. But the very same command does not return anything through the _mysql module wrapped by mysqldb.
Anyway, what I report here mainly is that I cannot set net_buffer_length variable over a certain limit. I use 4.1.11 official gcc binaries on 2.6.11.6 linux.

mysql> set net_buffer_length=4096;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@net_buffer_length;
+---------------------+
| @@net_buffer_length |
+---------------------+
|                4096 |
+---------------------+
1 row in set (0.00 sec)

mysql> set net_buffer_length=40960;
Query OK, 0 rows affected (0.01 sec)

mysql> select @@net_buffer_length;
+---------------------+
| @@net_buffer_length |
+---------------------+
|               40960 |
+---------------------+
1 row in set (0.00 sec)

mysql> set net_buffer_length=409600;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@net_buffer_length;
+---------------------+
| @@net_buffer_length |
+---------------------+
|              409600 |
+---------------------+
1 row in set (0.00 sec)

mysql> set net_buffer_length=4096000;
Query OK, 0 rows affected (0.01 sec)

mysql> select @@net_buffer_length;
+---------------------+
| @@net_buffer_length |
+---------------------+
|             1048576 |
+---------------------+
1 row in set (0.00 sec)

mysql> 

How to repeat:
mysql> select @@max_allowed_packet;
+----------------------+
| @@max_allowed_packet |
+----------------------+
|           1073740800 |
+----------------------+
1 row in set (0.00 sec)

mysql> select @@net_buffer_length;
+---------------------+
| @@net_buffer_length |
+---------------------+
|             1048576 |
+---------------------+
1 row in set (0.00 sec)

mysql> set net_buffer_length=4096000;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@net_buffer_length;
+---------------------+
| @@net_buffer_length |
+---------------------+
|             1048576 |
+---------------------+
1 row in set (0.00 sec)

mysql>
[11 May 2005 17:43] Hartmut Holzgraefe
Duplicate of 10473

Setting a variable to a value out of range should issue a warning
[15 Feb 2006 15:48] Are you mortal Then prepare to die.
Is this really a duplicate bug or a separate issue that needs separate discussion? Why is the net_buffer_length limited to 1M?
[16 Feb 2006 11:47] Sergei Golubchik
Perhaps, to catch silly typos that would make it too big ?
It's initial error of the network buffer, the buffer then can grow up to 
max_allowed_packet. So net_buffer_length should not be too large.

BTW, it was 1M for at least 8 years