~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_dictionary/index_parts.cc

  • Committer: Monty Taylor
  • Date: 2010-09-16 23:12:30 UTC
  • mto: (1775.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1773.
  • Revision ID: mordred@inaugust.com-20100916231230-uchkqks21rwzbmpz
Include files in tarball that were being left out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2010 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2010 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
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, true);
 
37
  add_field("COMPARE_LENGTH", plugin::TableFunction::NUMBER, 0, false);
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
 
 
101
99
  /* TABLE_SCHEMA */
102
100
  push(getTableProto().schema());
103
101
 
108
106
  push(getIndex().name());
109
107
 
110
108
  /* COLUMN_NAME */
111
 
  push(field.name());
 
109
  push(getTableProto().field(index_part.fieldnr()).name());
112
110
 
113
111
  /* COLUMN_NUMBER */
114
112
  push(static_cast<int64_t>(index_part.fieldnr()));
117
115
  push(static_cast<int64_t>(index_part_iterator));
118
116
 
119
117
  /* 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();
 
118
  push(static_cast<int64_t>(index_part.compare_length()));
129
119
 
130
120
  /* IS_ORDER_REVERSE */
131
121
  push(index_part.in_reverse_order());