summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem.bichot@oracle.com>2011-04-07 15:09:19 +0200
committerGuilhem Bichot <guilhem.bichot@oracle.com>2011-04-07 15:09:19 +0200
commit08bf3ddde99f6a6014efe9ecf10a976bdd741a8d (patch)
tree1361390096fdbc9f653b47618e94a1872121fa4d /sql/sql_load.cc
parente7079a323573583c06235a9cb20a66bc1682532e (diff)
downloadmariadb-git-08bf3ddde99f6a6014efe9ecf10a976bdd741a8d.tar.gz
Fix for Bug#11765141 - "58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY WHEN ERROR OCCURS"
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 513cd62b510..b9b7bd74f6c 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -1075,9 +1075,10 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
String &field_term, String &line_start, String &line_term,
String &enclosed_par, int escape, bool get_it_from_net,
bool is_fifo)
- :file(file_par),escape_char(escape)
+ :file(file_par), buff_length(tot_length), escape_char(escape),
+ found_end_of_line(false), eof(false), need_end_io_cache(false),
+ error(false), line_cuted(false), found_null(false), read_charset(cs)
{
- read_charset= cs;
field_term_ptr=(char*) field_term.ptr();
field_term_length= field_term.length();
line_term_ptr=(char*) line_term.ptr();
@@ -1104,8 +1105,6 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
(uchar) enclosed_par[0] : INT_MAX;
field_term_char= field_term_length ? (uchar) field_term_ptr[0] : INT_MAX;
line_term_char= line_term_length ? (uchar) line_term_ptr[0] : INT_MAX;
- error=eof=found_end_of_line=found_null=line_cuted=0;
- buff_length=tot_length;
/* Set of a stack for unget if long terminators */
@@ -1151,7 +1150,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
READ_INFO::~READ_INFO()
{
- if (!error && need_end_io_cache)
+ if (need_end_io_cache)
::end_io_cache(&cache);
my_free(buffer, MYF(MY_ALLOW_ZERO_PTR));