diff options
Diffstat (limited to 'client/mysql.cc')
-rw-r--r-- | client/mysql.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 2eb44d46512..2baac7b92b8 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2335,7 +2335,14 @@ static bool add_line(String &buffer, char *line, ulong line_length, { // Found possbile one character command like \c - if (!(inchar = (uchar) *++pos)) + /* + The null-terminating character (ASCII '\0') marks the end of user + input. Then, by default, upon encountering a '\0' while parsing, it + should stop. However, some data naturally contains binary zeros + (e.g., zipped files). Real_binary_mode signals the parser to expect + '\0' within the data and not to end parsing if found. + */ + if (!(inchar = (uchar) *++pos) && (!real_binary_mode || !*in_string)) break; // readline adds one '\' if (*in_string || inchar == 'N') // \N is short for NULL { // Don't allow commands in string |