~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/enum.h

  • Committer: Brian Aker
  • Date: 2010-09-22 22:29:55 UTC
  • mto: (1787.3.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1789.
  • Revision ID: brian@tangent.org-20100922222955-cg1bddv4b72jwe31
Fix enum at being an intefer (which is what PG did, and it saves on
alignment issues).

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
class Field_enum :public Field_str
30
30
{
31
 
protected:
32
 
  uint32_t packlength;
33
31
public:
34
32
 
35
33
  using Field::store;
46
44
             unsigned char *null_ptr_arg,
47
45
             unsigned char null_bit_arg,
48
46
             const char *field_name_arg,
49
 
             uint32_t packlength_arg,
50
47
             TYPELIB *typelib_arg,
51
48
             const CHARSET_INFO * const charset_arg)
52
49
    :Field_str(ptr_arg,
55
52
               null_bit_arg,
56
53
                     field_name_arg,
57
54
               charset_arg),
58
 
    packlength(packlength_arg),
59
55
    typelib(typelib_arg)
60
56
  {
61
57
    flags|= ENUM_FLAG;
62
58
  }
63
59
  Field *new_field(memory::Root *root, Table *new_table, bool keep_type);
64
 
  enum ha_base_keytype key_type() const;
 
60
  enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONG_INT; }
65
61
  int  store(const char *to, uint32_t length, const CHARSET_INFO * const);
66
62
  int  store(double nr);
67
63
  int  store(int64_t nr, bool unsigned_val);
85
81
  {
86
82
    return INT_RESULT;
87
83
  }
88
 
  uint32_t pack_length() const
89
 
  {
90
 
    return (uint32_t) packlength;
91
 
  }
 
84
  uint32_t pack_length() const { return 4; }
92
85
  uint32_t size_of() const
93
86
  {
94
87
    return sizeof(*this);