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;
33
optional string connect_string = 4;
25
34
optional string data_file_name = 5;
26
35
optional string index_file_name = 6;
27
36
optional uint64 max_rows = 7;
28
37
optional uint64 min_rows = 8;
29
38
optional uint64 auto_increment_value = 9;
30
39
optional uint32 avg_row_length = 11;
40
optional uint32 key_block_size = 12;
31
41
optional uint32 block_size = 13;
32
42
optional string comment = 14;
43
optional bool pack_keys = 15;
33
44
optional bool pack_record = 16;
34
45
optional bool checksum = 17;
35
46
optional bool page_checksum = 18;
36
47
optional bool delay_key_write = 19;
53
ROW_TYPE_COMPRESSED = 3;
54
ROW_TYPE_REDUNDANT = 4;
59
optional RowType row_type = 20;
63
optional uint32 avg_row_length = 1;
64
optional uint64 max_rows = 2;
65
optional uint32 min_rows = 3;
39
68
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 ];
69
required string name = 1;
70
required Field dependent = 2;
71
required Field parent = 3;
72
/** @TODO Finish this off... */
84
101
optional string update_value = 2;
85
102
optional bool default_null = 3 [default = false];
86
103
optional bytes default_bin_value = 4;
87
optional string default_expression = 5;
88
optional string update_expression = 6;
105
optional int32 length = 100; /* TODO: should go away */
108
message TimestampFieldOptions {
109
optional bool auto_updates = 1 [default = false];
91
112
message FieldConstraints {
92
required bool is_nullable = 1 [default = true];
113
required bool is_nullable = 1 [default = false];
93
114
optional bool is_unsigned = 2 [default = false];
94
115
repeated string expression = 16; /* Reserve 0-15 for frequenty accessed attributes */
97
118
message NumericFieldOptions {
98
119
optional bool is_autoincrement = 1 [default = false];
99
optional uint32 scale = 2;
100
optional uint32 precision = 3;
120
optional int32 length = 2;
121
optional int32 scale = 3;
122
optional int32 precision = 4;
103
125
message StringFieldOptions {
104
126
optional bool is_fixed_width = 1 [default = false];
105
optional uint32 length = 2;
127
optional int32 length = 2;
106
128
optional uint32 collation_id = 3;
107
129
optional string collation = 4;
110
message EnumerationValues {
132
message SetFieldOptions {
133
required int32 count_elements = 1;
111
134
optional uint32 collation_id = 2;
112
135
optional string collation = 3;
113
repeated string field_value = 4;
136
repeated bytes field_value = 4;
139
message VirtualFieldOptions {
140
required FieldType type = 1;
141
required bool physically_stored = 2;
142
/* optional as we could optimise some cases in future */
143
optional string expression = 3;
116
146
required string name = 1;
117
147
required FieldType type = 2;
148
optional FieldFormatType format = 3;
118
149
optional FieldOptions options = 4;
119
150
optional FieldConstraints constraints = 5;
120
151
optional NumericFieldOptions numeric_options = 6;
121
152
optional StringFieldOptions string_options = 7;
153
optional VirtualFieldOptions virtual_options = 8;
123
155
optional string comment = 16; /* Reserve 0-15 for frequently accessed attributes */
124
optional EnumerationValues enumeration_values = 17;
156
optional SetFieldOptions set_options = 17;
157
optional TimestampFieldOptions timestamp_options = 18;
159
optional uint32 pack_flag = 100; /* MUST DIE */
130
/* Kept in sync with enum ha_key_alg if only for stewart sanity. */
165
/* Kept in sync with enum ha_key_alg if only for stewart's sanity. */
131
166
UNKNOWN_INDEX = 0;
138
173
message IndexPart {
139
174
required uint32 fieldnr = 1;
140
optional uint32 compare_length = 2;
175
optional int32 compare_length = 2;
141
176
optional bool in_reverse_order = 3 [default = false];
178
optional uint32 key_type = 101; /* THIS MUST DIE. Along with pack_flag*/
181
message IndexOptions {
145
182
optional bool pack_key = 1;
146
183
optional bool binary_pack_key = 2;
147
184
optional bool var_length_key = 3;
157
194
required IndexType type = 4 [default = UNKNOWN_INDEX];
158
195
required uint32 key_length = 5;
159
196
repeated IndexPart index_part = 6;
160
optional Options options= 7;
197
optional IndexOptions options= 7;
161
198
optional string comment = 8;
164
201
required string name = 1;
165
required string schema = 6;
166
202
required TableType type = 5;
167
required Engine engine = 2;
203
required StorageEngine engine = 2;
168
204
repeated Field field = 3;
169
205
repeated Index indexes = 4;
171
207
repeated ForeignKeyConstraint fk_constraint = 8;
172
208
optional TableOptions options = 9;
173
required uint64 creation_timestamp= 11 [default = 0];
174
required uint64 update_timestamp= 12 [default = 0];
175
optional string catalog = 13;
176
optional string uuid = 14;
178
A version value of 0, means that it was never set.
180
optional uint64 version = 15;
184
repeated Table.Field added_field = 1;
209
optional TableStats stats = 10;