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

UNINSTALL SONAME does not remove the mysql.plugin row when the plugin library file is missing, leaving an orphan row (MDEV-21258 fix covers UNINSTALL PLUGIN by name only)

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11, 11.4, 11.8, 12.3, 13.1
    • 10.11, 11.4, 11.8, 12.3, 13.1
    • Server
    • None
    • MariaDB source HEAD `c894d97781b5` (13.2.0-alpha) and the official image
      `mariadb@sha256:dd9b303aed4f4890ed09f766d8ca9ddfd176c0c6f6267feff53b3192ec65a979`
      (`12.3.3-MariaDB-ubu2404`)

    Description

      `UNINSTALL SONAME` resolves the plugin through the already-`dlopen`ed library list
      (`plugin_dl_find`). If the `.so` file named in the `mysql.plugin` row no longer exists on
      disk (removed package, moved plugin directory, upgraded server), the lookup fails and the
      statement returns `ER_SP_DOES_NOT_EXIST` (`ERROR 1305 ... does not exist`) without
      touching the `mysql.plugin` row. The orphan row then survives the uninstall.

      The `UNINSTALL PLUGIN <name>` by-name path does remove the row, which is what the
      MDEV-21258 fix addressed; the `UNINSTALL SONAME` path has no equivalent cleanup for the
      missing-library case.

        1. Steps to reproduce (product observation)

      On the official 12.3.3 image, insert an orphan plugin row (simulating a plugin whose
      library file was removed) and try to uninstall it both ways:

      ```sql
      INSERT INTO mysql.plugin (name, dl) VALUES ('ghost_plugin', 'ghost_plugin.so');

      UNINSTALL SONAME 'ghost_plugin';
      – ERROR 1305 (42000): SONAME ghost_plugin.so does not exist
      SELECT COUNT FROM mysql.plugin WHERE name = 'ghost_plugin'; – 1 (row still present)

      UNINSTALL PLUGIN ghost_plugin;
      – succeeds
      SELECT COUNT FROM mysql.plugin WHERE name = 'ghost_plugin'; – 0
      ```

      Observed: after `UNINSTALL SONAME` the orphan row is still present (1 -> 1), while
      `UNINSTALL PLUGIN` removes it (1 -> 0). Machine evidence:
      `mariadb_reproduction_results/dsh_mdsh28_20261026_run1/result.json`, SHA-256
      `4c6a7332b54e38aeb741f722edbb531c1c94e9d4b772b8d299b28d53704fc303`.

        1. Expected result

      `UNINSTALL SONAME` should either remove the `mysql.plugin` row when the library cannot
      be found (the plugin can no longer be used anyway), or report a state-aware error that
      tells the operator to use `UNINSTALL PLUGIN <name>`; it should not leave the metadata in
      a state where the name is unusable by SONAME and only removable by the alternate
      statement.

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              csfuzz csfuzz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.