1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#33057 mysql command line client slows down and uses 100% CPU when restoring dump

client/mysql.cc:
  BUG#33057, avoid calling strlen() *for every single character* in the client's input
This commit is contained in:
unknown
2007-12-20 21:37:21 +01:00
parent adfd5ddcf5
commit 6dd1f417d3

View File

@ -1272,9 +1272,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
if (status.add_to_history && line[0] && not_in_history(line))
add_history(line);
#endif
#ifdef USE_MB
char *end_of_line=line+(uint) strlen(line);
#endif
for (pos=out=line ; (inchar= (uchar) *pos) ; pos++)
{
@ -1364,7 +1362,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
}
else if (!*ml_comment && !*in_string &&
strlen(pos) >= 10 &&
(end_of_line - pos) >= 10 &&
!my_strnncoll(charset_info, (uchar*) pos, 10,
(const uchar*) "delimiter ", 10))
{