1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge gleb.loc:/home/uchum/work/bk/4.1-opt

into  gleb.loc:/home/uchum/work/bk/5.0-opt
This commit is contained in:
gshchepa/uchum@gleb.loc
2007-07-04 02:09:56 +05:00
5 changed files with 103 additions and 1 deletions

View File

@ -1209,6 +1209,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)
@ -1349,7 +1350,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,(byte*) start,(uint) (pos-start)) ||
my_b_write(&cache,(byte*) tmp_buff,2))