diff options
author | unknown <ram@gw.mysql.r18.ru> | 2004-12-06 20:45:31 +0400 |
---|---|---|
committer | unknown <ram@gw.mysql.r18.ru> | 2004-12-06 20:45:31 +0400 |
commit | 678fff408a8cd475555d3bbce3d77fd0a2c76a4a (patch) | |
tree | e106867c0c1ca1e765dcf87fa8330b30c76e6af8 /sql/sql_parse.cc | |
parent | 0d8d061f738925d3c9da3cc1804fae0eb91db243 (diff) | |
parent | 1f1257bd52b7b040df3d8d3842401a885ab8b965 (diff) | |
download | mariadb-git-678fff408a8cd475555d3bbce3d77fd0a2c76a4a.tar.gz |
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b5823
sql/sql_parse.cc:
Auto merged
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1e18771ad15..0e32097266d 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--; |