16 #ifndef SQL_ALTER_TABLE_H
17 #define SQL_ALTER_TABLE_H
42 static const uint ALTER_ADD_COLUMN = 1L << 0;
45 static const uint ALTER_DROP_COLUMN = 1L << 1;
49 static const uint ALTER_CHANGE_COLUMN = 1L << 2;
53 static const uint ALTER_ADD_INDEX = 1L << 3;
56 static const uint ALTER_DROP_INDEX = 1L << 4;
59 static const uint ALTER_RENAME = 1L << 5;
62 static const uint ALTER_ORDER = 1L << 6;
65 static const uint ALTER_OPTIONS = 1L << 7;
68 static const uint ALTER_CHANGE_COLUMN_DEFAULT = 1L << 8;
71 static const uint ALTER_KEYS_ONOFF = 1L << 9;
74 static const uint ALTER_CONVERT = 1L << 10;
78 static const uint ALTER_RECREATE = 1L << 11;
81 static const uint ALTER_ADD_PARTITION = 1L << 12;
84 static const uint ALTER_DROP_PARTITION = 1L << 13;
87 static const uint ALTER_COALESCE_PARTITION = 1L << 14;
90 static const uint ALTER_REORGANIZE_PARTITION = 1L << 15;
93 static const uint ALTER_PARTITION = 1L << 16;
97 static const uint ALTER_ADMIN_PARTITION = 1L << 17;
100 static const uint ALTER_TABLE_REORG = 1L << 18;
103 static const uint ALTER_REBUILD_PARTITION = 1L << 19;
106 static const uint ALTER_ALL_PARTITION = 1L << 20;
109 static const uint ALTER_REMOVE_PARTITIONING = 1L << 21;
112 static const uint ADD_FOREIGN_KEY = 1L << 22;
115 static const uint DROP_FOREIGN_KEY = 1L << 23;
118 static const uint ALTER_EXCHANGE_PARTITION = 1L << 24;
121 static const uint ALTER_TRUNCATE_PARTITION = 1L << 25;
124 static const uint ALTER_COLUMN_ORDER = 1L << 26;
127 enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
136 ALTER_TABLE_ALGORITHM_DEFAULT,
139 ALTER_TABLE_ALGORITHM_INPLACE,
142 ALTER_TABLE_ALGORITHM_COPY
153 ALTER_TABLE_LOCK_DEFAULT,
156 ALTER_TABLE_LOCK_NONE,
159 ALTER_TABLE_LOCK_SHARED,
162 ALTER_TABLE_LOCK_EXCLUSIVE
177 enum_enable_or_disable keys_onoff;
190 keys_onoff(LEAVE_AS_IS),
192 requested_algorithm(ALTER_TABLE_ALGORITHM_DEFAULT),
193 requested_lock(ALTER_TABLE_LOCK_DEFAULT)
203 keys_onoff= LEAVE_AS_IS;
205 partition_names.empty();
206 requested_algorithm= ALTER_TABLE_ALGORITHM_DEFAULT;
207 requested_lock= ALTER_TABLE_LOCK_DEFAULT;
266 char *new_db_arg,
char *new_name_arg);
272 {
return (new_db != db); };
285 DBUG_ASSERT(!tmp_table);
294 DBUG_ASSERT(!tmp_table);
303 DBUG_ASSERT(!tmp_table);
326 bool error_if_not_empty;
347 char new_filename[FN_REFLEN + 1];
348 char new_alias_buff[FN_REFLEN + 1];
349 char path[FN_REFLEN + 1];
350 char new_path[FN_REFLEN + 1];
351 char tmp_path[FN_REFLEN + 1];
382 return SQLCOM_ALTER_TABLE;
413 enum enum_tablespace_op_type
415 DISCARD_TABLESPACE, IMPORT_TABLESPACE
419 : m_tablespace_op(tablespace_op_arg)
425 const enum_tablespace_op_type m_tablespace_op;