~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/table.proto

Merge Revision revid:marko.makela@oracle.com-20100514133144-fe0l0b89tea4x4uu from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100514133144-fe0l0b89tea4x4uu

Original Authors: Marko Mkel <marko.makela@oracle.com>
Original commit message:
Merge from mysql-5.1-innodb:

Post-merge fixes: Remove the MYSQL_VERSION_ID checks, because they only
apply to the InnoDB Plugin. Fix potential race condition accessing
trx->op_info and trx->detailed_error.
------------------------------------------------------------
revno: 3466
revision-id: marko.makela@oracle.com-20100514130815-ym7j7cfu88ro6km4
parent: marko.makela@oracle.com-20100514130228-n3n42nw7ht78k0wn
committer: Marko Mkel <marko.makela@oracle.com>
branch nick: mysql-5.1-innodb2
timestamp: Fri 2010-05-14 16:08:15 +0300
message:
  Make the InnoDB FOREIGN KEY parser understand multi-statements. (Bug #48024)
  Also make InnoDB thinks that /*/ only starts a comment. (Bug #53644).

  This fixes the bugs in the InnoDB Plugin.

  ha_innodb.h: Use trx_query_string() instead of trx_query() when
  available (MySQL 5.1.42 or later).

  innobase_get_stmt(): New function, to retrieve the currently running
  SQL statement.

  struct trx_struct: Remove mysql_query_str. Use innobase_get_stmt() instead.

  dict_strip_comments(): Add and observe the parameter sql_length. Treat
  /*/ as the start of a comment.

  dict_create_foreign_constraints(), row_table_add_foreign_constraints():
  Add the parameter sql_length.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package drizzle;
 
1
/*
 
2
  Message format for tables.
 
3
*/
 
4
package drizzled.message;
 
5
option optimize_for = SPEED;
 
6
 
 
7
option java_package = "org.drizzle.messages";
 
8
option java_outer_classname = "TableMessage";
 
9
 
 
10
import "engine.proto";
2
11
 
3
12
message Table {
4
13
 
5
14
  enum TableType {
6
15
    STANDARD = 0;
7
16
    TEMPORARY = 1;
8
 
  }
9
 
 
10
 
  message StorageEngine {
11
 
 
12
 
    message EngineOption {
13
 
      enum EngineOptionType {
14
 
        BOOL = 0;
15
 
        INTEGER = 1;
16
 
        STRING = 2;
17
 
      }
18
 
 
19
 
      required string name = 1;
20
 
      required string value = 2;
21
 
      required EngineOptionType type = 3;
22
 
    }
23
 
 
24
 
    required string name = 1;
25
 
    repeated EngineOption option = 2;
 
17
    INTERNAL = 2;
 
18
    FUNCTION = 3;
26
19
  }
27
20
 
28
21
  message TableOptions {
29
 
    optional uint64 auto_increment = 1;
 
22
    optional bool has_user_set_auto_increment_value = 1;
30
23
    optional string collation = 2;
31
24
    optional uint32 collation_id = 3;
32
 
    optional string connect_string = 4;
33
25
    optional string data_file_name = 5;
34
26
    optional string index_file_name = 6;
35
27
    optional uint64 max_rows = 7;
36
28
    optional uint64 min_rows = 8;
37
29
    optional uint64 auto_increment_value = 9;
38
 
    optional uint32 table_options = 10;
39
30
    optional uint32 avg_row_length = 11;
40
 
    optional uint32 used_fields = 12;
41
 
    optional uint32 key_block_size = 13;
42
 
    optional uint32 block_size = 14;
43
 
    optional string comment = 15;
44
 
  }
45
 
 
46
 
  message TableStats {
47
 
    optional uint32 avg_row_length = 1;
48
 
    optional uint64 max_rows = 2;
49
 
    optional uint32 min_rows = 3;
 
31
    optional uint32 block_size = 13;
 
32
    optional string comment = 14;
 
33
    optional bool pack_record = 16;
 
34
    optional bool checksum = 17;
 
35
    optional bool page_checksum = 18;
 
36
    optional bool delay_key_write = 19;
50
37
  }
51
38
 
52
39
  message ForeignKeyConstraint {
53
 
    required string name = 1;
54
 
    required Field dependent = 2;
55
 
    required Field parent = 3;
56
 
    /** @TODO Finish this off... */
 
40
    optional string name = 1;
 
41
    repeated string column_names = 2;
 
42
    required string references_table_name = 3;
 
43
    repeated string references_columns = 4;
 
44
 
 
45
    enum ForeignKeyMatchOption {
 
46
      MATCH_UNDEFINED = 0;
 
47
      MATCH_FULL = 1;
 
48
      MATCH_PARTIAL = 2;
 
49
      MATCH_SIMPLE = 3;
 
50
    }
 
51
    required ForeignKeyMatchOption match = 5;
 
52
 
 
53
    enum ForeignKeyOption {
 
54
      OPTION_UNDEF = 0;
 
55
      OPTION_RESTRICT = 1;
 
56
      OPTION_CASCADE = 2;
 
57
      OPTION_SET_NULL = 3;
 
58
      OPTION_NO_ACTION = 4;
 
59
      OPTION_SET_DEFAULT = 5;
 
60
    }
 
61
 
 
62
    required ForeignKeyOption update_option = 6 [ default = OPTION_UNDEF ];
 
63
    required ForeignKeyOption delete_option = 7 [ default = OPTION_UNDEF ];
57
64
  }
58
65
 
59
66
  message Field {
61
68
    enum FieldType {
62
69
      DOUBLE = 0;
63
70
      VARCHAR = 1;
64
 
      TEXT = 2;
65
 
      BLOB = 3;
66
 
      ENUM = 4;
67
 
      INTEGER = 5;
68
 
      BIGINT = 6;
69
 
      DECIMAL = 7;
70
 
      DATE = 8;
71
 
      TIME = 9;
72
 
      TIMESTAMP = 10;
73
 
      DATETIME = 11;
74
 
      TINYINT = 12;
 
71
      BLOB = 2;
 
72
      ENUM = 3;
 
73
      INTEGER = 4;
 
74
      BIGINT = 5;
 
75
      DECIMAL = 6;
 
76
      DATE = 7;
 
77
      TIMESTAMP = 9;
 
78
      DATETIME = 10;
75
79
    }
76
80
 
77
81
    message FieldOptions {
78
82
      optional string default_value = 1;
79
 
    }
80
 
 
81
 
    message TimestampFieldOptions {
82
 
      optional bool auto_updates = 1 [default = false];
 
83
      optional string update_value = 2;
 
84
      optional bool default_null = 3 [default = false];
 
85
      optional bytes default_bin_value = 4;
 
86
      optional string default_expression = 5;
 
87
      optional string update_expression = 6;
83
88
    }
84
89
 
85
90
    message FieldConstraints {
86
 
      required bool is_nullable = 1 [default = false];
 
91
      required bool is_nullable = 1 [default = true];
87
92
      optional bool is_unsigned = 2 [default = false];
88
93
      repeated string expression = 16; /* Reserve 0-15 for frequenty accessed attributes */
89
94
    }
90
95
 
91
96
    message NumericFieldOptions {
92
97
      optional bool is_autoincrement = 1 [default = false];
93
 
      optional int32 length = 2;
94
 
      optional int32 scale = 3;
95
 
      optional int32 precision = 4;
 
98
      optional uint32 scale = 2;
 
99
      optional uint32 precision = 3;
96
100
    }
97
101
 
98
102
    message StringFieldOptions {
99
103
      optional bool is_fixed_width = 1 [default = false];
100
 
      optional int32 length = 2;
 
104
      optional uint32 length = 2;
101
105
      optional uint32 collation_id = 3;
102
106
      optional string collation = 4;
103
107
    }
104
108
 
105
 
    message SetFieldOptions {
106
 
      required int32 count_elements = 1;
107
 
      repeated string value = 2;
 
109
    message EnumerationValues {
 
110
      optional uint32 collation_id = 2;
 
111
      optional string collation = 3;
 
112
      repeated string field_value = 4;
108
113
    }
109
114
 
110
115
    required string name = 1;
111
116
    required FieldType type = 2;
112
 
    optional FieldOptions options = 3;
113
 
    optional FieldConstraints constraints = 4;
114
 
    optional NumericFieldOptions numeric_options = 5;
115
 
    optional StringFieldOptions string_options = 6;
 
117
    optional FieldOptions options = 4;
 
118
    optional FieldConstraints constraints = 5;
 
119
    optional NumericFieldOptions numeric_options = 6;
 
120
    optional StringFieldOptions string_options = 7;
 
121
 
116
122
    optional string comment = 16; /* Reserve 0-15 for frequently accessed attributes */
117
 
    optional SetFieldOptions set_options = 17;
118
 
    optional TimestampFieldOptions timestamp_options = 18;
 
123
    optional EnumerationValues enumeration_values = 17;
119
124
  }
120
125
 
121
126
  message Index {
122
127
 
123
128
    enum IndexType {
 
129
    /* Kept in sync with enum ha_key_alg if only for stewart sanity. */
124
130
      UNKNOWN_INDEX = 0;
125
 
      HASH = 1;
126
 
      BTREE = 2;
 
131
      BTREE = 1;
 
132
      RTREE = 2;
 
133
      HASH  = 3;
 
134
      FULLTEXT = 4;
127
135
    }
128
136
 
129
137
    message IndexPart {
130
 
      required Field field = 1;
131
 
      optional int32 compare_length = 2;
 
138
      required uint32 fieldnr = 1;
 
139
      optional uint32 compare_length = 2;
132
140
      optional bool in_reverse_order = 3 [default = false];
133
141
    }
134
142
 
 
143
    message Options {
 
144
      optional bool pack_key = 1;
 
145
      optional bool binary_pack_key = 2;
 
146
      optional bool var_length_key = 3;
 
147
      optional bool null_part_key = 4;
 
148
      optional uint32 key_block_size = 5;
 
149
      optional bool has_partial_segments =6;
 
150
      optional bool auto_generated_key = 7;
 
151
    }      
 
152
 
135
153
    required string name = 1;
136
154
    required bool is_primary = 2;
137
155
    required bool is_unique = 3;
138
156
    required IndexType type = 4 [default = UNKNOWN_INDEX];
139
 
    repeated IndexPart index_part = 5;
140
 
    optional string comment = 6;
 
157
    required uint32 key_length = 5;
 
158
    repeated IndexPart index_part = 6;
 
159
    optional Options options= 7;
 
160
    optional string comment = 8;
141
161
  }
142
162
 
143
163
  required string name = 1;
 
164
  required string schema = 6;
144
165
  required TableType type = 5;
145
 
  required StorageEngine engine = 2;
 
166
  required Engine engine = 2;
146
167
  repeated Field field = 3;
147
 
  repeated Index index = 4;
 
168
  repeated Index indexes = 4;
148
169
 
149
170
  repeated ForeignKeyConstraint fk_constraint = 8;
150
171
  optional TableOptions options = 9;
151
 
  optional TableStats stats = 10;
 
172
  required uint64 creation_timestamp= 11 [default = 0];
 
173
  required uint64 update_timestamp= 12 [default = 0];
 
174
  optional string catalog = 13;
 
175
  optional string uuid = 14;
 
176
  /*
 
177
    A version value of 0, means that it was never set.
 
178
    */
 
179
  optional uint64 version = 15;
152
180
}
153
181
 
154
 
message TableList {
155
 
  repeated Table table = 1;
 
182
message AlterTable {
 
183
  repeated Table.Field added_field = 1;
156
184
}