diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-05-10 16:57:40 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-05-10 16:57:40 +0300 |
commit | d706f1a768ff59b5f8523811bb4a9406e5d82b38 (patch) | |
tree | 1810b2ffcaac02578a8a1a932c8a69ce1114d54e /sql/sql_load.cc | |
parent | 7071a7b2613ae7a69f9a9e157c5faff489f7d5f5 (diff) | |
parent | 3937f13cd48ee2181b8b0545f8a5156d2ae204ca (diff) | |
download | mariadb-git-d706f1a768ff59b5f8523811bb4a9406e5d82b38.tar.gz |
weave merge of mysql-5.1->mysql-5.1-security
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r-- | sql/sql_load.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc index a3796f71ea7..3cbee131b30 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,12 +1105,10 @@ 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 */ - uint length=max(field_term_length,line_term_length)+1; + uint length= max(cs->mbmaxlen, max(field_term_length, line_term_length)) + 1; set_if_bigger(length,line_start.length()); stack=stack_pos=(int*) sql_alloc(sizeof(int)*length); @@ -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)); |