~drizzle-trunk/drizzle/development

1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2009 Sun Microsystems
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; either version 2 of the License, or
9
 *  (at your option) any later version.
10
 *
11
 *  This program is distributed in the hope that it will be useful,
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *  GNU General Public License for more details.
15
 *
16
 *  You should have received a copy of the GNU General Public License
17
 *  along with this program; if not, write to the Free Software
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
 */
20
21
#ifndef DRIZZLED_INFO_SCHEMA_H
22
#define DRIZZLED_INFO_SCHEMA_H
23
1081.2.4 by Padraig O'Sullivan
Extracted TABLES into the I_S plugin.
24
#include <string>
25
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
26
/**
27
 * @file
28
 *   info_schema.h
29
 * @brief 
30
 *   Header file which contains all classes related to I_S
31
 */
32
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
33
typedef class Item COND;
34
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
35
36
/**
1081.2.7 by Padraig O'Sullivan
Updating doxygen comments in I_S related classes to be of the correct format.
37
 * @class ColumnInfo
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
38
 * @brief
39
 *   Represents a field (column) in an I_S table.
40
 */
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
41
class ColumnInfo 
42
{ 
43
public: 
44
  ColumnInfo(const std::string& in_name, 
45
             uint32_t in_length, 
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
46
             enum enum_field_types in_type,
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
47
             int32_t in_value,
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
48
             uint32_t in_flags,
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
49
             const std::string& in_old_name,
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
50
             uint32_t in_open_method)
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
51
    :
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
52
      name(in_name),
53
      length(in_length),
54
      type(in_type),
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
55
      value(in_value),
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
56
      flags(in_flags),
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
57
      old_name(in_old_name),
58
      open_method(in_open_method)
59
  {}
60
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
61
  ColumnInfo()
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
62
    :
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
63
      name(),
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
64
      length(0),
65
      type(DRIZZLE_TYPE_VARCHAR),
66
      flags(0),
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
67
      old_name(),
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
68
      open_method(SKIP_OPEN_TABLE)
69
  {}
70
71
  /**
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
72
   * @return the name of this column.
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
73
   */
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
74
  const std::string &getName() const
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
75
  {
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
76
    return name;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
77
  }
78
79
  /**
1067.2.10 by Padraig O'Sullivan
Adding some extra doxygen comments to the ColumnInfo class based on some
80
   * This method is only ever called from the
81
   * InfoSchemaMethods::oldFormat() methods. It is mostly
82
   * for old SHOW compatability. It is used when a list
83
   * of fields need to be generated for SHOW. The names
84
   * for those fields (or columns) are found by calling
85
   * this method on each column in the I_S table.
86
   *
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
87
   * @return the old name of this column.
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
88
   */
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
89
  const std::string &getOldName() const
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
90
  {
91
    return old_name;
92
  }
93
94
  /**
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
95
   * @return the open method for this column.
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
96
   */
97
  uint32_t getOpenMethod() const
98
  {
99
    return open_method;
100
  }
101
102
  /**
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
103
   * @return the flags for this column.
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
104
   */
105
  uint32_t getFlags() const
106
  {
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
107
    return flags;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
108
  }
109
110
  /**
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
111
   * @return the length of this column.
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
112
   */
113
  uint32_t getLength() const
114
  {
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
115
    return length;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
116
  }
117
118
  /**
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
119
   * @return the value of this column.
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
120
   */
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
121
  int32_t getValue() const
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
122
  {
123
    return value;
124
  }
125
126
  /**
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
127
   * @return this column's type.
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
128
   */
129
  enum enum_field_types getType() const
130
  {
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
131
    return type;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
132
  }
133
134
private:
135
136
  /**
137
   * This is used as column name.
138
   */
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
139
  const std::string name;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
140
141
  /**
142
   * For string-type columns, this is the maximum number of
143
   * characters. Otherwise, it is the 'display-length' for the column.
144
   */
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
145
  uint32_t length;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
146
147
  /**
148
   * This denotes data type for the column. For the most part, there seems to
149
   * be one entry in the enum for each SQL data type, although there seem to
150
   * be a number of additional entries in the enum.
151
   */
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
152
  enum enum_field_types type;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
153
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
154
  int32_t value;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
155
156
  /**
157
   * This is used to set column attributes. By default, columns are @c NOT
158
   * @c NULL and @c SIGNED, and you can deviate from the default
159
   * by setting the appopriate flags. You can use either one of the flags
160
   * @c MY_I_S_MAYBE_NULL and @cMY_I_S_UNSIGNED or
161
   * combine them using the bitwise or operator @c |. Both flags are
162
   * defined in table.h.
163
   */
1067.2.2 by Padraig O'Sullivan
Forgot to remove the definition of the process list table's methods from
164
  uint32_t flags;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
165
1067.2.10 by Padraig O'Sullivan
Adding some extra doxygen comments to the ColumnInfo class based on some
166
  /**
167
   * The name of this column which is used for old SHOW
168
   * compatability.
169
   */
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
170
  const std::string old_name;
1063.4.9 by Padraig O'Sullivan
Converted the ST_FIELDS_INFO structure to a class named FieldInfo. Made all
171
172
  /**
173
   * This should be one of @c SKIP_OPEN_TABLE,
174
   * @c OPEN_FRM_ONLY or @c OPEN_FULL_TABLE.
175
   */
176
  uint32_t open_method;
177
178
};
179
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
180
/**
1081.2.7 by Padraig O'Sullivan
Updating doxygen comments in I_S related classes to be of the correct format.
181
 * @class InfoSchemaMethods
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
182
 * @brief
183
 *   The methods that an I_S table can support
184
 */
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
185
class InfoSchemaMethods
186
{
187
public:
188
  virtual ~InfoSchemaMethods() {}
189
190
  virtual Table *createSchemaTable(Session *session,
191
                                   TableList *table_list) const;
192
  virtual int fillTable(Session *session, 
193
                        TableList *tables,
194
                        COND *cond);
195
  virtual int processTable(Session *session, TableList *tables,
196
                           Table *table, bool res, LEX_STRING *db_name,
197
                           LEX_STRING *table_name) const;
198
  virtual int oldFormat(Session *session, 
199
                        InfoSchemaTable *schema_table) const;
200
};
201
202
/**
1081.2.7 by Padraig O'Sullivan
Updating doxygen comments in I_S related classes to be of the correct format.
203
 * @class InfoSchemaTable
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
204
 * @brief 
205
 *   Represents an I_S table.
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
206
 */
207
class InfoSchemaTable
208
{
209
public:
1067.2.9 by Padraig O'Sullivan
Removed the getSpecificColumn(), beginColumnInfo(), endColumnInfo() methods
210
211
  typedef std::vector<const ColumnInfo *> Columns;
212
  
1076.2.2 by Padraig O'Sullivan
Converted the const char * members of InfoSchemaTable to be std::string
213
  InfoSchemaTable(const std::string& tab_name,
1067.2.9 by Padraig O'Sullivan
Removed the getSpecificColumn(), beginColumnInfo(), endColumnInfo() methods
214
                  Columns& in_column_info,
1067.2.6 by Padraig O'Sullivan
Modularized the info schema plugin. Have a separate file which contains
215
                  int idx_col1,
216
                  int idx_col2,
217
                  bool in_hidden,
218
                  bool in_opt_possible,
219
                  uint32_t req_object,
220
                  InfoSchemaMethods *in_methods)
221
    :
222
      table_name(tab_name),
223
      hidden(in_hidden),
224
      is_opt_possible(in_opt_possible),
225
      first_column_index(idx_col1),
226
      second_column_index(idx_col2),
227
      requested_object(req_object),
228
      column_info(in_column_info),
229
      i_s_methods(in_methods)
230
  {}
231
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
232
  InfoSchemaTable()
233
    :
1076.2.2 by Padraig O'Sullivan
Converted the const char * members of InfoSchemaTable to be std::string
234
      table_name(),
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
235
      hidden(false),
236
      is_opt_possible(false),
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
237
      first_column_index(0),
238
      second_column_index(0),
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
239
      requested_object(0),
1067.2.6 by Padraig O'Sullivan
Modularized the info schema plugin. Have a separate file which contains
240
      column_info(),
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
241
      i_s_methods(NULL)
242
  {}
243
244
  /**
245
   * Set the methods available on this I_S table.
246
   * @param[in] new_methods the methods to use
247
   */
248
  void setInfoSchemaMethods(InfoSchemaMethods *new_methods)
249
  {
250
    i_s_methods= new_methods;
251
  }
252
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
253
  /**
1063.4.8 by Padraig O'Sullivan
Removing a code block I had commented out for debugging. Also added more
254
   * Create the temporary I_S tables using schema_table data.
255
   *
256
   * @param[in] session a session handler
257
   * @param[in] table_list Used to pass I_S table information (fields,
258
   *                       tables, parameters, etc.) and table name
259
   * @retval \# pointer to created table
260
   * @retval NULL Can't create table
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
261
   */
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
262
  Table *createSchemaTable(Session *session, TableList *table_list) const
263
  {
264
    Table *retval= i_s_methods->createSchemaTable(session, table_list);
265
    return retval;
266
  }
267
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
268
  /**
1063.4.8 by Padraig O'Sullivan
Removing a code block I had commented out for debugging. Also added more
269
   * Fill I_S table.
270
   *
271
   * @param[in] session a session handler
272
   * @param[in] tables I_S table
273
   * @param[in] cond 'WHERE' condition
274
   * @return 0 on success; 1 on error
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
275
   */
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
276
  int fillTable(Session *session, TableList *tables, COND *cond)
277
  {
278
    int retval= i_s_methods->fillTable(session, tables, cond);
279
    return retval;
280
  }
281
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
282
  /**
1063.4.8 by Padraig O'Sullivan
Removing a code block I had commented out for debugging. Also added more
283
   * Fill and store records into an I_S table.
284
   *
285
   * @param[in] session a session handler
286
   * @param[in] tables table list (processed table)
287
   * @param[in] table I_S table
288
   * @param[in] res 1 means error during opening of the processed table
289
   *                0 means processed table opened without error
290
   * @param[in] db_name database name
291
   * @param[in] tab_name table name
292
   * @return 0 on success; 1 on error
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
293
   */
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
294
  int processTable(Session *session, TableList *tables, Table *table,
295
                   bool res, LEX_STRING *db_name, LEX_STRING *tab_name) const
296
  {
297
    int retval= i_s_methods->processTable(session, tables, table,
298
                                          res, db_name, tab_name);
299
    return retval;
300
  }
301
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
302
  /**
1063.4.8 by Padraig O'Sullivan
Removing a code block I had commented out for debugging. Also added more
303
   * For old SHOW compatibility. It is used when old SHOW doesn't
304
   * have generated column names. Generates the list of fields
305
   * for SHOW.
306
   *
307
   * @param[in] session a session handler
308
   * @param[in] schema_table pointer to element of the I_S tables list
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
309
   */
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
310
  int oldFormat(Session *session, InfoSchemaTable *schema_table) const
311
  {
312
    int retval= i_s_methods->oldFormat(session, schema_table);
313
    return retval;
314
  }
315
316
  /**
317
   * Set the I_S tables name.
318
   * @param[in] new_name the name to set the table to
319
   */
1076.2.2 by Padraig O'Sullivan
Converted the const char * members of InfoSchemaTable to be std::string
320
  void setTableName(const std::string &new_name)
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
321
  {
322
    table_name= new_name;
323
  }
324
325
  /**
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
326
   * @param[in] new_first_index value to set first column index to
327
   */
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
328
  void setFirstColumnIndex(int32_t new_first_index)
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
329
  {
330
    first_column_index= new_first_index;
331
  }
332
333
  /**
334
   * @param[in] new_second_index value to set second column index to
335
   */
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
336
  void setSecondColumnIndex(int32_t new_second_index)
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
337
  {
338
    second_column_index= new_second_index;
339
  }
340
341
  /**
342
   * @param[in] in_column_info the columns info to use for this I_S table
343
   */
344
  void setColumnInfo(ColumnInfo *in_column_info)
345
  {
1067.2.5 by Padraig O'Sullivan
Modified the InfoSchemaTable class to now hold information on columns in a
346
    ColumnInfo *tmp= in_column_info;
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
347
    for (; tmp->getName().length() != 0; tmp++)
1067.2.5 by Padraig O'Sullivan
Modified the InfoSchemaTable class to now hold information on columns in a
348
    {
349
      column_info.push_back(tmp);
350
    }
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
351
  }
352
353
  /**
354
   * @return the name of the I_S table.
355
   */
1076.2.2 by Padraig O'Sullivan
Converted the const char * members of InfoSchemaTable to be std::string
356
  const std::string &getTableName() const
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
357
  {
358
    return table_name;
359
  }
360
361
  /**
362
   * @return true if this I_S table is hidden; false otherwise.
363
   */
364
  bool isHidden() const
365
  {
366
    return hidden;
367
  }
368
369
  /**
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
370
   * @return true if I_S optimizations can be performed on this
371
   *         I_S table when running the fillTable method; false
372
   *         otherwise.
373
   */
374
  bool isOptimizationPossible() const
375
  {
376
    return is_opt_possible;
377
  }
378
379
  /**
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
380
   * @return the index for the first field.
381
   */
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
382
  int32_t getFirstColumnIndex() const
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
383
  {
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
384
    return first_column_index;
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
385
  }
386
387
  /**
388
   * @return the index the second field.
389
   */
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
390
  int32_t getSecondColumnIndex() const
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
391
  {
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
392
    return second_column_index;
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
393
  }
394
395
  /**
396
   * @return the requested object.
397
   */
398
  uint32_t getRequestedObject() const
399
  {
400
    return requested_object;
401
  }
402
403
  /**
1067.2.9 by Padraig O'Sullivan
Removed the getSpecificColumn(), beginColumnInfo(), endColumnInfo() methods
404
   * @return the columns for this I_S table
405
   */
406
  const Columns &getColumns() const
407
  {
408
    return column_info;
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
409
  }
410
411
  /**
412
   * @param[in] index the index of this column
413
   * @return the name for the column at the given index
414
   */
1076.2.1 by Padraig O'Sullivan
Converted the const char * members of ColumnInfo to be std::string instead.
415
  const std::string &getColumnName(int index) const
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
416
  {
1067.2.5 by Padraig O'Sullivan
Modified the InfoSchemaTable class to now hold information on columns in a
417
    return column_info[index]->getName();
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
418
  }
419
420
  /**
421
   * @param[in] index the index of this column
422
   * @return the open method for the column at the given index
423
   */
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
424
  uint32_t getColumnOpenMethod(int index) const
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
425
  {
1067.2.5 by Padraig O'Sullivan
Modified the InfoSchemaTable class to now hold information on columns in a
426
    return column_info[index]->getOpenMethod();
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
427
  }
428
429
private:
430
  /**
431
   * I_S table name.
432
   */
1076.2.2 by Padraig O'Sullivan
Converted the const char * members of InfoSchemaTable to be std::string
433
  std::string table_name;
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
434
435
  /**
436
   * Boolean which indicates whether this I_S table
437
   * is hidden or not. If it is hidden, it will not show
438
   * up in the list of I_S tables.
439
   */
440
  bool hidden;
441
442
  /**
1063.4.7 by Padraig O'Sullivan
Added some doxygen comments. Added a new boolean variable to the
443
   * Boolean which indicates whether optimizations are
444
   * possible on this I_S table when performing the
445
   * fillTable method.
446
   */
447
  bool is_opt_possible;
448
449
  /**
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
450
   * The index of the first column.
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
451
   */
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
452
  int32_t first_column_index;
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
453
454
  /**
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
455
   * The index of the second column.
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
456
   */
1067.2.8 by Padraig O'Sullivan
Converting arguments and member variables for ColumnInfo and InfoSchemaTable
457
  int32_t second_column_index;
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
458
459
  /**
460
   * The object to open (TABLE | VIEW).
461
   */
462
  uint32_t requested_object;
463
464
  /**
1063.4.10 by Padraig O'Sullivan
Changing name of FieldInfo class to ColumnInfo based on some feedback from
465
   * The columns for this I_S table.
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
466
   */
1067.2.9 by Padraig O'Sullivan
Removed the getSpecificColumn(), beginColumnInfo(), endColumnInfo() methods
467
  Columns column_info;
1063.4.6 by Padraig O'Sullivan
Added a new header file which contains the InfoSchemaTable class and the
468
469
  /**
470
   * Contains the methods available on this I_S table.
471
   */
472
  InfoSchemaMethods *i_s_methods;
473
474
};
475
476
#endif /* DRIZZLED_INFO_SCHEMA_H */