~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/alter_table.proto

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
  Message format for ALTER TABLE commands.
3
 
*/
4
 
package drizzled.message;
5
 
option optimize_for = SPEED;
6
 
 
7
 
option java_package = "org.drizzle.messages";
8
 
option java_outer_classname = "AlterTableMessage";
9
 
 
10
 
message AlterTable {
11
 
  optional string catalog = 1;
12
 
  required string schema = 2;
13
 
  required string name = 3;
14
 
 
15
 
  enum BuildMethod {
16
 
    BUILD_DEFAULT = 0;
17
 
    BUILD_ONLINE  = 1;
18
 
    BUILD_OFFLINE = 2;
19
 
  }
20
 
      
21
 
   required BuildMethod build_method = 4 [default = BUILD_DEFAULT];
22
 
 
23
 
   required bool ignore = 5 [ default = false ];
24
 
 
25
 
   message AlterTableOperation {
26
 
     enum Operation {
27
 
       /* Currently, the only valid DISCARD_TABLESPACE or IMPORT_TABLESPACE
28
 
          ALTER TABLE operation is as the first and only operation */
29
 
       DISCARD_TABLESPACE = 0;
30
 
       IMPORT_TABLESPACE = 1;
31
 
       DROP_KEY = 2; /* uses drop_name */
32
 
       DROP_COLUMN = 3; /* uses drop_name */
33
 
       DROP_FOREIGN_KEY = 4; /* uses drop_name */
34
 
     }
35
 
 
36
 
     required Operation operation = 1;
37
 
 
38
 
     optional string drop_name = 2;;
39
 
   }
40
 
 
41
 
  repeated AlterTableOperation operations = 6; 
42
 
 
43
 
  message RenameTable {
44
 
    required string to_schema = 1;
45
 
    required string to_name = 2;
46
 
  }
47
 
 
48
 
  message AlterKeysOnOff {
49
 
    required bool enable = 1;
50
 
  }
51
 
 
52
 
  /* RenameTable and AlterKeysOnOff are weird as they can only exist once,
53
 
     and only exist as what the last one in a ALTER TABLE statement does.
54
 
     i.e. from SQL the following is valid:
55
 
     CREATE TABLE t1 (a int);
56
 
     CREATE TABLE t2 (a int);
57
 
     ALTER TABLE t1 RENAME t2, RENAME t3;
58
 
     (t1 is renamed to t3 without error or warning).
59
 
     We can argue if this is insanity or not, but that's current behaviour.
60
 
  */
61
 
  optional RenameTable rename = 7;
62
 
  optional AlterKeysOnOff alter_keys_onoff = 8;
63
 
}