~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/tables.cc

  • Committer: Brian Aker
  • Date: 2010-09-09 21:45:53 UTC
  • mto: (1756.1.2 build) (1768.2.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 1757.
  • Revision ID: brian@tangent.org-20100909214553-e687rmf5zk9478on
Force unique to just use memory and let the OS handle paging.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
  add_field("TABLE_SCHEMA");
49
49
  add_field("TABLE_NAME");
50
50
  add_field("TABLE_TYPE");
51
 
  add_field("TABLE_ARCHETYPE");
52
51
  add_field("ENGINE");
53
52
  add_field("ROW_FORMAT", 10);
54
53
  add_field("TABLE_COLLATION");
55
54
  add_field("TABLE_CREATION_TIME");
56
55
  add_field("TABLE_UPDATE_TIME");
57
56
  add_field("TABLE_COMMENT", plugin::TableFunction::STRING, 2048, true);
58
 
  add_field("AUTO_INCREMENT", plugin::TableFunction::NUMBER, 0, false);
59
 
  add_field("TABLE_UUID", plugin::TableFunction::STRING, 36, true);
60
 
  add_field("TABLE_VERSION", plugin::TableFunction::NUMBER, 0, true);
61
57
}
62
58
 
63
59
TablesTool::Generator::Generator(Field **arg) :
68
64
 
69
65
bool TablesTool::Generator::nextTable()
70
66
{
71
 
  drizzled::message::table::shared_ptr table_ptr;
 
67
  const drizzled::message::Table *table_ptr;
72
68
  while ((table_ptr= all_tables_generator))
73
69
  {
74
70
    table_message.CopyFrom(*table_ptr);
89
85
  return false;
90
86
}
91
87
 
 
88
void TablesTool::Generator::pushType(message::Table::Field::FieldType type)
 
89
{
 
90
  switch (type)
 
91
  {
 
92
  default:
 
93
  case message::Table::Field::VARCHAR:
 
94
    push(VARCHAR);
 
95
    break;
 
96
  case message::Table::Field::DOUBLE:
 
97
    push(DOUBLE);
 
98
    break;
 
99
  case message::Table::Field::BLOB:
 
100
    push(BLOB);
 
101
    break;
 
102
  case message::Table::Field::ENUM:
 
103
    push(ENUM);
 
104
    break;
 
105
  case message::Table::Field::INTEGER:
 
106
    push(INTEGER);
 
107
    break;
 
108
  case message::Table::Field::BIGINT:
 
109
    push(BIGINT);
 
110
    break;
 
111
  case message::Table::Field::DECIMAL:
 
112
    push(DECIMAL);
 
113
    break;
 
114
  case message::Table::Field::DATE:
 
115
    push(DATE);
 
116
    break;
 
117
  case message::Table::Field::TIMESTAMP:
 
118
    push(TIMESTAMP);
 
119
    break;
 
120
  case message::Table::Field::DATETIME:
 
121
    push(DATETIME);
 
122
    break;
 
123
  }
 
124
}
 
125
 
92
126
void TablesTool::Generator::fill()
93
127
{
94
128
 
103
137
  push(getTableMessage().name());
104
138
 
105
139
  /* TABLE_TYPE */
106
 
  if (drizzled::TableIdentifier::isView(getTableMessage().type()))
107
 
  {
108
 
    push("VIEW");
109
 
  }
110
 
  else
111
 
  {
112
 
    push("BASE");
113
 
  }
114
 
 
115
 
  /* TABLE_ARCHETYPE */
116
140
  {
117
141
    switch (getTableMessage().type())
118
142
    {
165
189
  {
166
190
    push();
167
191
  }
168
 
 
169
 
  /* AUTO_INCREMENT */
170
 
  push(getTableMessage().options().auto_increment_value());
171
 
 
172
 
  /* TABLE_UUID */
173
 
  push(getTableMessage().uuid());
174
 
 
175
 
  /* TABLE_VERSION */
176
 
  push(getTableMessage().version());
177
192
}