~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/index_parts.cc

  • Committer: lbieber
  • Date: 2010-10-01 16:29:19 UTC
  • mfrom: (1804.1.1 build)
  • Revision ID: lbieber@orisndriz08-20101001162919-ecqsatl39e2sgt4l
Merge Andrew - Fix bug 651948 - Index lengths not retrieved using drizzledump

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
  add_field("COLUMN_NAME");
35
35
  add_field("COLUMN_NUMBER", plugin::TableFunction::NUMBER, 0, false);
36
36
  add_field("SEQUENCE_IN_INDEX", plugin::TableFunction::NUMBER, 0, false);
37
 
  add_field("COMPARE_LENGTH", plugin::TableFunction::NUMBER, 0, false);
 
37
  add_field("COMPARE_LENGTH", plugin::TableFunction::NUMBER, 0, true);
38
38
  add_field("IS_ORDER_REVERSE", plugin::TableFunction::BOOLEAN, 0, false);
39
39
  add_field("IS_USED_IN_PRIMARY", plugin::TableFunction::BOOLEAN, 0, false);
40
40
  add_field("IS_UNIQUE", plugin::TableFunction::BOOLEAN, 0, false);
96
96
 
97
97
void IndexPartsTool::Generator::fill()
98
98
{
 
99
  const message::Table::Field &field= getTableProto().field(index_part.fieldnr());
 
100
 
99
101
  /* TABLE_SCHEMA */
100
102
  push(getTableProto().schema());
101
103
 
106
108
  push(getIndex().name());
107
109
 
108
110
  /* COLUMN_NAME */
109
 
  push(getTableProto().field(index_part.fieldnr()).name());
 
111
  push(field.name());
110
112
 
111
113
  /* COLUMN_NUMBER */
112
114
  push(static_cast<int64_t>(index_part.fieldnr()));
115
117
  push(static_cast<int64_t>(index_part_iterator));
116
118
 
117
119
  /* COMPARE_LENGTH */
118
 
  push(static_cast<int64_t>(index_part.compare_length()));
 
120
  if ((field.type() == message::Table::Field::VARCHAR or
 
121
    field.type() == message::Table::Field::BLOB) and
 
122
    (index_part.has_compare_length()) and
 
123
    (index_part.compare_length() != field.string_options().length()))
 
124
  {
 
125
    push(static_cast<int64_t>(index_part.compare_length()));
 
126
  }
 
127
  else
 
128
    push();
119
129
 
120
130
  /* IS_ORDER_REVERSE */
121
131
  push(index_part.in_reverse_order());