~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/stored_key.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-07-08 04:26:02 UTC
  • mto: (1089.3.4 merge)
  • mto: This revision was merged to the branch mainline in revision 1092.
  • Revision ID: osullivan.padraig@gmail.com-20090708042602-x4hmf9ny8dcpvb22
Replaced an instance where a uint8_t type was being used to hold a
collection of flags. Converted it to a std::bitset<2> instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_STORED_KEY_H
21
21
#define DRIZZLED_STORED_KEY_H
22
22
 
23
 
namespace drizzled
24
 
{
25
 
 
26
23
/** class to store an field/item as a key struct */
27
 
class StoredKey :public memory::SqlAlloc
 
24
class StoredKey :public Sql_alloc
28
25
{
29
26
public:
30
27
  bool null_key; /**< If true, the value of the key has a null part */
56
53
        Key segments are always packed with a 2 byte length prefix.
57
54
        See mi_rkey for details.
58
55
      */
59
 
      to_field= new Field_varstring(ptr,
60
 
                                    length,
61
 
                                    2,
62
 
                                    null,
63
 
                                    1,
64
 
                                    field_arg->field_name,
65
 
                                    field_arg->table->s,
66
 
                                    field_arg->charset());
 
56
      to_field= new Field_varstring(ptr, length, 2, null, 1,
 
57
                                    Field::NONE, field_arg->field_name,
 
58
                                    field_arg->table->s, field_arg->charset());
67
59
      to_field->init(field_arg->table);
68
60
    }
69
61
    else
70
62
      to_field= field_arg->new_key_field(session->mem_root, field_arg->table,
71
63
                                        ptr, null, 1);
72
 
 
73
 
    to_field->setWriteSet();
74
64
  }
75
65
  virtual ~StoredKey() {}                       /** Not actually needed */
76
66
  virtual const char *name() const=0;
176
166
  }
177
167
};
178
168
 
179
 
} /* namespace drizzled */
180
 
 
181
169
#endif /* DRIZZLED_STORED_KEY_H */