~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/enum.cc

Remove PLUGIN and MODULES.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
 
22
 
#include "drizzled/server_includes.h"
 
22
#include "config.h"
23
23
#include "drizzled/field/enum.h"
24
24
#include "drizzled/error.h"
25
25
#include "drizzled/table.h"
26
26
#include "drizzled/session.h"
 
27
#include "drizzled/strfunc.h"
27
28
 
28
29
#include <sstream>
29
30
#include <string>
30
31
 
 
32
using namespace drizzled;
 
33
 
31
34
/****************************************************************************
32
35
** enum type.
33
36
** This is a string which only can have a selection of different values.
204
207
  return 0;                                     // impossible
205
208
}
206
209
 
207
 
/**
208
 
   Save the field metadata for enum fields.
209
 
 
210
 
   Saves the real type in the first byte and the pack length in the
211
 
   second byte of the field metadata array at index of *metadata_ptr and
212
 
   *(metadata_ptr + 1).
213
 
 
214
 
   @param   metadata_ptr   First byte of field metadata
215
 
 
216
 
   @returns number of bytes written to metadata_ptr
217
 
*/
218
 
int Field_enum::do_save_field_metadata(unsigned char *metadata_ptr)
219
 
{
220
 
  *metadata_ptr= real_type();
221
 
  *(metadata_ptr + 1)= pack_length();
222
 
  return 2;
223
 
}
224
 
 
225
210
String *Field_enum::val_str(String *, String *val_ptr)
226
211
{
227
212
  uint32_t tmp=(uint32_t) Field_enum::val_int();
282
267
  res.append(')');
283
268
}
284
269
 
285
 
Field *Field_enum::new_field(MEM_ROOT *root, Table *new_table,
 
270
Field *Field_enum::new_field(memory::Root *root, Table *new_table,
286
271
                             bool keep_type)
287
272
{
288
273
  Field_enum *res= (Field_enum*) Field::new_field(root, new_table, keep_type);