[MDEV-7320] SEQUENCE doesn't work after UNINSTALL + INSTALL PLUGIN Created: 2014-12-14  Updated: 2014-12-14  Resolved: 2014-12-14

Status: Closed
Project: MariaDB Server
Component/s: Plugins
Affects Version/s: 10.0.15
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Federico Razzoli Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: sequence_storage_engine


 Description   

Suppose I have Sequence installed and I use it. If I uninstall it, I get a warning (plugin is busy, will be uninstalled on shutdown). Then I change my mind and I reinstall it. No warnings. But I am not able to access any Sequence table, except for the ones I used before.

MariaDB [test]> SELECT seq FROM seq_2_to_3;
+-----+
| seq |
+-----+
|   2 |
|   3 |
+-----+
2 rows in set (0.01 sec)
 
MariaDB [test]> UNINSTALL SONAME 'ha_sequence';
Query OK, 0 rows affected, 1 warning (0.04 sec)
 
MariaDB [test]> SHOW WARNINGS;
+---------+------+----------------------------------------------------+
| Level   | Code | Message                                            |
+---------+------+----------------------------------------------------+
| Warning | 1620 | Plugin is busy and will be uninstalled on shutdown |
+---------+------+----------------------------------------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> INSTALL SONAME 'ha_sequence';
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> SELECT seq FROM seq_2_to_3;
+-----+
| seq |
+-----+
|   2 |
|   3 |
+-----+
2 rows in set (0.00 sec)
 
MariaDB [test]> SELECT seq FROM seq_22_to_33;
ERROR 1146 (42S02): Table 'test.seq_22_to_33' doesn't exist



 Comments   
Comment by Sergei Golubchik [ 2014-12-14 ]

This is not really a bug. Check the status of the SEQUENCE plugin (in INFORMATION_SCHEMA.PLUGINS table) — your previous instance of SEQUENCE engine is not uninstalled yet, it is still present. So you cannot reinstall SEQUENCE engine until the previously installed SEQUENCE will be completely uninstalled.

And it cannot be uninstalled until all currently opened SEQUENCE tables are completely closed. FLUSH TABLES will do that.

But you cannot create new SEQUENCE tables, because the plugin is "being uninstalled" — it only waits for existing tables to be closed. If you'd be able to open new tables, the plugin might never get uninstalled.

This behavior is not specific to SEQUENCE engine, it's the same for all storage engines — an engine can not be unloaded as long as there are open tables in that engine.

Generated at Thu Feb 08 07:18:41 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.