diff options
author | Alexey Kopytov <Alexey.Kopytov@sun.com> | 2009-03-18 11:18:24 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@sun.com> | 2009-03-18 11:18:24 +0300 |
commit | a3e5737abdf3a555e06c9ae073b2d01efe251dd6 (patch) | |
tree | 2165879ba56fa3d6417a48e08d8533be302af75f /client/my_readline.h | |
parent | 8587e4f9890df910e6712f5b3cbf339d80f9e4c2 (diff) | |
download | mariadb-git-a3e5737abdf3a555e06c9ae073b2d01efe251dd6.tar.gz |
Fix for bug#41486: extra character appears in BLOB for every
~40Mb after mysqldump/import
When the input string exceeds the maximum allowed size for the
internal buffer, batch_readline() returns a truncated string.
Since there was no way for a caller to determine whether the
string was truncated or not, the command line client assumed
batch_readline() to always return the whole input string and
appended a newline character. This resulted in garbled data
when importing dumps containing strings longer than the
maximum input buffer size.
Fixed by adding a flag to the batch_readline() interface to
signal a truncated string to the caller.
Other minor problems fixed during patch implementation:
- The maximum allowed buffer size for batch_readline() was set
up depending on the client's max_allowed_packet value. It does
not actully make any sense, as those variables are not
related. The input buffer size limit is now always set to 1
MB.
- fill_buffer() did not always set the EOF flag.
- The input buffer could actually grow twice as the specified
limit due to insufficient checks in intern_read_line().
Diffstat (limited to 'client/my_readline.h')
-rw-r--r-- | client/my_readline.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client/my_readline.h b/client/my_readline.h index 47be7fa9294..32d6da4c626 100644 --- a/client/my_readline.h +++ b/client/my_readline.h @@ -29,5 +29,5 @@ typedef struct st_line_buffer extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file); extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, my_string str); -extern char *batch_readline(LINE_BUFFER *buffer); +extern char *batch_readline(LINE_BUFFER *buffer, bool *truncated); extern void batch_readline_end(LINE_BUFFER *buffer); |