Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7320

SEQUENCE doesn't work after UNINSTALL + INSTALL PLUGIN

    Details

      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
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            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.

            Show
            serg Sergei Golubchik added a comment - 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.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                f_razzoli Federico Razzoli
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: