~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/table.proto

Remove dead memset call.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Message format for tables.
 
3
*/
1
4
package drizzled.message;
2
5
option optimize_for = SPEED;
3
6
 
 
7
import "engine.proto";
 
8
 
4
9
message Table {
5
10
 
6
11
  enum TableType {
10
15
    FUNCTION = 3;
11
16
  }
12
17
 
13
 
  message StorageEngine {
14
 
 
15
 
    message EngineOption {
16
 
      enum EngineOptionType {
17
 
        BOOL = 0;
18
 
        INTEGER = 1;
19
 
        STRING = 2;
20
 
      }
21
 
 
22
 
      required string option_name = 1;
23
 
      required string option_value = 2;
24
 
      required EngineOptionType option_type = 3;
25
 
    }
26
 
 
27
 
    required string name = 1;
28
 
    repeated EngineOption option = 2;
29
 
  }
30
 
 
31
18
  message TableOptions {
32
 
    optional uint64 auto_increment = 1;
 
19
    optional bool has_user_set_auto_increment_value = 1;
33
20
    optional string collation = 2;
34
21
    optional uint32 collation_id = 3;
35
22
    optional string data_file_name = 5;
38
25
    optional uint64 min_rows = 8;
39
26
    optional uint64 auto_increment_value = 9;
40
27
    optional uint32 avg_row_length = 11;
41
 
    optional uint32 key_block_size = 12;
42
28
    optional uint32 block_size = 13;
43
29
    optional string comment = 14;
44
 
    optional bool pack_keys = 15;
45
30
    optional bool pack_record = 16;
46
31
    optional bool checksum = 17;
47
32
    optional bool page_checksum = 18;
48
33
    optional bool delay_key_write = 19;
49
 
 
50
 
    enum RowType {
51
 
         ROW_TYPE_DEFAULT = 0;
52
 
         ROW_TYPE_FIXED = 1;
53
 
         ROW_TYPE_DYNAMIC = 2;
54
 
         ROW_TYPE_COMPRESSED = 3;
55
 
         ROW_TYPE_REDUNDANT = 4;
56
 
         ROW_TYPE_COMPACT = 5;
57
 
         ROW_TYPE_PAGE = 6;
58
 
    }
59
 
 
60
 
    optional RowType row_type = 20;
61
 
  }
62
 
 
63
 
  message TableStats {
64
 
    optional uint32 avg_row_length = 1;
65
 
    optional uint64 max_rows = 2;
66
 
    optional uint32 min_rows = 3;
67
34
  }
68
35
 
69
36
  message ForeignKeyConstraint {
70
 
    required string name = 1;
71
 
    required Field dependent = 2;
72
 
    required Field parent = 3;
73
 
    /** @TODO Finish this off... */
 
37
    optional string name = 1;
 
38
    repeated string column_names = 2;
 
39
    required string references_table_name = 3;
 
40
    repeated string references_columns = 4;
 
41
 
 
42
    enum ForeignKeyMatchOption {
 
43
      MATCH_UNDEFINED = 0;
 
44
      MATCH_FULL = 1;
 
45
      MATCH_PARTIAL = 2;
 
46
      MATCH_SIMPLE = 3;
 
47
    }
 
48
    required ForeignKeyMatchOption match = 5;
 
49
 
 
50
    enum ForeignKeyOption {
 
51
      OPTION_UNDEF = 0;
 
52
      OPTION_RESTRICT = 1;
 
53
      OPTION_CASCADE = 2;
 
54
      OPTION_SET_NULL = 3;
 
55
      OPTION_NO_ACTION = 4;
 
56
      OPTION_DEFAULT = 5;
 
57
    }
 
58
 
 
59
    required ForeignKeyOption update_option = 6 [ default = OPTION_UNDEF ];
 
60
    required ForeignKeyOption delete_option = 7 [ default = OPTION_UNDEF ];
74
61
  }
75
62
 
76
63
  message Field {
88
75
      DATETIME = 10;
89
76
    }
90
77
 
91
 
    enum FieldFormatType {
92
 
      DefaultFormat= 0;
93
 
      FixedFormat= 1;
94
 
      DynamicFormat= 2;
95
 
    }
96
 
 
97
78
    message FieldOptions {
98
79
      optional string default_value = 1;
99
80
      optional string update_value = 2;
100
81
      optional bool default_null = 3 [default = false];
101
82
      optional bytes default_bin_value = 4;
102
 
    }
103
 
 
104
 
    message TimestampFieldOptions {
105
 
      optional bool auto_updates = 1 [default = false];
 
83
      optional string default_expression = 5;
 
84
      optional string update_expression = 6;
106
85
    }
107
86
 
108
87
    message FieldConstraints {
132
111
 
133
112
    required string name = 1;
134
113
    required FieldType type = 2;
135
 
    optional FieldFormatType format = 3;
136
114
    optional FieldOptions options = 4;
137
115
    optional FieldConstraints constraints = 5;
138
116
    optional NumericFieldOptions numeric_options = 6;
140
118
 
141
119
    optional string comment = 16; /* Reserve 0-15 for frequently accessed attributes */
142
120
    optional EnumerationValues enumeration_values = 17;
143
 
    optional TimestampFieldOptions timestamp_options = 18;
144
121
  }
145
122
 
146
123
  message Index {
158
135
      required uint32 fieldnr = 1;
159
136
      optional uint32 compare_length = 2;
160
137
      optional bool in_reverse_order = 3 [default = false];
161
 
 
162
 
      optional uint32 key_type = 101; /* THIS MUST DIE. Along with pack_flag*/
163
138
    }
164
139
 
165
 
    message IndexOptions {
 
140
    message Options {
166
141
      optional bool pack_key = 1;
167
142
      optional bool binary_pack_key = 2;
168
143
      optional bool var_length_key = 3;
178
153
    required IndexType type = 4 [default = UNKNOWN_INDEX];
179
154
    required uint32 key_length = 5;
180
155
    repeated IndexPart index_part = 6;
181
 
    optional IndexOptions options= 7;
 
156
    optional Options options= 7;
182
157
    optional string comment = 8;
183
158
  }
184
159
 
185
160
  required string name = 1;
186
161
  required string schema = 6;
187
162
  required TableType type = 5;
188
 
  required StorageEngine engine = 2;
 
163
  required Engine engine = 2;
189
164
  repeated Field field = 3;
190
165
  repeated Index indexes = 4;
191
166
 
192
167
  repeated ForeignKeyConstraint fk_constraint = 8;
193
168
  optional TableOptions options = 9;
194
 
  optional TableStats stats = 10;
195
169
  required uint64 creation_timestamp= 11 [default = 0];
196
170
  required uint64 update_timestamp= 12 [default = 0];
197
171
  optional string catalog = 13;