Commit 9b2151f6 authored by Nirbhay Choubey's avatar Nirbhay Choubey

metadata_lock_info: Add compile time assertions

This is to ensure that the list of valid values for
METADATA_LOCK_INFO fields is always kept in sync with
the parent MDL types.
parent 7abb5707
......@@ -131,6 +131,14 @@ int i_s_metadata_lock_info_fill_table(
static int i_s_metadata_lock_info_init(
void *p
) {
compile_time_assert(sizeof(metadata_lock_info_lock_name)/sizeof(LEX_STRING)
== MDL_key::NAMESPACE_END);
compile_time_assert(sizeof(metadata_lock_info_lock_mode)/sizeof(LEX_STRING)
== MDL_TYPE_END);
compile_time_assert(sizeof(metadata_lock_info_duration)/sizeof(LEX_STRING)
== MDL_DURATION_END);
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p;
DBUG_ENTER("i_s_metadata_lock_info_init");
schema->fields_info = i_s_metadata_lock_info_fields_info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment