~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/enum.cc

Added code necessary for building plugins dynamically.
Merged in changes from lifeless to allow autoreconf to work.
Touching plugin.ini files now triggers a rebuid - so config/autorun.sh is no
longer required to be run after touching those.
Removed the duplicate plugin names - also removed the issue that getting them
different would silently fail weirdly later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 */
20
20
 
21
21
 
22
 
#include "config.h"
 
22
#include "drizzled/server_includes.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"
28
27
 
29
28
#include <sstream>
30
29
#include <string>
31
30
 
32
 
namespace drizzled
33
 
{
34
 
 
35
31
/****************************************************************************
36
32
** enum type.
37
33
** This is a string which only can have a selection of different values.
208
204
  return 0;                                     // impossible
209
205
}
210
206
 
 
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
 
211
225
String *Field_enum::val_str(String *, String *val_ptr)
212
226
{
213
227
  uint32_t tmp=(uint32_t) Field_enum::val_int();
268
282
  res.append(')');
269
283
}
270
284
 
271
 
Field *Field_enum::new_field(memory::Root *root, Table *new_table,
 
285
Field *Field_enum::new_field(MEM_ROOT *root, Table *new_table,
272
286
                             bool keep_type)
273
287
{
274
288
  Field_enum *res= (Field_enum*) Field::new_field(root, new_table, keep_type);
276
290
    res->typelib= copy_typelib(root, typelib);
277
291
  return res;
278
292
}
279
 
 
280
 
} /* namespace drizzled */