Bug #31132 install plugin starts plugin
Submitted: 21 Sep 2007 15:24 Modified: 25 Sep 2007 12:15
Reporter: Jan Lindström Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: User-defined functions ( UDF ) Severity:S4 (Feature request)
Version:5.1-bk OS:Any
Assigned to: CPU Architecture:Any
Triage: Triaged: D5 (Feature request)

[21 Sep 2007 15:24] Jan Lindström
Description:
When I issue install plugin e.g:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.23-beta-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> install plugin soliddb soname 'ha_soliddb.so';
Query OK, 0 rows affected (2.18 sec)

MySQL will call plugin init and this will cause database files to be created e.g:
jan@jan-laptop:~/mysql-5.1/sql$ ./mysqld --defaults-file=/home/jan/.my.cnf
070921 18:19:21 [Warning] Changed limits: max_open_files: 1024  max_connections: 886  table_cache: 64
070921 18:19:21 [Note] Event Scheduler: Loaded 0 events
070921 18:19:21 [Note] ./mysqld: ready for connections.
Version: '5.1.23-beta-debug'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
solidDB for MySQL 5.1.23-beta - 06.01.0078 DEBUG   (Linux 2.6.20 ix86 MT)
This is a solidDB for MySQL build.
Copyright (C) Solid Information Technology Ltd 1993-2007
Creating a new database, please wait ...
Using log write mode 2
Database started.

However, user can't configure external plugins before they have been installed. Furthermore, external plugin can have required configuration options before it can create necessary storage engine specific files and more importantly storage engine can have configuration options which can't be changed after storage engine specific files are created. Therefore, MySQL should not call plugin init at install plugin.

How to repeat:
install plugin soliddb soname 'ha_soliddb.so';
[25 Sep 2007 12:15] Sveta Smirnova
Thank you for the reasonable feature request.
[27 Sep 2007 15:50] Brian Aker
This is not a feature request, it is a bug. Plugins other then MyISAM and MEMORY should not be started during bootstrap. We recently fixed this for Innodb.

Someone needs to go into sql_plugin.cc and put an if around the loading of dynamic plugins, or better yet, only allow the startup of the two I mentioned above based on bootstrap.
[2 Oct 2007 11:51] Sergei Golubchik
INSTALL PLUGIN is defined and documented to "also load and initialize the plugin code to make the plugin available for use.", see http://dev.mysql.com/doc/refman/5.1/en/install-plugin.html

It won't be changed.

Being able to configure plugin on install is WL#3868

When it's pushed (the code is already written) you'll be able to pass --skip-soliddb to INSTALL PLUGIN.

Anyway, it's a feature request.

The fact that plugins are started in --bootstrap is a bug, but completely unrelated to this one. Should be reported separately.