summaryrefslogtreecommitdiff
path: root/client/my_readline.h
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@oracle.com>2011-02-05 11:02:00 +0600
committerDmitry Shulga <Dmitry.Shulga@oracle.com>2011-02-05 11:02:00 +0600
commit2f0ba4c3f82a8c621c1efaae18911d9fa868ec64 (patch)
tree0081afb284ed8dce0f349971d24915910f875a70 /client/my_readline.h
parent2dfb4c5ed33a7fbd7297fdf54097434370a7a1c7 (diff)
downloadmariadb-git-2f0ba4c3f82a8c621c1efaae18911d9fa868ec64.tar.gz
Fixed bug#57450 - mysql client enter in an infinite loop
if the standard input is a directory. The problem is that mysql monitor try to read from stdin without checking input source type. The solution is to stop reading data from standard input if a call to read(2) failed. A new test case was added into mysql.test.
Diffstat (limited to 'client/my_readline.h')
-rw-r--r--client/my_readline.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/my_readline.h b/client/my_readline.h
index 62ad19bece9..3376fc81761 100644
--- a/client/my_readline.h
+++ b/client/my_readline.h
@@ -25,9 +25,11 @@ typedef struct st_line_buffer
uint eof;
ulong max_size;
ulong read_length; /* Length of last read string */
+ int error;
+ bool truncated;
} LINE_BUFFER;
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
-extern char *batch_readline(LINE_BUFFER *buffer, bool *truncated);
+extern char *batch_readline(LINE_BUFFER *buffer);
extern void batch_readline_end(LINE_BUFFER *buffer);