1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge magare.gmz:/home/kgeorge/mysql/work/mysql-5.0-opt

into  magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt
This commit is contained in:
gkodinov/kgeorge@magare.gmz
2007-07-04 11:46:45 +03:00
11 changed files with 245 additions and 18 deletions

View File

@ -1445,6 +1445,7 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
field_sep_char= (exchange->enclosed->length() ? (*exchange->enclosed)[0] :
field_term_length ? (*exchange->field_term)[0] : INT_MAX);
escape_char= (exchange->escaped->length() ? (*exchange->escaped)[0] : -1);
is_ambiguous_field_sep= test(strchr(ESCAPE_CHARS, field_sep_char));
line_sep_char= (exchange->line_term->length() ?
(*exchange->line_term)[0] : INT_MAX);
if (!field_term_length)
@ -1585,7 +1586,9 @@ bool select_export::send_data(List<Item> &items)
NEED_ESCAPING(pos[1])))
{
char tmp_buff[2];
tmp_buff[0]= escape_char;
tmp_buff[0]= ((int) *pos == field_sep_char &&
is_ambiguous_field_sep) ?
field_sep_char : escape_char;
tmp_buff[1]= *pos ? *pos : '0';
if (my_b_write(&cache,(uchar*) start,(uint) (pos-start)) ||
my_b_write(&cache,(uchar*) tmp_buff,2))