~drizzle-trunk/drizzle/jenkins-Drizzle-Builder-180

« back to all changes in this revision

Viewing changes to drizzled/key_info.h

  • Committer: Continuous Integration
  • Date: 2013-03-07 03:15:07 UTC
  • mfrom: (2630.1.7 create-tmp-table)
  • Revision ID: ci@drizzle.org-20130307031507-bqgrashrp5m3fw8x
Merge lp:~stewart/drizzle/misc-cleanups Build: jenkins-Drizzle-Builder-175

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/definitions.h>
25
25
#include <drizzled/lex_string.h>
26
26
#include <drizzled/thr_lock.h>
 
27
#include <drizzled/message/table.pb.h>
27
28
 
28
29
namespace drizzled {
29
30
 
30
 
class KeyPartInfo 
31
 
{       /* Info about a key part */
32
 
public:
33
 
  Field *field;
34
 
  unsigned int  offset;                         /* offset in record (from 0) */
35
 
  unsigned int  null_offset;                    /* Offset to null_bit in record */
36
 
  /* Length of key part in bytes, excluding NULL flag and length bytes */
37
 
  uint16_t length;
38
 
  /*
39
 
    Number of bytes required to store the keypart value. This may be
40
 
    different from the "length" field as it also counts
41
 
     - possible NULL-flag byte (see HA_KEY_NULL_LENGTH) [if null_bit != 0,
42
 
       the first byte stored at offset is 1 if null, 0 if non-null; the
43
 
       actual value is stored from offset+1].
44
 
     - possible HA_KEY_BLOB_LENGTH bytes needed to store actual value length.
45
 
  */
46
 
  uint16_t store_length;
47
 
  uint16_t key_type;
48
 
private:
49
 
public:
50
 
  uint16_t getKeyType() const
51
 
  {
52
 
    return key_type;
53
 
  }
54
 
  uint16_t fieldnr;                     /* Fieldnum in UNIREG (1,2,3,...) */
55
 
  uint16_t key_part_flag;                       /* 0 or HA_REVERSE_SORT */
56
 
  uint8_t type;
57
 
  uint8_t null_bit;                     /* Position to null_bit */
58
 
};
59
 
 
60
 
 
61
 
class KeyInfo 
 
31
class KeyPartInfo;
 
32
 
 
33
class KeyInfo
62
34
{
63
35
public:
64
36
  unsigned int  key_length;             /* Tot length of key */
65
 
  enum  ha_key_alg algorithm;
 
37
  drizzled::message::Table::Index::IndexType algorithm;
66
38
  unsigned long flags;                  /* dupp key and pack flags */
67
39
  unsigned int key_parts;               /* How many key_parts */
68
40
  uint32_t  extra_length;
80
52
  str_ref comment;
81
53
};
82
54
 
83
 
 
84
 
class RegInfo 
85
 
{
86
 
public:         /* Extra info about reg */
87
 
  JoinTable *join_tab;  /* Used by SELECT() */
88
 
  enum thr_lock_type lock_type;         /* How database is used */
89
 
  bool not_exists_optimize;
90
 
  bool impossible_range;
91
 
  RegInfo()
92
 
    : join_tab(NULL), lock_type(TL_UNLOCK),
93
 
      not_exists_optimize(false), impossible_range(false) {}
94
 
  void reset()
95
 
  {
96
 
    join_tab= NULL;
97
 
    lock_type= TL_UNLOCK;
98
 
    not_exists_optimize= false;
99
 
    impossible_range= false;
100
 
  }
101
 
};
102
 
 
103
 
typedef int *(*update_var)(Session *, struct drizzle_show_var *);
104
 
 
105
55
} /* namespace drizzled */
106
 
 
107
 
        /* Bits in form->status */
108
 
#define STATUS_NO_RECORD        (1+2)   /* Record isn't usably */
109
 
#define STATUS_GARBAGE          1
110
 
#define STATUS_NOT_FOUND        2       /* No record in database when needed */
111
 
#define STATUS_NO_PARENT        4       /* Parent record wasn't found */
112
 
#define STATUS_NULL_ROW         32      /* table->null_row is set */
113