1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef DRIZZLED_SELECT_EXPORT_H
22
#define DRIZZLED_SELECT_EXPORT_H
25
List of all possible characters of a numeric value text representation.
27
#define NUMERIC_CHARS ".0123456789e+-"
35
uint32_t field_term_length;
36
int field_sep_char,escape_char,line_sep_char;
37
int field_term_char; // first char of FIELDS TERMINATED BY or MAX_INT
39
The is_ambiguous_field_sep field is true if a value of the field_sep_char
40
field is one of the 'n', 't', 'r' etc characters
41
(see the READ_INFO::unescape method and the ESCAPE_CHARS constant value).
43
bool is_ambiguous_field_sep;
45
The is_ambiguous_field_term is true if field_sep_char contains the first
46
char of the FIELDS TERMINATED BY (ENCLOSED BY is empty), and items can
47
contain this character.
49
bool is_ambiguous_field_term;
51
The is_unsafe_field_sep field is true if a value of the field_sep_char
52
field is one of the '0'..'9', '+', '-', '.' and 'e' characters
53
(see the NUMERIC_CHARS constant value).
55
bool is_unsafe_field_sep;
58
select_export(file_exchange *ex) :
65
is_ambiguous_field_sep(0),
66
is_ambiguous_field_term(0),
67
is_unsafe_field_sep(0),
71
int prepare(List<Item> &list, Select_Lex_Unit *u);
72
bool send_data(List<Item> &items);
74
inline bool needs_escaping(char character, bool enclosed)
76
if ((character == escape_char) ||
77
(enclosed ? character == field_sep_char : character == field_term_char) ||
78
character == line_sep_char ||
87
} /* namespace drizzled */
89
#endif /* DRIZZLED_SELECT_EXPORT_H */