~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/serialize/table.proto

  • Committer: Stewart Smith
  • Date: 2009-02-09 04:15:24 UTC
  • mto: (859.1.1 nofrm)
  • mto: This revision was merged to the branch mainline in revision 864.
  • Revision ID: stewart@flamingspork.com-20090209041524-mmngaan4s2oibkxt
Read (nearly the whole) index information (key and key parts) out of the proto, not FRM.

Update the table.proto to reflect in server structures and possible values.
Biggest change is IndexPart now references fieldnr and not an embedded field.
This is because we need to set the fieldnr in server and I couldn't find a way to get this info out of protobuf.

Also add an assert in the proto writing part to make sure we handle all possible index flags.

Increasingly we abort() on old FRM file formats as I remove FRM code piece by piece.

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
  message Index {
136
136
 
137
137
    enum IndexType {
 
138
    /* Kept in sync with enum ha_key_alg if only for stewart's sanity. */
138
139
      UNKNOWN_INDEX = 0;
139
 
      HASH = 1;
140
 
      BTREE = 2;
 
140
      BTREE = 1;
 
141
      RTREE = 2;
 
142
      HASH  = 3;
 
143
      FULLTEXT = 4;
141
144
    }
142
145
 
143
146
    message IndexPart {
144
 
      required Field field = 1;
 
147
      required uint32 fieldnr = 1;
145
148
      optional int32 compare_length = 2;
146
149
      optional bool in_reverse_order = 3 [default = false];
147
150
    }
148
151
 
 
152
    message IndexOptions {
 
153
      optional bool pack_key = 1;
 
154
      optional bool binary_pack_key = 2;
 
155
      optional bool var_length_key = 3;
 
156
      optional bool null_part_key = 4;
 
157
      optional uint32 key_block_size = 5;
 
158
      optional bool has_partial_segments =6;
 
159
      optional bool auto_generated_key = 7;
 
160
    }      
 
161
 
149
162
    required string name = 1;
150
163
    required bool is_primary = 2;
151
164
    required bool is_unique = 3;
152
165
    required IndexType type = 4 [default = UNKNOWN_INDEX];
153
 
    repeated IndexPart index_part = 5;
154
 
    optional string comment = 6;
 
166
    required uint32 key_length = 5;
 
167
    repeated IndexPart index_part = 6;
 
168
    optional IndexOptions options= 7;
 
169
    optional string comment = 8;
155
170
  }
156
171
 
157
172
  required string name = 1;