~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/show_table_status.h

  • Committer: Brian Aker
  • Date: 2010-03-02 07:03:12 UTC
  • mfrom: (1309.2.10 drizzle-build)
  • Revision ID: brian@gaz-20100302070312-u8xyk09u2970pgzp
Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2010 Brian Aker
 
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 PLUGIN_SCHEMA_DICTIONARY_SHOW_TABLE_STATUS_H
 
22
#define PLUGIN_SCHEMA_DICTIONARY_SHOW_TABLE_STATUS_H
 
23
 
 
24
class ShowTableStatus : public ShowTables
 
25
{
 
26
public:
 
27
  ShowTableStatus() :
 
28
    ShowTables("SHOW_TABLE_STATUS")
 
29
  {
 
30
    add_field("Name");
 
31
    add_field("Engine");
 
32
    add_field("Version");
 
33
    add_field("Row_format");
 
34
    add_field("Rows");
 
35
    add_field("Avg_row_length");
 
36
    add_field("Data_length");
 
37
    add_field("Max_data_length");
 
38
    add_field("Index_length");
 
39
    add_field("Data_free");
 
40
    add_field("Auto_increment");
 
41
    add_field("Create_time");
 
42
    add_field("Update_time");
 
43
    add_field("Check_time");
 
44
    add_field("Collation");
 
45
    add_field("Checksum");
 
46
    add_field("Create_options");
 
47
    add_field("Comment");
 
48
  }
 
49
 
 
50
  class Generator : public ShowTables::Generator 
 
51
  {
 
52
    void fill()
 
53
    {
 
54
      /* Name */
 
55
      push(table_name());
 
56
 
 
57
      /* Engine */
 
58
      push(getTableProto().engine().name());
 
59
 
 
60
      /* Version */
 
61
      push(static_cast<int64_t>(0));
 
62
 
 
63
      /* Row_format */
 
64
      pushRow(getTableProto().options().row_type());
 
65
 
 
66
      /* Rows */
 
67
      push(static_cast<int64_t>(0));
 
68
 
 
69
      /* Avg_row_length */
 
70
      push(static_cast<int64_t>(0));
 
71
 
 
72
      /* Data_length */
 
73
      push(static_cast<int64_t>(0));
 
74
 
 
75
      /* Max_data_length */
 
76
      push(static_cast<int64_t>(0));
 
77
 
 
78
      /* Index_length */
 
79
      push(static_cast<int64_t>(0));
 
80
 
 
81
      /* Data_free */
 
82
      push(static_cast<int64_t>(0));
 
83
 
 
84
      /* Auto_increment */
 
85
      push(static_cast<int64_t>(0));
 
86
 
 
87
      /* Create_time */
 
88
      push(static_cast<int64_t>(0));
 
89
 
 
90
      /* Update_time */
 
91
      push(static_cast<int64_t>(0));
 
92
 
 
93
      /* Check_time */
 
94
      push(static_cast<int64_t>(0));
 
95
 
 
96
      /* Collation */
 
97
      push(getTableProto().options().collation());
 
98
 
 
99
      /* Checksum */
 
100
      push(static_cast<int64_t>(0));
 
101
 
 
102
      /* Create_options */
 
103
      push("");
 
104
 
 
105
      /* Comment */
 
106
      push("");
 
107
    }
 
108
 
 
109
  public:
 
110
    Generator(drizzled::Field **arg) :
 
111
      ShowTables::Generator(arg)
 
112
    { }
 
113
  };
 
114
 
 
115
  Generator *generator(drizzled::Field **arg)
 
116
  {
 
117
    return new Generator(arg);
 
118
  }
 
119
};
 
120
 
 
121
#endif /* PLUGIN_SCHEMA_DICTIONARY_SHOW_TABLE_STATUS_H */