~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/data_engine/tables.h

Updates for show table status.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
  public:
49
49
    Generator(Field **arg);
50
50
 
 
51
    void pushRow(drizzled::message::Table::TableOptions::RowType type);
 
52
 
51
53
    const std::string &table_name()
52
54
    {
53
55
      return (*table_iterator);
78
80
class TableNames : public TablesTool
79
81
{
80
82
public:
 
83
  TableNames(const char *table_arg) :
 
84
    TablesTool(table_arg)
 
85
  { }
 
86
 
81
87
  TableNames() :
82
88
    TablesTool("LOCAL_TABLE_NAMES")
83
89
  {
106
112
  }
107
113
};
108
114
 
 
115
class TableStatus : public TableNames
 
116
{
 
117
public:
 
118
  TableStatus() :
 
119
    TableNames("LOCAL_TABLE_STATUS")
 
120
  {
 
121
    add_field("Name");
 
122
    add_field("Engine");
 
123
    add_field("Version");
 
124
    add_field("Row_format");
 
125
    add_field("Rows");
 
126
    add_field("Avg_row_length");
 
127
    add_field("Data_length");
 
128
    add_field("Max_data_length");
 
129
    add_field("Index_length");
 
130
    add_field("Data_free");
 
131
    add_field("Auto_increment");
 
132
    add_field("Create_time");
 
133
    add_field("Update_time");
 
134
    add_field("Check_time");
 
135
    add_field("Collation");
 
136
    add_field("Checksum");
 
137
    add_field("Create_options");
 
138
    add_field("Comment");
 
139
  }
 
140
 
 
141
  class Generator : public TableNames::Generator 
 
142
  {
 
143
    void fill()
 
144
    {
 
145
      /* Name */
 
146
      push(table_name());
 
147
 
 
148
      /* Engine */
 
149
      push(getTableProto().engine().name());
 
150
 
 
151
      /* Version */
 
152
      push(0);
 
153
 
 
154
      /* Row_format */
 
155
      pushRow(getTableProto().options().row_type());
 
156
 
 
157
      /* Rows */
 
158
      push(0);
 
159
 
 
160
      /* Avg_row_length */
 
161
      push(0);
 
162
 
 
163
      /* Data_length */
 
164
      push(0);
 
165
 
 
166
      /* Max_data_length */
 
167
      push(0);
 
168
 
 
169
      /* Index_length */
 
170
      push(0);
 
171
 
 
172
      /* Data_free */
 
173
      push(0);
 
174
 
 
175
      /* Auto_increment */
 
176
      push(0);
 
177
 
 
178
      /* Create_time */
 
179
      push(0);
 
180
 
 
181
      /* Collation */
 
182
      push(getTableProto().options().collation());
 
183
 
 
184
      /* Checksum */
 
185
      push(0);
 
186
 
 
187
      /* Create_options */
 
188
      push("");
 
189
 
 
190
      /* Comment */
 
191
      push(getTableProto().options().comment());
 
192
    }
 
193
 
 
194
  public:
 
195
    Generator(Field **arg) :
 
196
      TableNames::Generator(arg)
 
197
    { }
 
198
  };
 
199
 
 
200
  Generator *generator(Field **arg)
 
201
  {
 
202
    return new Generator(arg);
 
203
  }
 
204
};
 
205
 
109
206
#endif // PLUGIN_DATA_ENGINE_TABLES_H