~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/enum.cc

  • Committer: Brian Aker
  • Date: 2009-07-11 05:59:19 UTC
  • mfrom: (1089.1.9 merge)
  • Revision ID: brian@gaz-20090711055919-m4px3crrdgta5lie
Collection of patches from new-cleanup (includes asserts for field in debug)

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
{
93
93
  uint32_t tmp;
94
94
 
 
95
  ASSERT_COLUMN_MARKED_FOR_WRITE;
 
96
 
95
97
  /* Remove end space */
96
98
  length= field_charset->cset->lengthsp(field_charset, from, length);
97
99
  tmp= find_type2(typelib, from, length, field_charset);
135
137
 */
136
138
int Field_enum::store(int64_t from, bool)
137
139
{
 
140
  ASSERT_COLUMN_MARKED_FOR_WRITE;
 
141
 
138
142
  if (from <= 0 || (uint64_t) from > typelib->count)
139
143
  {
140
144
    /* Convert the integer to a string using stringstream */
156
160
 
157
161
int64_t Field_enum::val_int(void)
158
162
{
 
163
  ASSERT_COLUMN_MARKED_FOR_READ;
 
164
 
159
165
  switch (packlength) {
160
166
  case 1:
161
167
    return (int64_t) ptr[0];
219
225
String *Field_enum::val_str(String *, String *val_ptr)
220
226
{
221
227
  uint32_t tmp=(uint32_t) Field_enum::val_int();
 
228
 
 
229
  ASSERT_COLUMN_MARKED_FOR_READ;
 
230
 
222
231
  if (!tmp || tmp > typelib->count)
223
232
    val_ptr->set("", 0, field_charset);
224
233
  else