~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_share_instance.h

  • Committer: lbieber
  • Date: 2010-10-01 13:06:31 UTC
  • mfrom: (1802.2.2 drizzle-bug-651948)
  • mto: This revision was merged to the branch mainline in revision 1805.
  • Revision ID: lbieber@orisndriz08-20101001130631-xubscnhmj7r5dn6g
Merge Andrew - Fix bug 651948 - Index lengths not retrieved using drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
/* Structs that defines the Table */
22
22
 
23
 
#ifndef DRIZZLED_TABLE_SINGULAR_H
24
 
#define DRIZZLED_TABLE_SINGULAR_H
 
23
#ifndef DRIZZLED_TABLE_SHARE_INSTANCE_H
 
24
#define DRIZZLED_TABLE_SHARE_INSTANCE_H
25
25
 
26
26
namespace drizzled
27
27
{
28
28
 
29
 
namespace table
30
 
{
31
 
 
32
 
class Singular : public Table
33
 
{
34
 
  TableShare _share;
35
 
  bool _has_variable_width;
 
29
class TableShareInstance : public TableShare 
 
30
{
 
31
  Table private_table;
36
32
 
37
33
public:
38
 
  Singular() :
39
 
    _share(message::Table::INTERNAL),
40
 
    _has_variable_width(false)
41
 
  {
42
 
  }
43
 
 
44
 
  Singular(Session *session, List<CreateField> &field_list);
45
 
 
46
 
  TableShare *getMutableShare(void)
47
 
  {
48
 
    return &_share;
49
 
  }
50
 
 
51
 
  void setShare(TableShare *)
52
 
  {
53
 
    assert(0);
54
 
  }
55
 
 
56
 
  const TableShare *getShare(void) const
57
 
  {
58
 
    return &_share;
59
 
  }
60
 
 
61
 
  bool hasShare() const { return true; }
62
 
 
63
 
  void release() {};
64
 
 
65
 
  bool hasVariableWidth() const
66
 
  {
67
 
    return _has_variable_width;
68
 
  }
69
 
 
70
 
  bool create_myisam_tmp_table(KeyInfo *keyinfo,
71
 
                               MI_COLUMNDEF *start_recinfo,
72
 
                               MI_COLUMNDEF **recinfo,
73
 
                               uint64_t options);
74
 
  void setup_tmp_table_column_bitmaps();
75
 
  bool open_tmp_table();
76
 
 
77
 
  void setVariableWidth()
78
 
  {
79
 
    _has_variable_width= true;
80
 
  }
81
 
 
82
 
  ~Singular();
 
34
  TableShareInstance(TableIdentifier::Type type_arg) :
 
35
    TableShare(type_arg)
 
36
  {
 
37
    private_table.setShare(this);
 
38
  }
 
39
 
 
40
  Table *getTable()
 
41
  {
 
42
    return &private_table;
 
43
  }
 
44
 
 
45
  ~TableShareInstance()
 
46
  {
 
47
    private_table.free_tmp_table(private_table.in_use);
 
48
  }
83
49
};
84
50
 
85
 
} /* namespace table */
86
51
} /* namespace drizzled */
87
52
 
88
 
#endif /* DRIZZLED_TABLE_SINGULAR_H */
 
53
#endif /* DRIZZLED_TABLE_SHARE_INSTANCE_H */