mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Change "static int" to enum in classes
This was done when static int where used as bit fields or enums
This commit is contained in:
parent
00946f4331
commit
d82ac8eaaf
6 changed files with 104 additions and 114 deletions
|
@ -1483,13 +1483,15 @@ struct THD_TRANS
|
|||
|
||||
unsigned int m_unsafe_rollback_flags;
|
||||
/*
|
||||
Define the type of statemens which cannot be rolled back safely.
|
||||
Define the type of statements which cannot be rolled back safely.
|
||||
Each type occupies one bit in m_unsafe_rollback_flags.
|
||||
*/
|
||||
static unsigned int const MODIFIED_NON_TRANS_TABLE= 0x01;
|
||||
static unsigned int const CREATED_TEMP_TABLE= 0x02;
|
||||
static unsigned int const DROPPED_TEMP_TABLE= 0x04;
|
||||
static unsigned int const DID_WAIT= 0x08;
|
||||
enum unsafe_statement_types
|
||||
{
|
||||
CREATED_TEMP_TABLE= 2,
|
||||
DROPPED_TEMP_TABLE= 4,
|
||||
DID_WAIT= 8
|
||||
};
|
||||
|
||||
void mark_created_temp_table()
|
||||
{
|
||||
|
|
|
@ -1153,7 +1153,7 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
static const int NUM_BIT_COUNTERS= 64;
|
||||
enum bit_counters { NUM_BIT_COUNTERS= 64 };
|
||||
ulonglong reset_bits,bits;
|
||||
/*
|
||||
Marks whether the function is to be computed as a window function.
|
||||
|
|
|
@ -3459,7 +3459,7 @@ public:
|
|||
|
||||
The three elements in the body repeat COUNT times to form the GTID list.
|
||||
|
||||
At the time of writing, only one flag bit is in use.
|
||||
At the time of writing, only two flag bit are in use.
|
||||
|
||||
Bit 28 of `count' is used for flag FLAG_UNTIL_REACHED, which is sent in a
|
||||
Gtid_list event from the master to the slave to indicate that the START
|
||||
|
@ -3477,9 +3477,12 @@ public:
|
|||
uint64 *sub_id_list;
|
||||
|
||||
static const uint element_size= 4+4+8;
|
||||
static const uint32 FLAG_UNTIL_REACHED= (1<<28);
|
||||
static const uint32 FLAG_IGN_GTIDS= (1<<29);
|
||||
|
||||
/* Upper bits stored in 'count'. See comment above */
|
||||
enum gtid_flags
|
||||
{
|
||||
FLAG_UNTIL_REACHED= (1<<28),
|
||||
FLAG_IGN_GTIDS= (1<<29),
|
||||
};
|
||||
#ifdef MYSQL_SERVER
|
||||
Gtid_list_log_event(rpl_binlog_state *gtid_set, uint32 gl_flags);
|
||||
Gtid_list_log_event(slave_connection_state *gtid_set, uint32 gl_flags);
|
||||
|
|
|
@ -270,8 +270,12 @@ struct slave_connection_state
|
|||
rpl_gtid gtid;
|
||||
uint32 flags;
|
||||
};
|
||||
static const uint32 START_OWN_SLAVE_POS= 0x1;
|
||||
static const uint32 START_ON_EMPTY_DOMAIN= 0x2;
|
||||
/* Bits for 'flags' */
|
||||
enum start_flags
|
||||
{
|
||||
START_OWN_SLAVE_POS= 0x1,
|
||||
START_ON_EMPTY_DOMAIN= 0x2
|
||||
};
|
||||
|
||||
/* Mapping from domain_id to the entry with GTID requested for that domain. */
|
||||
HASH hash;
|
||||
|
|
|
@ -68,23 +68,27 @@ struct group_commit_orderer {
|
|||
*/
|
||||
bool installed;
|
||||
|
||||
/*
|
||||
This flag is set for a GCO in which we have event groups with multiple
|
||||
different commit_id values from the master. This happens when we
|
||||
optimistically try to execute in parallel transactions not known to be
|
||||
conflict-free.
|
||||
enum force_switch_bits
|
||||
{
|
||||
/*
|
||||
This flag is set for a GCO in which we have event groups with multiple
|
||||
different commit_id values from the master. This happens when we
|
||||
optimistically try to execute in parallel transactions not known to be
|
||||
conflict-free.
|
||||
|
||||
When this flag is set, in case of DDL we need to start a new GCO regardless
|
||||
of current commit_id, as DDL is not safe to speculatively apply in parallel
|
||||
with prior event groups.
|
||||
*/
|
||||
static const uint8 MULTI_BATCH = 0x01;
|
||||
/*
|
||||
This flag is set for a GCO that contains DDL. If set, it forces a switch to
|
||||
a new GCO upon seeing a new commit_id, as DDL is not safe to speculatively
|
||||
replicate in parallel with subsequent transactions.
|
||||
*/
|
||||
static const uint8 FORCE_SWITCH = 0x02;
|
||||
When this flag is set, in case of DDL we need to start a new GCO
|
||||
regardless of current commit_id, as DDL is not safe to
|
||||
speculatively apply in parallel with prior event groups.
|
||||
*/
|
||||
MULTI_BATCH= 1,
|
||||
/*
|
||||
This flag is set for a GCO that contains DDL. If set, it forces
|
||||
a switch to a new GCO upon seeing a new commit_id, as DDL is not
|
||||
safe to speculatively replicate in parallel with subsequent
|
||||
transactions.
|
||||
*/
|
||||
FORCE_SWITCH= 2
|
||||
};
|
||||
uint8 flags;
|
||||
};
|
||||
|
||||
|
|
149
sql/sql_alter.h
149
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;
|
||||
|
|
Loading…
Reference in a new issue