2
Message format for tables.
4
1
package drizzled.message;
5
2
option optimize_for = SPEED;
7
option java_package = "org.drizzle.messages";
8
option java_outer_classname = "TableMessage";
10
import "engine.proto";
11
message StorageEngine {
13
message EngineOption {
14
enum EngineOptionType {
20
required string option_name = 1;
21
required string option_value = 2;
22
required EngineOptionType option_type = 3;
25
required string name = 1;
26
repeated EngineOption option = 2;
21
29
message TableOptions {
22
optional bool has_user_set_auto_increment_value = 1;
30
optional uint64 auto_increment = 1;
23
31
optional string collation = 2;
24
32
optional uint32 collation_id = 3;
25
33
optional string data_file_name = 5;
28
36
optional uint64 min_rows = 8;
29
37
optional uint64 auto_increment_value = 9;
30
38
optional uint32 avg_row_length = 11;
39
optional uint32 key_block_size = 12;
31
40
optional uint32 block_size = 13;
32
41
optional string comment = 14;
42
optional bool pack_keys = 15;
33
43
optional bool pack_record = 16;
34
44
optional bool checksum = 17;
35
45
optional bool page_checksum = 18;
36
46
optional bool delay_key_write = 19;
52
ROW_TYPE_COMPRESSED = 3;
53
ROW_TYPE_REDUNDANT = 4;
58
optional RowType row_type = 20;
62
optional uint32 avg_row_length = 1;
63
optional uint64 max_rows = 2;
64
optional uint32 min_rows = 3;
39
67
message ForeignKeyConstraint {
40
optional string name = 1;
41
repeated string column_names = 2;
42
required string references_table_name = 3;
43
repeated string references_columns = 4;
45
enum ForeignKeyMatchOption {
51
required ForeignKeyMatchOption match = 5;
53
enum ForeignKeyOption {
59
OPTION_SET_DEFAULT = 5;
62
required ForeignKeyOption update_option = 6 [ default = OPTION_UNDEF ];
63
required ForeignKeyOption delete_option = 7 [ default = OPTION_UNDEF ];
68
required string name = 1;
69
required Field dependent = 2;
70
required Field parent = 3;
71
/** @TODO Finish this off... */
86
98
optional string update_value = 2;
87
99
optional bool default_null = 3 [default = false];
88
100
optional bytes default_bin_value = 4;
89
optional string default_expression = 5;
90
optional string update_expression = 6;
102
optional int32 length = 100; /* TODO: should go away */
105
message TimestampFieldOptions {
106
optional bool auto_updates = 1 [default = false];
93
109
message FieldConstraints {
94
optional bool is_nullable = 1 [default = true]; // Dead option, do not use
110
required bool is_nullable = 1 [default = false];
95
111
optional bool is_unsigned = 2 [default = false];
96
optional bool is_notnull = 3 [default = false];
97
optional bool is_unique = 4 [default = false];
98
112
repeated string expression = 16; /* Reserve 0-15 for frequenty accessed attributes */
101
115
message NumericFieldOptions {
102
116
optional bool is_autoincrement = 1 [default = false];
103
optional uint32 scale = 2;
104
optional uint32 precision = 3;
117
optional int32 length = 2;
118
optional int32 scale = 3;
119
optional int32 precision = 4;
107
122
message StringFieldOptions {
108
123
optional bool is_fixed_width = 1 [default = false];
109
optional uint32 length = 2;
124
optional int32 length = 2;
110
125
optional uint32 collation_id = 3;
111
126
optional string collation = 4;
114
message EnumerationValues {
129
message SetFieldOptions {
130
required int32 count_elements = 1;
115
131
optional uint32 collation_id = 2;
116
132
optional string collation = 3;
117
repeated string field_value = 4;
121
Do we store microseconds or timezone.
123
message TimeFieldOptions {
124
optional bool microseconds = 1;
133
repeated bytes field_value = 4;
127
136
required string name = 1;
128
137
required FieldType type = 2;
138
optional FieldFormatType format = 3;
129
139
optional FieldOptions options = 4;
130
140
optional FieldConstraints constraints = 5;
131
141
optional NumericFieldOptions numeric_options = 6;
132
142
optional StringFieldOptions string_options = 7;
133
optional TimeFieldOptions time_options = 8;
135
144
optional string comment = 16; /* Reserve 0-15 for frequently accessed attributes */
136
optional EnumerationValues enumeration_values = 17;
145
optional SetFieldOptions set_options = 17;
146
optional TimestampFieldOptions timestamp_options = 18;
142
/* Kept in sync with enum ha_key_alg if only for stewart sanity. */
152
/* Kept in sync with enum ha_key_alg if only for stewart's sanity. */
143
153
UNKNOWN_INDEX = 0;
150
160
message IndexPart {
151
161
required uint32 fieldnr = 1;
152
optional uint32 compare_length = 2;
162
optional int32 compare_length = 2;
153
163
optional bool in_reverse_order = 3 [default = false];
165
optional uint32 key_type = 101; /* THIS MUST DIE. Along with pack_flag*/
168
message IndexOptions {
157
169
optional bool pack_key = 1;
158
170
optional bool binary_pack_key = 2;
159
171
optional bool var_length_key = 3;
169
181
required IndexType type = 4 [default = UNKNOWN_INDEX];
170
182
required uint32 key_length = 5;
171
183
repeated IndexPart index_part = 6;
172
optional Options options= 7;
184
optional IndexOptions options= 7;
173
185
optional string comment = 8;
176
188
required string name = 1;
177
required string schema = 6;
178
189
required TableType type = 5;
179
required Engine engine = 2;
190
required StorageEngine engine = 2;
180
191
repeated Field field = 3;
181
192
repeated Index indexes = 4;
183
194
repeated ForeignKeyConstraint fk_constraint = 8;
184
195
optional TableOptions options = 9;
185
required uint64 creation_timestamp= 11 [default = 0];
186
required uint64 update_timestamp= 12 [default = 0];
187
optional string catalog = 13;
188
optional string uuid = 14;
190
A version value of 0, means that it was never set.
192
optional uint64 version = 15;
196
repeated Table.Field added_field = 1;
196
optional TableStats stats = 10;