~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.h

Merge of Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
#include <drizzled/lex_string.h>
34
34
#include <drizzled/table_list.h>
35
35
#include <drizzled/table_share.h>
36
 
#include <bitset>
37
36
 
38
37
class Item;
39
38
class Item_subselect;
71
70
 
72
71
class Table {
73
72
public:
74
 
  std::bitset<MAX_FIELDS> def_read_set, def_write_set, tmp_set; /* containers */
75
 
  std::bitset<MAX_FIELDS> *read_set, *write_set;                /* Active column sets */
 
73
  my_bitmap_map *bitmap_init_value;
 
74
  MY_BITMAP     def_read_set, def_write_set, tmp_set; /* containers */
 
75
  MY_BITMAP     *read_set, *write_set;          /* Active column sets */
76
76
 
77
77
  TableShare    *s;
78
78
  Table() {}                               /* Remove gcc warning */
97
97
 
98
98
  /* For TMP tables, should be pulled out as a class */
99
99
  void updateCreateInfo(HA_CREATE_INFO *create_info);
100
 
  void setup_tmp_table_column_bitmaps();
 
100
  void setup_tmp_table_column_bitmaps(unsigned char *bitmaps);
101
101
  bool create_myisam_tmp_table(KEY *keyinfo,
102
102
                               MI_COLUMNDEF *start_recinfo,
103
103
                               MI_COLUMNDEF **recinfo,
164
164
  order_st *group;
165
165
  const char    *alias;                   /* alias or table name */
166
166
  unsigned char         *null_flags;
167
 
 
168
167
  /*
169
168
   The ID of the query that opened and is using this table. Has different
170
169
   meanings depending on the table type.
268
267
  */
269
268
  bool open_placeholder;
270
269
  bool locked_by_logger;
 
270
  bool no_replicate;
271
271
  bool locked_by_name;
272
272
  bool no_cache;
273
 
 
274
273
  /*
275
274
    To indicate that a non-null value of the auto_increment field
276
275
    was provided by the user or retrieved from the current record.
289
288
  void reset_item_list(List<Item> *item_list) const;
290
289
  void clear_column_bitmaps(void);
291
290
  void prepare_for_position(void);
292
 
  void mark_columns_used_by_index_no_reset(uint32_t index, std::bitset<MAX_FIELDS> *map);
 
291
  void mark_columns_used_by_index_no_reset(uint32_t index, MY_BITMAP *map);
293
292
  void mark_columns_used_by_index_no_reset(uint32_t index);
294
293
  void mark_columns_used_by_index(uint32_t index);
295
294
  void restore_column_maps_after_mark_index();
297
296
  void mark_columns_needed_for_update(void);
298
297
  void mark_columns_needed_for_delete(void);
299
298
  void mark_columns_needed_for_insert(void);
300
 
  inline void column_bitmaps_set(std::bitset<MAX_FIELDS> *read_set_arg,
301
 
                                 std::bitset<MAX_FIELDS> *write_set_arg)
302
 
  {
303
 
    read_set= read_set_arg;
304
 
    write_set= write_set_arg;
305
 
  }
306
 
  inline void column_bitmaps_set_no_signal(std::bitset<MAX_FIELDS> *read_set_arg,
307
 
                                           std::bitset<MAX_FIELDS> *write_set_arg)
308
 
  {
309
 
    read_set= read_set_arg;
310
 
    write_set= write_set_arg;
311
 
  }
312
 
 
313
 
  void restore_column_map(std::bitset<MAX_FIELDS> *old);
314
 
 
315
 
  std::bitset<MAX_FIELDS> *use_all_columns(std::bitset<MAX_FIELDS> *bitmap);
 
299
  inline void column_bitmaps_set(MY_BITMAP *read_set_arg,
 
300
                                 MY_BITMAP *write_set_arg)
 
301
  {
 
302
    read_set= read_set_arg;
 
303
    write_set= write_set_arg;
 
304
  }
 
305
 
 
306
  void restore_column_map(my_bitmap_map *old);
 
307
 
 
308
  my_bitmap_map *use_all_columns(MY_BITMAP *bitmap);
316
309
  inline void use_all_columns()
317
310
  {
318
311
    column_bitmaps_set(&s->all_set, &s->all_set);
327
320
  /* Both of the below should go away once we can move this bit to the field objects */
328
321
  inline bool isReadSet(uint32_t index)
329
322
  {
330
 
    return read_set->test(index);
 
323
    return bitmap_is_set(read_set, index);
331
324
  }
332
325
 
333
326
  inline void setReadSet(uint32_t index)
334
327
  {
335
 
    read_set->set(index);
 
328
    bitmap_set_bit(read_set, index);
 
329
  }
 
330
 
 
331
  inline void setReadSet()
 
332
  {
 
333
    bitmap_set_all(read_set);
336
334
  }
337
335
 
338
336
  inline bool isWriteSet(uint32_t index)
339
337
  {
340
 
    return write_set->test(index);
 
338
    return bitmap_is_set(write_set, index);
341
339
  }
342
340
 
343
341
  inline void setWriteSet(uint32_t index)
344
342
  {
345
 
    write_set->set(index);
 
343
    bitmap_set_bit(write_set, index);
 
344
  }
 
345
 
 
346
  inline void setWriteSet()
 
347
  {
 
348
    bitmap_set_all(write_set);
346
349
  }
347
350
 
348
351
  /* Is table open or should be treated as such by name-locking? */