WL#2950: MySQL plugin interface: SHOW PLUGINS

Affects: Server-5.1   —   Status: Complete

Implement SHOW PLUGINS command. 
It shows soname, plugin name, author/description, plugin type, plugin status. 
 
 
Example: 
 
mysql> show plugin; 
+------------+--------+---------+-----------+ 
| Name       | Status | Type    | Library   | 
+------------+--------+---------+-----------+ 
| MEMORY     | ACTIVE | STORAGE | NULL      | 
| MyISAM     | ACTIVE | STORAGE | NULL      | 
| InnoDB     | ACTIVE | STORAGE | NULL      | 
| BerkeleyDB | ACTIVE | STORAGE | NULL      | 
| ARCHIVE    | ACTIVE | STORAGE | NULL      | 
| BLACKHOLE  | ACTIVE | STORAGE | NULL      | 
| FEDERATED  | ACTIVE | STORAGE | NULL      | 
| ndbcluster | ACTIVE | STORAGE | NULL      | 
| partition  | ACTIVE | STORAGE | NULL      | 
| MRG_MYISAM | ACTIVE | STORAGE | NULL      | 
| binlog     | ACTIVE | STORAGE | NULL      | 
| CSV        | ACTIVE | STORAGE | ha_csv.so | 
+------------+--------+---------+-----------+ 
12 rows in set (0.00 sec) 
 
mysql> select * from information_schema.plugins; 
+-------------+----------------+---------------+-------------+---------------------+----------------+------------------------+----------------------+------------------------------------------------------------------------+ 
| PLUGIN_NAME | PLUGIN_VERSION | PLUGIN_STATUS | PLUGIN_TYPE | 
PLUGIN_TYPE_VERSION | PLUGIN_LIBRARY | PLUGIN_LIBRARY_VERSION | PLUGIN_AUTHOR        
| PLUGIN_DESCRIPTION                                                     | 
+-------------+----------------+---------------+-------------+---------------------+----------------+------------------------+----------------------+------------------------------------------------------------------------+ 
| MEMORY      | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | Hash based, 
stored in memory, useful for temporary tables              | 
| MyISAM      | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | Default 
engine as of MySQL 3.23 with great performance                 | 
| InnoDB      | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | Supports 
transactions, row-level locking, and foreign keys             | 
| BerkeleyDB  | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | Supports 
transactions and page-level locking                           | 
| ARCHIVE     | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | Archive 
storage engine                                                 | 
| BLACKHOLE   | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | /dev/null 
storage engine (anything you write to it disappears)         | 
| FEDERATED   | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | Federated 
MySQL storage engine                                         | 
| ndbcluster  | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | Clustered, 
fault-tolerant, memory-based tables                         | 
| partition   | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | Partition 
Storage Engine Helper                                        | 
| MRG_MYISAM  | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | Collection 
of identical MyISAM tables                                  | 
| binlog      | 0.0            | ACTIVE        | STORAGE     | 0.0                 
| NULL           | NULL                   | NULL                 | This is a 
meta storage engine to represent the binlog in a transaction | 
| CSV         | 1.0            | ACTIVE        | STORAGE     | 0.0                 
| ha_csv.so      | 0.1                    | Brian Aker, MySQL AB | CSV Storage 
Engine                                                     | 
+-------------+----------------+---------------+-------------+---------------------+----------------+------------------------+----------------------+------------------------------------------------------------------------+ 
12 rows in set (0.00 sec) 
 
 
obvious.
iterate the list of plugins, send the data to the client.
See SHOW PROCESSLIST for example.
 
Making use of the plugin_foreach() function (created as part of the pluggable 
storage engine work) to iterate through each plugin and detail information. 
 
Information schema created as per all other information schema tables. 
 
no new tokens, implemented as "SHOW PLUGIN"   
or "SELECT * FROM INFORMATION_SCHEMA.PLUGINS"