diff options
author | unknown <ram@gw.mysql.r18.ru> | 2004-12-06 18:45:41 +0400 |
---|---|---|
committer | unknown <ram@gw.mysql.r18.ru> | 2004-12-06 18:45:41 +0400 |
commit | 1f1257bd52b7b040df3d8d3842401a885ab8b965 (patch) | |
tree | bd2e97fceacc8a15036a565ec538d5b2282853aa /sql | |
parent | 21f2d3aa3fac1fa864b9a32d0848a22931b7ec61 (diff) | |
download | mariadb-git-1f1257bd52b7b040df3d8d3842401a885ab8b965.tar.gz |
A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet).
scripts/fill_help_tables.sh:
percent_xxx variables added to avoid /0 error.
scripts/mysql_install_db.sh:
A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet).
--net_buffer_length=16K added.
sql/net_serv.cc:
Typo fixed.
sql/sql_parse.cc:
A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet).
Auto extend net buffer in bootstrap mode.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/net_serv.cc | 4 | ||||
-rw-r--r-- | sql/sql_parse.cc | 22 |
2 files changed, 19 insertions, 7 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 5985cf63ed6..1e34ed90fee 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -165,8 +165,8 @@ my_bool net_realloc(NET *net, ulong length) if (length >= net->max_packet_size) { - DBUG_PRINT("error",("Packet too large. Max sixe: %lu", - net->max_packet_size)); + DBUG_PRINT("error", ("Packet too large. Max size: %lu", + net->max_packet_size)); net->error= 1; net->report_error= 1; net->last_errno= ER_NET_PACKET_TOO_LARGE; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3d1df80c37b..71870e2d990 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1102,13 +1102,25 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg) thd->init_for_queries(); while (fgets(buff, thd->net.max_packet, file)) { - uint length=(uint) strlen(buff); - if (buff[length-1]!='\n' && !feof(file)) + ulong length= (ulong) strlen(buff); + while (buff[length-1] != '\n' && !feof(file)) { - send_error(thd,ER_NET_PACKET_TOO_LARGE, NullS); - thd->fatal_error(); - break; + /* + We got only a part of the current string. Will try to increase + net buffer then read the rest of the current string. + */ + if (net_realloc(&(thd->net), 2 * thd->net.max_packet)) + { + send_error(thd, thd->net.last_errno, NullS); + thd->is_fatal_error= 1; + break; + } + buff= (char*) thd->net.buff; + fgets(buff + length, thd->net.max_packet - length, file); + length+= (ulong) strlen(buff + length); } + if (thd->is_fatal_error) + break; while (length && (my_isspace(thd->charset(), buff[length-1]) || buff[length-1] == ';')) length--; |