summaryrefslogtreecommitdiff
path: root/client/readline.cc
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@oracle.com>2011-02-09 12:50:11 +0600
committerDmitry Shulga <Dmitry.Shulga@oracle.com>2011-02-09 12:50:11 +0600
commit9a044cc240bbccb713faacb65e40559e2100acce (patch)
tree1ef8dc3912e88b0bd805a710c6441d68de907250 /client/readline.cc
parentd144f43ac3e403c4d204dab7f21cae269880a71a (diff)
parentc46e20f6c1275df5890838f92dc070fc7de99f63 (diff)
downloadmariadb-git-9a044cc240bbccb713faacb65e40559e2100acce.tar.gz
Automerge from mysql-5.1 for follow-up bug#57450.
Diffstat (limited to 'client/readline.cc')
-rw-r--r--client/readline.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/client/readline.cc b/client/readline.cc
index 83c9591b8b2..c4bb4ab53f6 100644
--- a/client/readline.cc
+++ b/client/readline.cc
@@ -18,6 +18,7 @@
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
+#include <my_dir.h>
#include "my_readline.h"
static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
@@ -30,6 +31,13 @@ static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length);
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
{
LINE_BUFFER *line_buff;
+ MY_STAT input_file_stat;
+
+ if (my_fstat(fileno(file), &input_file_stat, MYF(MY_WME)) ||
+ MY_S_ISDIR(input_file_stat.st_mode) ||
+ MY_S_ISBLK(input_file_stat.st_mode))
+ return 0;
+
if (!(line_buff=(LINE_BUFFER*)
my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL))))
return 0;