MDEV-40799 Runtime plugin/UDF load errors lost under --silent-startup - #5557
MDEV-40799 Runtime plugin/UDF load errors lost under --silent-startup#5557midenok wants to merge 1 commit into
Conversation
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.
|
|
There was a problem hiding this comment.
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_startupguards around several plugin-loadmy_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.
There was a problem hiding this comment.
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.psexercises the runtime failure only with the default startup options, so it would also pass with the oldopt_silent_startupguard. Please add an MTR case that starts its server with--silent-startup(for example via a test-specific.optfile) and verifies that runtimeINSTALL PLUGINand/orCREATE FUNCTION ... SONAMEreportsER_CANT_OPEN_LIBRARY.
return opt_silent_startup && (MyFlags & ME_ERROR_LOG);
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.