diff options
author | Dmitry Shulga <Dmitry.Shulga@Sun.COM> | 2010-09-16 17:38:13 +0700 |
---|---|---|
committer | Dmitry Shulga <Dmitry.Shulga@Sun.COM> | 2010-09-16 17:38:13 +0700 |
commit | a684f8df2013069a6e9bd7010ffa7df3da8a8962 (patch) | |
tree | 53ee44a010c3a3787074d14e894edbed17daaddc /sql/net_serv.cc | |
parent | 723e7c16a5fcd184018b8d2d402b3a0951859972 (diff) | |
parent | be794bc5eb1c355c86a94c8988faed0d4c40cf69 (diff) | |
download | mariadb-git-a684f8df2013069a6e9bd7010ffa7df3da8a8962.tar.gz |
Auto-merge from mysql-5.1-bugteam for bug#42503.
Diffstat (limited to 'sql/net_serv.cc')
-rw-r--r-- | sql/net_serv.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 6f0b7a817ca..488e27296b6 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -164,7 +164,17 @@ my_bool net_realloc(NET *net, size_t length) DBUG_ENTER("net_realloc"); DBUG_PRINT("enter",("length: %lu", (ulong) length)); - if (length >= net->max_packet_size) + /* + When compression is off, net->where_b is always 0. + With compression turned on, net->where_b may indicate + that we still have a piece of the previous logical + packet in the buffer, unprocessed. Take it into account + when checking that max_allowed_packet is not exceeded. + This ensures that the client treats max_allowed_packet + limit identically, regardless of compression being on + or off. + */ + if (length >= (net->max_packet_size + net->where_b)) { DBUG_PRINT("error", ("Packet too large. Max size: %lu", net->max_packet_size)); |