~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_share.h

  • Committer: Eric Day
  • Date: 2009-10-31 21:53:33 UTC
  • mfrom: (1200 staging)
  • mto: This revision was merged to the branch mainline in revision 1202.
  • Revision ID: eday@oddments.org-20091031215333-j94bjoanwmi68p6f
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
  instance of table share per one table in the database.
24
24
*/
25
25
 
 
26
#ifndef DRIZZLED_TABLE_SHARE_H
 
27
#define DRIZZLED_TABLE_SHARE_H
 
28
 
26
29
#include <string>
27
30
 
 
31
#include "drizzled/message/table.pb.h"
28
32
 
29
33
class TableShare
30
34
{
111
115
 
112
116
  inline const char *getComment()
113
117
  {
114
 
    return (table_proto) ?  table_proto->options().comment().c_str() : NULL; 
 
118
    return (table_proto && table_proto->has_options()) ?  table_proto->options().comment().c_str() : NULL; 
115
119
  }
116
120
 
117
121
  inline uint32_t getCommentLength()
119
123
    return (table_proto) ? table_proto->options().comment().length() : 0; 
120
124
  }
121
125
 
 
126
  inline bool hasKeyBlockSize()
 
127
  {
 
128
    return (table_proto) ? table_proto->options().has_key_block_size() : false;
 
129
  }
 
130
 
 
131
  inline uint32_t getKeyBlockSize()
 
132
  {
 
133
    return (table_proto) ? table_proto->options().key_block_size() : 0;
 
134
  }
 
135
 
122
136
  inline uint64_t getMaxRows()
123
137
  {
124
138
    return max_rows;
137
151
  enum tmp_table_type tmp_table;
138
152
 
139
153
  uint32_t ref_count;       /* How many Table objects uses this */
140
 
  uint32_t key_block_size;                      /* create key_block_size, if used */
141
154
  uint32_t null_bytes;
142
155
  uint32_t last_null_bit_pos;
143
156
  uint32_t fields;                              /* Number of fields */
153
166
  uint32_t db_options_in_use;           /* Options in use */
154
167
  uint32_t db_record_offset;            /* if HA_REC_IN_SEQ */
155
168
  uint32_t rowid_field_offset;          /* Field_nr +1 to rowid field */
 
169
  /**
 
170
   * @TODO 
 
171
   *
 
172
   * Currently the replication services component uses
 
173
   * the primary_key member to determine which field is the table's
 
174
   * primary key.  However, as it exists, because this member is scalar, it
 
175
   * only supports a single-column primary key. Is there a better way
 
176
   * to ask for the fields which are in a primary key?
 
177
   */
 
178
  uint32_t primary_key;
156
179
  /* Index of auto-updated TIMESTAMP field in field array */
157
 
  uint32_t primary_key;
158
180
  uint32_t next_number_index;               /* autoincrement key number */
159
181
  uint32_t next_number_key_offset;          /* autoinc keypart offset in a key */
160
182
  uint32_t next_number_keypart;             /* autoinc keypart number in a key */
387
409
                              TableList *table_list, char *key,
388
410
                              uint32_t key_length, uint32_t, int *error);
389
411
};
 
412
 
 
413
#endif /* DRIZZLED_TABLE_SHARE_H */