Skip to content

fix(profiler): handle databases that do not support query profiling - #285

Open
areomr wants to merge 1 commit into
overextended:mainfrom
areomr:main
Open

fix(profiler): handle databases that do not support query profiling#285
areomr wants to merge 1 commit into
overextended:mainfrom
areomr:main

Conversation

@areomr

@areomr areomr commented Jul 9, 2026

Copy link
Copy Markdown

Some MySQL-protocol compatible databases (such as TiDB) accept SET profiling = 1 statements without error but do not implement the legacy INFORMATION_SCHEMA.PROFILING table. Previously, this caused queries to crash when mysql_debug was enabled.
This commit introduces a fallback mechanism:

  • Adds a try...catch block around profiling statements to gracefully handle unsupported databases.
  • Introduces a profilerSupported state to cache whether the profiler is available. This prevents throwing errors on every subsequent query and instead skips straight to the fallback timing path.
  • Logs a warning to the console once to inform the user that query profiling is unavailable and basic query timing will be used instead.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant