~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/hex_string.cc

  • Committer: Mark Atwood
  • Date: 2011-07-13 22:28:29 UTC
  • mfrom: (2318.7.25 refactor1)
  • Revision ID: me@mark.atwood.name-20110713222829-sswp061b5ts7tc1k
mergeĀ lp:~olafvdspek/drizzle/refactor1

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
using namespace std;
31
31
 
32
 
namespace drizzled
33
 
{
 
32
namespace drizzled {
34
33
 
35
 
static char _dig_vec_lower[] =
36
 
  "0123456789abcdefghijklmnopqrstuvwxyz";
 
34
static char _dig_vec_lower[] = "0123456789abcdefghijklmnopqrstuvwxyz";
37
35
 
38
36
inline uint32_t char_val(char X)
39
37
{
90
88
{
91
89
  field->set_notnull();
92
90
  if (field->result_type() == STRING_RESULT)
93
 
    return field->store(str_value.ptr(), str_value.length(),
94
 
                        collation.collation);
 
91
    return field->store(str_value.ptr(), str_value.length(), collation.collation);
95
92
 
96
93
  uint64_t nr;
97
94
  uint32_t length= str_value.length();
110
107
 
111
108
warn:
112
109
  if (!field->store((int64_t) nr, true))
113
 
    field->set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE,
114
 
                       1);
 
110
    field->set_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
115
111
  return 1;
116
112
}
117
113
 
139
135
  return false;
140
136
}
141
137
 
142
 
Item *Item_hex_string::safe_charset_converter(const charset_info_st * const tocs)
 
138
Item *Item_hex_string::safe_charset_converter(const charset_info_st* tocs)
143
139
{
144
 
  Item_string *conv;
145
140
  String tmp, *str= val_str(&tmp);
146
 
 
147
 
  conv= new Item_string(str->ptr(), str->length(), tocs);
 
141
  Item_string* conv= new Item_string(str->ptr(), str->length(), tocs);
148
142
  conv->str_value.copy();
149
143
  conv->str_value.mark_as_const();
150
144
  return conv;