diff options
author | monty@mashka.mysql.fi <> | 2003-02-04 21:52:14 +0200 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2003-02-04 21:52:14 +0200 |
commit | 023d6dd39b9068ab8096c5ec60ab82bd10dbcee2 (patch) | |
tree | bad5f8dd7f020cc76a4c5e0f19bd130e3fb4a735 /sql/protocol.cc | |
parent | 6a32ae735541b4780a209e883430ded343115792 (diff) | |
parent | 5ce0cd16b8b9fa05c781ac6ff4687133ed145d84 (diff) | |
download | mariadb-git-023d6dd39b9068ab8096c5ec60ab82bd10dbcee2.tar.gz |
Merge with 4.0.11
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r-- | sql/protocol.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index a89872e087f..c338feea9bc 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +/* Copyright (C) 2000-2003 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,8 +30,12 @@ bool Protocol::net_store_data(const char *from, uint length) { ulong packet_length=packet->length(); - if (packet_length+5+length > packet->alloced_length() && - packet->realloc(packet_length+5+length)) + /* + The +9 comes from that strings of length longer than 16M require + 9 bytes to be stored (see net_store_length). + */ + if (packet_length+9+length > packet->alloced_length() && + packet->realloc(packet_length+9+length)) return 1; char *to=(char*) net_store_length((char*) packet->ptr()+packet_length, (ulonglong) length); |