@@ -5,7 +5,8 @@ lock table explain_test_db.explain_test_table write;
55# Connection default
66select OBJECT_INSTANCE_BEGIN, OWNER_THREAD_ID, OWNER_EVENT_ID
77from performance_schema.metadata_locks
8- where OBJECT_SCHEMA = 'explain_test_db'
8+ where OBJECT_TYPE = 'TABLE'
9+ and OBJECT_SCHEMA = 'explain_test_db'
910 and OBJECT_NAME = 'explain_test_table'
1011 and LOCK_STATUS = 'GRANTED'
1112 into @oib, @o_tid, @o_eid;
@@ -50,7 +51,7 @@ LOCK_TYPE
5051OK: handler_read_key incremented
5152
5253====================================================================
53- Testing index for columns OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME
54+ Testing index for columns OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, COLUMN_NAME
5455====================================================================
5556############ Explain for Query ####################################
5657explain select LOCK_TYPE
@@ -151,15 +152,60 @@ and OBJECT_SCHEMA = "explain_test_db"
151152and OBJECT_NAME = "explain_test_table";
152153id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1531541 SIMPLE metadata_locks NULL ref OBJECT_TYPE OBJECT_TYPE 584 const,const,const # 100.00 NULL
155+ ############ Explain for Query ####################################
156+ explain select LOCK_TYPE
157+ from performance_schema.metadata_locks
158+ where OBJECT_TYPE = "impossible"
159+ and OBJECT_SCHEMA = "impossible"
160+ and OBJECT_NAME = "impossible"
161+ and COLUMN_NAME = "impossible";
162+ id select_type table partitions type possible_keys key key_len ref rows filtered Extra
163+ 1 SIMPLE metadata_locks NULL ref OBJECT_TYPE OBJECT_TYPE 779 const,const,const,const # 100.00 NULL
164+ ############ Explain for Query ####################################
165+ explain select LOCK_TYPE
166+ from performance_schema.metadata_locks
167+ where OBJECT_TYPE = "TABLE"
168+ and OBJECT_SCHEMA = "explain_test_db"
169+ and OBJECT_NAME = "explain_test_table"
170+ and COLUMN_NAME = "impossible";
171+ id select_type table partitions type possible_keys key key_len ref rows filtered Extra
172+ 1 SIMPLE metadata_locks NULL ref OBJECT_TYPE OBJECT_TYPE 779 const,const,const,const # 100.00 NULL
173+ ############ Explain for Query ####################################
174+ explain select LOCK_TYPE
175+ from performance_schema.metadata_locks
176+ where OBJECT_TYPE = "TABLE"
177+ and OBJECT_SCHEMA = "explain_test_db"
178+ and OBJECT_NAME = "explain_test_table"
179+ and COLUMN_NAME > "impossible";
180+ id select_type table partitions type possible_keys key key_len ref rows filtered Extra
181+ 1 SIMPLE metadata_locks NULL ref OBJECT_TYPE OBJECT_TYPE 584 const,const,const # 33.33 Using where
182+ ############ Explain for Query ####################################
183+ explain select LOCK_TYPE
184+ from performance_schema.metadata_locks
185+ where OBJECT_TYPE = "TABLE"
186+ and OBJECT_SCHEMA = "explain_test_db"
187+ and OBJECT_NAME = "explain_test_table"
188+ and COLUMN_NAME < "impossible";
189+ id select_type table partitions type possible_keys key key_len ref rows filtered Extra
190+ 1 SIMPLE metadata_locks NULL ref OBJECT_TYPE OBJECT_TYPE 584 const,const,const # 33.33 Using where
191+ ############ Explain for Query ####################################
192+ explain select LOCK_TYPE
193+ from performance_schema.metadata_locks
194+ where OBJECT_TYPE = "TABLE"
195+ and OBJECT_SCHEMA = "explain_test_db"
196+ and OBJECT_NAME = "explain_test_table"
197+ and COLUMN_NAME = "a";
198+ id select_type table partitions type possible_keys key key_len ref rows filtered Extra
199+ 1 SIMPLE metadata_locks NULL ref OBJECT_TYPE OBJECT_TYPE 779 const,const,const,const # 100.00 NULL
154200############# Explain End #########################################
155201flush status;
156202select LOCK_TYPE
157203from performance_schema.metadata_locks
158204where OBJECT_TYPE = "TABLE"
159205and OBJECT_SCHEMA = "explain_test_db"
160- and OBJECT_NAME = "explain_test_table";
206+ and OBJECT_NAME = "explain_test_table"
207+ and COLUMN_NAME = "a";
161208LOCK_TYPE
162- #
163209OK: handler_read_key incremented
164210
165211====================================================================
0 commit comments