~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/indexes.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
IndexesTool::IndexesTool() :
28
28
  TablesTool("INDEXES")
29
29
{
30
 
  add_field("TABLE_SCHEMA");
31
 
  add_field("TABLE_NAME");
32
 
  add_field("INDEX_NAME");
 
30
  add_field("TABLE_SCHEMA", plugin::TableFunction::STRING, MAXIMUM_IDENTIFIER_LENGTH, false);
 
31
  add_field("TABLE_NAME", plugin::TableFunction::STRING, MAXIMUM_IDENTIFIER_LENGTH, false);
 
32
  add_field("INDEX_NAME", plugin::TableFunction::STRING, MAXIMUM_IDENTIFIER_LENGTH, false);
33
33
  add_field("IS_USED_IN_PRIMARY", plugin::TableFunction::BOOLEAN, 0, false);
34
34
  add_field("IS_UNIQUE", plugin::TableFunction::BOOLEAN, 0, false);
35
35
  add_field("IS_NULLABLE", plugin::TableFunction::BOOLEAN, 0, false);
114
114
  push(static_cast<uint64_t>(index.key_length()));
115
115
 
116
116
  /* INDEX_TYPE */
117
 
  {
118
 
    const char *str;
119
 
    uint32_t length;
120
 
 
121
 
    switch (index.type())
122
 
    {
123
 
    default:
124
 
    case message::Table::Index::UNKNOWN_INDEX:
125
 
      str= "UNKNOWN";
126
 
      length= sizeof("UNKNOWN");
127
 
      break;
128
 
    case message::Table::Index::BTREE:
129
 
      str= "BTREE";
130
 
      length= sizeof("BTREE");
131
 
      break;
132
 
    case message::Table::Index::RTREE:
133
 
      str= "RTREE";
134
 
      length= sizeof("RTREE");
135
 
      break;
136
 
    case message::Table::Index::HASH:
137
 
      str= "HASH";
138
 
      length= sizeof("HASH");
139
 
      break;
140
 
    case message::Table::Index::FULLTEXT:
141
 
      str= "FULLTEXT";
142
 
      length= sizeof("FULLTEXT");
143
 
      break;
144
 
    }
145
 
    /* Subtract 1 here, because sizeof gives us the wrong amount */
146
 
    push(str, length - 1);
147
 
  }
 
117
  push(message::type(index.type()));
148
118
 
149
119
 /* "INDEX_COMMENT" */
150
120
  if (index.has_comment())