Description:
Session A :
mysql> alter table sbtest22 add index idx_pad2(pad);
#alter sql is running
Session B:
#First query
mysql> select * from information_schema.processlist where info is not null;select * from information_schema.processlist where info is not null;
+----------+--------------+--------------------+------+---------+------+----------------+---------------------------------------------------------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+----------+--------------+--------------------+------+---------+------+----------------+---------------------------------------------------------------------+
| 34971045 | root_mysql80 | 172.17.10.21:62131 | tpcc | Query | 28 | altering table | alter table sbtest22 add index idx_pad2(pad) |
| 18193494 | root_mysql80 | 172.17.10.21:61911 | tpcc | Query | 0 | executing | select * from information_schema.processlist where info is not null |
+----------+--------------+--------------------+------+---------+------+----------------+---------------------------------------------------------------------+
2 rows in set (0.04 sec)
+----------+--------------+--------------------+------+---------+------+-----------+---------------------------------------------------------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+----------+--------------+--------------------+------+---------+------+-----------+---------------------------------------------------------------------+
| 18193494 | root_mysql80 | 172.17.10.21:61911 | tpcc | Query | 0 | executing | select * from information_schema.processlist where info is not null |
+----------+--------------+--------------------+------+---------+------+-----------+---------------------------------------------------------------------+
1 row in set (0.10 sec)
#Second query
mysql> select * from information_schema.processlist where info is not null;select * from information_schema.processlist where info is not null;
+----------+--------------+--------------------+------+---------+------+----------------+---------------------------------------------------------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+----------+--------------+--------------------+------+---------+------+----------------+---------------------------------------------------------------------+
| 34971045 | root_mysql80 | 172.17.10.21:62131 | tpcc | Query | 37 | altering table | alter table sbtest22 add index idx_pad2(pad) |
| 18193494 | root_mysql80 | 172.17.10.21:61911 | tpcc | Query | 0 | executing | select * from information_schema.processlist where info is not null |
+----------+--------------+--------------------+------+---------+------+----------------+---------------------------------------------------------------------+
2 rows in set (0.02 sec)
+----------+--------------+--------------------+------+---------+------+-----------+---------------------------------------------------------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+----------+--------------+--------------------+------+---------+------+-----------+---------------------------------------------------------------------+
| 18193494 | root_mysql80 | 172.17.10.21:61911 | tpcc | Query | 0 | executing | select * from information_schema.processlist where info is not null |
+----------+--------------+--------------------+------+---------+------+-----------+---------------------------------------------------------------------+
1 row in set (0.07 sec)
#Third query
mysql> select * from information_schema.processlist where info is not null;select * from information_schema.processlist where info is not null;
+----------+--------------+--------------------+------+---------+------+----------------+---------------------------------------------------------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+----------+--------------+--------------------+------+---------+------+----------------+---------------------------------------------------------------------+
| 34971045 | root_mysql80 | 172.17.10.21:62131 | tpcc | Query | 72 | altering table | alter table sbtest22 add index idx_pad2(pad) |
| 18193494 | root_mysql80 | 172.17.10.21:61911 | tpcc | Query | 0 | executing | select * from information_schema.processlist where info is not null |
+----------+--------------+--------------------+------+---------+------+----------------+---------------------------------------------------------------------+
2 rows in set (0.04 sec)
+----------+--------------+--------------------+------+---------+------+-----------+---------------------------------------------------------------------+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO |
+----------+--------------+--------------------+------+---------+------+-----------+---------------------------------------------------------------------+
| 18193494 | root_mysql80 | 172.17.10.21:61911 | tpcc | Query | 0 | executing | select * from information_schema.processlist where info is not null |
+----------+--------------+--------------------+------+---------+------+-----------+---------------------------------------------------------------------+
1 row in set (0.09 sec)
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.13 |
+-----------+
1 row in set (0.03 sec)
Session A :
mysql> alter table sbtest22 add index idx_pad2(pad);
Query OK, 0 rows affected, 1 warning (1 min 25.76 sec)
How to repeat:
The detailed operation procedure is as above.
A problem about information_schema.processlist table of MySQL 8.0.13:
Why are some active sessions not found in the information_ schema.processlist table?