@@ -141,43 +141,43 @@ static st_ddl_recovery recovery_state;
141
141
mysql_mutex_t LOCK_gdl;
142
142
143
143
/* Positions to different data in a ddl log block */
144
- # define DDL_LOG_ENTRY_TYPE_POS 0
144
+ static constexpr unsigned DDL_LOG_ENTRY_TYPE_POS= 0 ;
145
145
/*
146
146
Note that ACTION_TYPE and PHASE_POS must be after each other.
147
147
See update_phase()
148
148
*/
149
- # define DDL_LOG_ACTION_TYPE_POS 1
150
- # define DDL_LOG_PHASE_POS 2
151
- # define DDL_LOG_NEXT_ENTRY_POS 4
149
+ static constexpr unsigned DDL_LOG_ACTION_TYPE_POS= 1 ;
150
+ static constexpr unsigned DDL_LOG_PHASE_POS= 2 ;
151
+ static constexpr unsigned DDL_LOG_NEXT_ENTRY_POS= 4 ;
152
152
/* Flags to remember something unique about the query, like if .frm was used */
153
- # define DDL_LOG_FLAG_POS 8
153
+ static constexpr unsigned DDL_LOG_FLAG_POS= 8 ;
154
154
/* Used to store XID entry that was written to binary log */
155
- # define DDL_LOG_XID_POS 10
155
+ static constexpr unsigned DDL_LOG_XID_POS= 10 ;
156
156
/* Used to store unique uuid from the .frm file */
157
- # define DDL_LOG_UUID_POS 18
157
+ static constexpr unsigned DDL_LOG_UUID_POS= 18 ;
158
158
/* ID_POS can be used to store something unique, like file size (4 bytes) */
159
- # define DDL_LOG_ID_POS DDL_LOG_UUID_POS + MY_UUID_SIZE
160
- # define DDL_LOG_END_POS DDL_LOG_ID_POS + 8
159
+ static constexpr unsigned DDL_LOG_ID_POS= DDL_LOG_UUID_POS + MY_UUID_SIZE;
160
+ static constexpr unsigned DDL_LOG_END_POS= DDL_LOG_ID_POS + 8 ;
161
161
162
162
/*
163
163
Position to where names are stored in the ddl log blocks. The current
164
164
value is stored in the header and can thus be changed if we need more
165
165
space for constants in the header than what is between DDL_LOG_ID_POS and
166
166
DDL_LOG_TMP_NAME_POS.
167
167
*/
168
- # define DDL_LOG_TMP_NAME_POS 56
168
+ static constexpr unsigned DDL_LOG_TMP_NAME_POS= 56 ;
169
169
170
170
/* Definitions for the ddl log header, the first block in the file */
171
171
/* IO_SIZE is stored in the header and can thus be changed */
172
- # define DDL_LOG_IO_SIZE IO_SIZE
172
+ static constexpr unsigned DDL_LOG_IO_SIZE= IO_SIZE;
173
173
174
174
/* Header is stored in positions 0-3 */
175
- # define DDL_LOG_IO_SIZE_POS 4
176
- # define DDL_LOG_NAME_OFFSET_POS 6
175
+ static constexpr unsigned DDL_LOG_IO_SIZE_POS= 4 ;
176
+ static constexpr unsigned DDL_LOG_NAME_OFFSET_POS= 6 ;
177
177
/* Marks if we have done a backup of the ddl log */
178
- # define DDL_LOG_BACKUP_OFFSET_POS 8
178
+ static constexpr unsigned DDL_LOG_BACKUP_OFFSET_POS= 8 ;
179
179
/* Sum of the above variables */
180
- # define DDL_LOG_HEADER_SIZE 4 +2 +2 +1
180
+ static constexpr unsigned DDL_LOG_HEADER_SIZE= 4 +2 +2 +1 ;
181
181
182
182
/* *
183
183
Sync the ddl log file.
0 commit comments