Skip to content

MDEV-40799 Runtime plugin/UDF load errors lost under --silent-startup - #5557

Open
midenok wants to merge 1 commit into
11.8from
11.8-midenok-MDEV-40799
Open

MDEV-40799 Runtime plugin/UDF load errors lost under --silent-startup#5557
midenok wants to merge 1 commit into
11.8from
11.8-midenok-MDEV-40799

Conversation

@midenok

@midenok midenok commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Regression from MDEV-32745 (7828fb4), which guarded the plugin-load my_error() calls with opt_silent_startup. That option is a lifetime global, set once at startup and never reset, so the guard suppressed the SQL error for the whole server lifetime, not just during startup. Runtime operations (INSTALL PLUGIN, CREATE FUNCTION ... SONAME) then skipped my_error(), never set the diagnostics area and wrongly succeeded - e.g. main.ps's "call proc_1()" no longer failed with ER_CANT_OPEN_LIBRARY.

Startup callers pass MYF(ME_ERROR_LOG); runtime callers pass MYF(0). Gate the silencing on that flag via silent_plugin_startup() so it applies only to the startup error-log path, and runtime errors always reach the client.

No new test case: the runtime failure path is already covered by existing tests (e.g. main.ps's ER_CANT_OPEN_LIBRARY check). The regression stayed invisible only because stock MTR does not start servers with --silent-startup. A dedicated test would have to restart the server with --silent-startup solely to assert that a startup-only option does not affect runtime, which adds little over the restored invariant.

Regression from MDEV-32745 (7828fb4), which guarded the
plugin-load my_error() calls with opt_silent_startup.  That option is
a lifetime global, set once at startup and never reset, so the guard
suppressed the SQL error for the whole server lifetime, not just
during startup.  Runtime operations (INSTALL PLUGIN, CREATE FUNCTION
... SONAME) then skipped my_error(), never set the diagnostics area
and wrongly succeeded - e.g. main.ps's "call proc_1()" no longer
failed with ER_CANT_OPEN_LIBRARY.

Startup callers pass MYF(ME_ERROR_LOG); runtime callers pass MYF(0).
Gate the silencing on that flag via silent_plugin_startup() so it
applies only to the startup error-log path, and runtime errors always
reach the client.

No new test case: the runtime failure path is already covered by
existing tests (e.g. main.ps's ER_CANT_OPEN_LIBRARY check).  The
regression stayed invisible only because stock MTR does not start
servers with --silent-startup.  A dedicated test would have to restart
the server with --silent-startup solely to assert that a startup-only
option does not affect runtime, which adds little over the restored
invariant.
Copilot AI lite review requested due to automatic review settings August 17, 2026 21:13
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a regression where --silent-startup unintentionally suppressed runtime plugin/UDF load errors by guarding my_error() calls with the lifetime-global opt_silent_startup, causing runtime statements like INSTALL PLUGIN / CREATE FUNCTION ... SONAME to incorrectly succeed without setting the diagnostics area.

Changes:

  • Introduces silent_plugin_startup(MyFlags) to limit silencing behavior to the startup error-log reporting path (MyFlags & ME_ERROR_LOG).
  • Replaces !opt_silent_startup guards around several plugin-load my_error() sites with !silent_plugin_startup(MyFlags) so runtime callers (MyFlags=0) always report to the client.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (1)

sql/sql_plugin.cc:531

  • The regression condition is still untested: main.ps exercises the runtime failure only with the default startup options, so it would also pass with the old opt_silent_startup guard. Please add an MTR case that starts its server with --silent-startup (for example via a test-specific .opt file) and verifies that runtime INSTALL PLUGIN and/or CREATE FUNCTION ... SONAME reports ER_CANT_OPEN_LIBRARY.
  return opt_silent_startup && (MyFlags & ME_ERROR_LOG);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants