@@ -133,12 +133,7 @@ class MDL_context_owner
133133
134134enum enum_mdl_type {
135135 /* This means that the MDL_request is not initialized */
136- /*
137- TODO (newbie): should be MDL_NOT_INITIALIZED= 0, as it is strange
138- that not-inited request has MDL_INTENTION_EXCLUSIVE.
139- Must fix tests, as at least mysql_rm_table_no_locks() depends on this.
140- */
141- MDL_NOT_INITIALIZED= -1 ,
136+ MDL_NOT_INITIALIZED= 0 ,
142137 /*
143138 An intention exclusive metadata lock (IX). Used only for scoped locks.
144139 Owner of this type of lock can acquire upgradable exclusive locks on
@@ -149,7 +144,7 @@ enum enum_mdl_type {
149144 object metadata. Object may refer table, stored procedure, trigger,
150145 view/etc.
151146 */
152- MDL_INTENTION_EXCLUSIVE= 0 ,
147+ MDL_INTENTION_EXCLUSIVE,
153148 /*
154149 A shared metadata lock (S).
155150 To be used in cases when we are interested in object metadata only
@@ -273,51 +268,51 @@ enum enum_mdl_type {
273268/* *
274269 Block concurrent backup
275270*/
276- #define MDL_BACKUP_START enum_mdl_type (0 )
271+ #define MDL_BACKUP_START enum_mdl_type (1 )
277272/* *
278273 Block new write requests to non transactional tables
279274*/
280- #define MDL_BACKUP_FLUSH enum_mdl_type (1 )
275+ #define MDL_BACKUP_FLUSH enum_mdl_type (2 )
281276/* *
282277 In addition to previous locks, blocks running requests to non trans tables
283278 Used to wait until all DML usage of on trans tables are finished
284279*/
285- #define MDL_BACKUP_WAIT_FLUSH enum_mdl_type (2 )
280+ #define MDL_BACKUP_WAIT_FLUSH enum_mdl_type (3 )
286281/* *
287282 In addition to previous locks, blocks new DDL's from starting
288283*/
289- #define MDL_BACKUP_WAIT_DDL enum_mdl_type (3 )
284+ #define MDL_BACKUP_WAIT_DDL enum_mdl_type (4 )
290285/* *
291286 In addition to previous locks, blocks commits
292287*/
293- #define MDL_BACKUP_WAIT_COMMIT enum_mdl_type (4 )
288+ #define MDL_BACKUP_WAIT_COMMIT enum_mdl_type (5 )
294289
295290/* *
296291 Blocks (or is blocked by) statements that intend to modify data. Acquired
297292 before commit lock by FLUSH TABLES WITH READ LOCK.
298293*/
299- #define MDL_BACKUP_FTWRL1 enum_mdl_type (5 )
294+ #define MDL_BACKUP_FTWRL1 enum_mdl_type (6 )
300295
301296/* *
302297 Blocks (or is blocked by) commits. Acquired after global read lock by
303298 FLUSH TABLES WITH READ LOCK.
304299*/
305- #define MDL_BACKUP_FTWRL2 enum_mdl_type (6 )
300+ #define MDL_BACKUP_FTWRL2 enum_mdl_type (7 )
306301
307- #define MDL_BACKUP_DML enum_mdl_type (7 )
308- #define MDL_BACKUP_TRANS_DML enum_mdl_type (8 )
309- #define MDL_BACKUP_SYS_DML enum_mdl_type (9 )
302+ #define MDL_BACKUP_DML enum_mdl_type (8 )
303+ #define MDL_BACKUP_TRANS_DML enum_mdl_type (9 )
304+ #define MDL_BACKUP_SYS_DML enum_mdl_type (10 )
310305
311306/* *
312307 Must be acquired by DDL statements that intend to modify data.
313308 Currently it's also used for LOCK TABLES.
314309*/
315- #define MDL_BACKUP_DDL enum_mdl_type (10 )
310+ #define MDL_BACKUP_DDL enum_mdl_type (11 )
316311
317312/* *
318313 Blocks new DDL's. Used by backup code to enable DDL logging
319314*/
320- #define MDL_BACKUP_BLOCK_DDL enum_mdl_type (11 )
315+ #define MDL_BACKUP_BLOCK_DDL enum_mdl_type (12 )
321316
322317/*
323318 Statement is modifying data, but will not block MDL_BACKUP_DDL or earlier
@@ -326,13 +321,13 @@ enum enum_mdl_type {
326321 MDL_BACKUP_ALTER_COPY while alter table is copying or modifying data.
327322*/
328323
329- #define MDL_BACKUP_ALTER_COPY enum_mdl_type (12 )
324+ #define MDL_BACKUP_ALTER_COPY enum_mdl_type (13 )
330325
331326/* *
332327 Must be acquired during commit.
333328*/
334- #define MDL_BACKUP_COMMIT enum_mdl_type (13 )
335- #define MDL_BACKUP_END enum_mdl_type (14 )
329+ #define MDL_BACKUP_COMMIT enum_mdl_type (14 )
330+ #define MDL_BACKUP_END enum_mdl_type (15 )
336331
337332
338333/* * Duration of metadata lock. */
@@ -394,12 +389,9 @@ struct MDL_key
394389 Note that although there isn't metadata locking on triggers,
395390 it's necessary to have a separate namespace for them since
396391 MDL_key is also used outside of the MDL subsystem.
397-
398- TODO (newbie): NOT_INITIALIZED=0 as default bzero() sets wrongly type to
399- BACKUP. But dozens switch() cases for NOT_INITIALIZED must be added to
400- pacify the compiler.
401392 */
402- enum enum_mdl_namespace { BACKUP=0 ,
393+ enum enum_mdl_namespace { NOT_INITIALIZED=0 ,
394+ BACKUP,
403395 SCHEMA,
404396 TABLE,
405397 FUNCTION,
0 commit comments