~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.h

  • Committer: Brian Aker
  • Date: 2009-05-21 00:57:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1032.
  • Revision ID: brian@gaz-20090521005705-rpq4hzhy761d3wbj
Straighten out structures (remove some some dead bits).

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
class Table {
72
72
public:
 
73
  Table() {}                               /* Remove gcc warning */
 
74
 
 
75
  TableShare    *s;
 
76
  Field **field;                        /* Pointer to fields */
 
77
 
 
78
  handler       *file;
 
79
  Table *next;
 
80
  Table *prev;
 
81
 
 
82
  uint32_t db_stat;             /* mode of file as in handler.h */
 
83
 
73
84
  my_bitmap_map *bitmap_init_value;
74
85
  MY_BITMAP     def_read_set, def_write_set, tmp_set; /* containers */
75
86
  MY_BITMAP     *read_set, *write_set;          /* Active column sets */
76
87
 
77
 
  TableShare    *s;
78
 
  Table() {}                               /* Remove gcc warning */
79
 
 
80
 
  /* SHARE methods */
81
 
  inline TableShare *getShare() { return s; } /* Get rid of this long term */
82
 
  inline void setShare(TableShare *new_share) { s= new_share; } /* Get rid of this long term */
83
 
  inline uint32_t sizeKeys() { return s->keys; }
84
 
  inline uint32_t sizeFields() { return s->fields; }
85
 
  inline uint32_t getRecordLength() { return s->reclength; }
86
 
  inline uint32_t sizeBlobFields() { return s->blob_fields; }
87
 
  inline uint32_t *getBlobField() { return s->blob_field; }
88
 
  inline uint32_t getNullBytes() { return s->null_bytes; }
89
 
  inline uint32_t getNullFields() { return s->null_fields; }
90
 
  inline unsigned char *getDefaultValues() { return s->default_values; }
91
 
 
92
 
  inline bool isDatabaseLowByteFirst() { return s->db_low_byte_first; }         /* Portable row format */
93
 
  inline bool isCrashed() { return s->crashed; }
94
 
  inline bool isNameLock() { return s->name_lock; }
95
 
  inline bool isReplaceWithNameLock() { return s->replace_with_name_lock; }
96
 
  inline bool isWaitingOnCondition() { return s->waiting_on_cond; }                 /* Protection against free */
97
 
 
98
 
  /* For TMP tables, should be pulled out as a class */
99
 
  void updateCreateInfo(HA_CREATE_INFO *create_info);
100
 
  void setup_tmp_table_column_bitmaps(unsigned char *bitmaps);
101
 
  bool create_myisam_tmp_table(KEY *keyinfo,
102
 
                               MI_COLUMNDEF *start_recinfo,
103
 
                               MI_COLUMNDEF **recinfo,
104
 
                               uint64_t options);
105
 
  void free_tmp_table(Session *session);
106
 
  bool open_tmp_table();
107
 
  size_t max_row_length(const unsigned char *data);
108
 
  uint32_t find_shortest_key(const key_map *usable_keys);
109
 
  bool compare_record(Field **ptr);
110
 
  bool compare_record();
111
 
  /* TODO: the (re)storeRecord's may be able to be further condensed */
112
 
  void storeRecord();
113
 
  void storeRecordAsInsert();
114
 
  void storeRecordAsDefault();
115
 
  void restoreRecord();
116
 
  void restoreRecordAsDefault();
117
 
  void emptyRecord();
118
 
  bool table_check_intact(const uint32_t table_f_count, const TABLE_FIELD_W_TYPE *table_def);
119
 
 
120
 
  /* See if this can be blown away */
121
 
  inline uint32_t getDBStat () { return db_stat; }
122
 
  inline uint32_t setDBStat () { return db_stat; }
123
 
  uint32_t db_stat;             /* mode of file as in handler.h */
124
 
 
125
 
  handler       *file;
126
 
  Table *next, *prev;
127
 
 
128
88
  Session       *in_use;                        /* Which thread uses this */
129
 
  Field **field;                        /* Pointer to fields */
130
89
 
131
90
  unsigned char *record[2];                     /* Pointer to records */
132
91
  unsigned char *write_row_record;              /* Used as optimisation in
284
243
  MEM_ROOT mem_root;
285
244
  filesort_info_st sort;
286
245
 
 
246
  /* SHARE methods */
 
247
  inline TableShare *getShare() { return s; } /* Get rid of this long term */
 
248
  inline void setShare(TableShare *new_share) { s= new_share; } /* Get rid of this long term */
 
249
  inline uint32_t sizeKeys() { return s->keys; }
 
250
  inline uint32_t sizeFields() { return s->fields; }
 
251
  inline uint32_t getRecordLength() { return s->reclength; }
 
252
  inline uint32_t sizeBlobFields() { return s->blob_fields; }
 
253
  inline uint32_t *getBlobField() { return s->blob_field; }
 
254
  inline uint32_t getNullBytes() { return s->null_bytes; }
 
255
  inline uint32_t getNullFields() { return s->null_fields; }
 
256
  inline unsigned char *getDefaultValues() { return s->default_values; }
 
257
 
 
258
  inline bool isDatabaseLowByteFirst() { return s->db_low_byte_first; }         /* Portable row format */
 
259
  inline bool isCrashed() { return s->crashed; }
 
260
  inline bool isNameLock() { return s->name_lock; }
 
261
  inline bool isReplaceWithNameLock() { return s->replace_with_name_lock; }
 
262
  inline bool isWaitingOnCondition() { return s->waiting_on_cond; }                 /* Protection against free */
 
263
 
 
264
  /* For TMP tables, should be pulled out as a class */
 
265
  void updateCreateInfo(HA_CREATE_INFO *create_info);
 
266
  void setup_tmp_table_column_bitmaps(unsigned char *bitmaps);
 
267
  bool create_myisam_tmp_table(KEY *keyinfo,
 
268
                               MI_COLUMNDEF *start_recinfo,
 
269
                               MI_COLUMNDEF **recinfo,
 
270
                               uint64_t options);
 
271
  void free_tmp_table(Session *session);
 
272
  bool open_tmp_table();
 
273
  size_t max_row_length(const unsigned char *data);
 
274
  uint32_t find_shortest_key(const key_map *usable_keys);
 
275
  bool compare_record(Field **ptr);
 
276
  bool compare_record();
 
277
  /* TODO: the (re)storeRecord's may be able to be further condensed */
 
278
  void storeRecord();
 
279
  void storeRecordAsInsert();
 
280
  void storeRecordAsDefault();
 
281
  void restoreRecord();
 
282
  void restoreRecordAsDefault();
 
283
  void emptyRecord();
 
284
  bool table_check_intact(const uint32_t table_f_count, const TABLE_FIELD_W_TYPE *table_def);
 
285
 
 
286
  /* See if this can be blown away */
 
287
  inline uint32_t getDBStat () { return db_stat; }
 
288
  inline uint32_t setDBStat () { return db_stat; }
287
289
  bool fill_item_list(List<Item> *item_list) const;
288
290
  void reset_item_list(List<Item> *item_list) const;
289
291
  void clear_column_bitmaps(void);