Bug #104407 Only SHARED_UPGRADABLE can be seen from performance_schema.metadata_locks
Submitted: 24 Jul 2021 11:59 Modified: 6 Sep 2021 12:11
Reporter: d f Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Performance Schema Severity:S4 (Feature request)
Version:8.0.25 OS:Any
Assigned to: CPU Architecture:Any
Tags: metadata_locks,SHARED_UPGRADABLE

[24 Jul 2021 11:59] d f
Description:
When executing online DDL, the performance_schema.metadata_locks can only show SHARED_UPGRADABLE.May be inconsistent with the current locks.

How to repeat:
create database test;
use test;
create table t1(id int key,var1 varchar(100));

drop PROCEDURE if exists insert_in1;
DELIMITER //  
CREATE PROCEDURE insert_in1(in parameter int)  
   begin 
   declare var int;  
   set var=0;  
   while var<parameter do  
   replace into t1 values(var + 1 , var + 2);  
   set var=var+1;  
   end while;  
   end;  
   //  

DELIMITER ;
call insert_in1(10000);

alter table t1 add id2 int;

Other session:
select * from performance_schema.metadata_locks where OBJECT_SCHEMA = "test" and OBJECT_NAME = "t1";
[5 Aug 2021 12:32] MySQL Verification Team
Hi Mr. f,

Thank you for your feature request.

However, with online ALTER TABLE, the only metadata locks that are used is SHARED_UPGRADABLE.

Hence, the question is : What locks should show up ????

Do note that InnoDB locks are not metadata locks !!!!
[6 Sep 2021 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".