diff options
author | Michael Widenius <monty@mariadb.org> | 2017-04-16 17:14:41 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2017-04-18 12:23:40 +0300 |
commit | d82ac8eaafd89a6a74436747b660ef02c69eaac3 (patch) | |
tree | b166cd3450d894407d4e269d1ea1c834d75c67dc /sql/sql_alter.h | |
parent | 00946f43310f528003251c7f3934966eff2a8089 (diff) | |
download | mariadb-git-d82ac8eaafd89a6a74436747b660ef02c69eaac3.tar.gz |
Change "static int" to enum in classes
This was done when static int where used as bit fields or enums
Diffstat (limited to 'sql/sql_alter.h')
-rw-r--r-- | sql/sql_alter.h | 149 |
1 files changed, 63 insertions, 86 deletions
diff --git a/sql/sql_alter.h b/sql/sql_alter.h index 5668a0f52be..4650e2b6a25 100644 --- a/sql/sql_alter.h +++ b/sql/sql_alter.h @@ -38,91 +38,65 @@ public: type of index to be added/dropped. */ - // Set for ADD [COLUMN] - static const uint ALTER_ADD_COLUMN = 1L << 0; - - // Set for DROP [COLUMN] - static const uint ALTER_DROP_COLUMN = 1L << 1; - - // Set for CHANGE [COLUMN] | MODIFY [CHANGE] - // Set by mysql_recreate_table() - static const uint ALTER_CHANGE_COLUMN = 1L << 2; - - // Set for ADD INDEX | ADD KEY | ADD PRIMARY KEY | ADD UNIQUE KEY | - // ADD UNIQUE INDEX | ALTER ADD [COLUMN] - static const uint ALTER_ADD_INDEX = 1L << 3; - - // Set for DROP PRIMARY KEY | DROP FOREIGN KEY | DROP KEY | DROP INDEX - static const uint ALTER_DROP_INDEX = 1L << 4; - - // Set for RENAME [TO] - static const uint ALTER_RENAME = 1L << 5; - - // Set for ORDER BY - static const uint ALTER_ORDER = 1L << 6; - - // Set for table_options - static const uint ALTER_OPTIONS = 1L << 7; - - // Set for ALTER [COLUMN] ... SET DEFAULT ... | DROP DEFAULT - static const uint ALTER_CHANGE_COLUMN_DEFAULT = 1L << 8; - - // Set for DISABLE KEYS | ENABLE KEYS - static const uint ALTER_KEYS_ONOFF = 1L << 9; - - // Set for FORCE - // Set for ENGINE(same engine) - // Set by mysql_recreate_table() - static const uint ALTER_RECREATE = 1L << 10; - - // Set for ADD PARTITION - static const uint ALTER_ADD_PARTITION = 1L << 11; - - // Set for DROP PARTITION - static const uint ALTER_DROP_PARTITION = 1L << 12; - - // Set for COALESCE PARTITION - static const uint ALTER_COALESCE_PARTITION = 1L << 13; - - // Set for REORGANIZE PARTITION ... INTO - static const uint ALTER_REORGANIZE_PARTITION = 1L << 14; - - // Set for partition_options - static const uint ALTER_PARTITION = 1L << 15; - - // Set for LOAD INDEX INTO CACHE ... PARTITION - // Set for CACHE INDEX ... PARTITION - static const uint ALTER_ADMIN_PARTITION = 1L << 16; - - // Set for REORGANIZE PARTITION - static const uint ALTER_TABLE_REORG = 1L << 17; - - // Set for REBUILD PARTITION - static const uint ALTER_REBUILD_PARTITION = 1L << 18; - - // Set for partitioning operations specifying ALL keyword - static const uint ALTER_ALL_PARTITION = 1L << 19; - - // Set for REMOVE PARTITIONING - static const uint ALTER_REMOVE_PARTITIONING = 1L << 20; - - // Set for ADD FOREIGN KEY - static const uint ADD_FOREIGN_KEY = 1L << 21; - - // Set for DROP FOREIGN KEY - static const uint DROP_FOREIGN_KEY = 1L << 22; - - // Set for EXCHANGE PARITION - static const uint ALTER_EXCHANGE_PARTITION = 1L << 23; - - // Set by Sql_cmd_alter_table_truncate_partition::execute() - static const uint ALTER_TRUNCATE_PARTITION = 1L << 24; - - // Set for ADD [COLUMN] FIRST | AFTER - static const uint ALTER_COLUMN_ORDER = 1L << 25; - - static const uint ALTER_ADD_CHECK_CONSTRAINT = 1L << 27; - static const uint ALTER_DROP_CHECK_CONSTRAINT = 1L << 28; + enum operations_used_flags + { + // Set for ADD [COLUMN] + ALTER_ADD_COLUMN = 1L << 0, + // Set for DROP [COLUMN] + ALTER_DROP_COLUMN = 1L << 1, + // Set for CHANGE [COLUMN] | MODIFY [CHANGE] & mysql_recreate_table + ALTER_CHANGE_COLUMN = 1L << 2, + // Set for ADD INDEX | ADD KEY | ADD PRIMARY KEY | ADD UNIQUE KEY | + // ADD UNIQUE INDEX | ALTER ADD [COLUMN] + ALTER_ADD_INDEX = 1L << 3, + // Set for DROP PRIMARY KEY | DROP FOREIGN KEY | DROP KEY | DROP INDEX + ALTER_DROP_INDEX = 1L << 4, + // Set for RENAME [TO] + ALTER_RENAME = 1L << 5, + // Set for ORDER BY + ALTER_ORDER = 1L << 6, + // Set for table_options + ALTER_OPTIONS = 1L << 7, + // Set for ALTER [COLUMN] ... SET DEFAULT ... | DROP DEFAULT + ALTER_CHANGE_COLUMN_DEFAULT = 1L << 8, + // Set for DISABLE KEYS | ENABLE KEYS + ALTER_KEYS_ONOFF = 1L << 9, + // Set for FORCE, ENGINE(same engine), by mysql_recreate_table() + ALTER_RECREATE = 1L << 10, + // Set for ADD PARTITION + ALTER_ADD_PARTITION = 1L << 11, + // Set for DROP PARTITION + ALTER_DROP_PARTITION = 1L << 12, + // Set for COALESCE PARTITION + ALTER_COALESCE_PARTITION = 1L << 13, + // Set for REORGANIZE PARTITION ... INTO + ALTER_REORGANIZE_PARTITION = 1L << 14, + // Set for partition_options + ALTER_PARTITION = 1L << 15, + // Set for LOAD INDEX INTO CACHE ... PARTITION + // Set for CACHE INDEX ... PARTITION + ALTER_ADMIN_PARTITION = 1L << 16, + // Set for REORGANIZE PARTITION + ALTER_TABLE_REORG = 1L << 17, + // Set for REBUILD PARTITION + ALTER_REBUILD_PARTITION = 1L << 18, + // Set for partitioning operations specifying ALL keyword + ALTER_ALL_PARTITION = 1L << 19, + // Set for REMOVE PARTITIONING + ALTER_REMOVE_PARTITIONING = 1L << 20, + // Set for ADD FOREIGN KEY + ADD_FOREIGN_KEY = 1L << 21, + // Set for DROP FOREIGN KEY + DROP_FOREIGN_KEY = 1L << 22, + // Set for EXCHANGE PARITION + ALTER_EXCHANGE_PARTITION = 1L << 23, + // Set by Sql_cmd_alter_table_truncate_partition::execute() + ALTER_TRUNCATE_PARTITION = 1L << 24, + // Set for ADD [COLUMN] FIRST | AFTER + ALTER_COLUMN_ORDER = 1L << 25, + ALTER_ADD_CHECK_CONSTRAINT = 1L << 27, + ALTER_DROP_CHECK_CONSTRAINT = 1L << 28 + }; enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE }; @@ -172,7 +146,10 @@ public: // List of columns, used by both CREATE and ALTER TABLE. List<Create_field> create_list; - static const uint CHECK_CONSTRAINT_IF_NOT_EXISTS= 1; + enum flags_bits + { + CHECK_CONSTRAINT_IF_NOT_EXISTS= 1 + }; List<Virtual_column_info> check_constraint_list; // Type of ALTER TABLE operation. uint flags; |