1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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

into  gleb.loc:/home/uchum/work/bk/5.1-opt
This commit is contained in:
gshchepa/uchum@gleb.loc
2007-07-07 20:14:06 +05:00
10 changed files with 206 additions and 2 deletions

View File

@ -1446,6 +1446,7 @@ select_export::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
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));
is_unsafe_field_sep= test(strchr(NUMERIC_CHARS, field_sep_char));
line_sep_char= (exchange->line_term->length() ?
(*exchange->line_term)[0] : INT_MAX);
if (!field_term_length)
@ -1520,7 +1521,8 @@ bool select_export::send_data(List<Item> &items)
used_length=min(res->length(),item->max_length);
else
used_length=res->length();
if (result_type == STRING_RESULT && escape_char != -1)
if ((result_type == STRING_RESULT || is_unsafe_field_sep) &&
escape_char != -1)
{
char *pos, *start, *end;
CHARSET_INFO *res_charset= res->charset();