Skip to content

fix(mariadb):mariadb兼容性修复和错误修复#3197

Merged
LeoQuote merged 4 commits into
hhyo:masterfrom
RankRao:fix-mariadb
Jun 12, 2026
Merged

fix(mariadb):mariadb兼容性修复和错误修复#3197
LeoQuote merged 4 commits into
hhyo:masterfrom
RankRao:fix-mariadb

Conversation

@RankRao

@RankRao RankRao commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

1、兼容mariadb参数:已有mysql参数max_execution_time,增加兼容mariadb版本对应参数max_statement_time,注意单位不一致。
2、参数获取:global_variables表在mysql5.7之后在performance_schema库中,而mariadb版本一直使用information_schema.global_variables。不再考虑global_variables表是哪个库中,统一使用show global variables where variable_name in ({}); 的方式。
3、修复链接关闭问题:sql\sql_tuning.py的全局查询basic_information()、sys_parameter()、optimizer_switch()未关闭链接,导致如果方法报错,后续其他正常查询复用链接的时候,还是取默认库,而不是前端db_name传参,导致报错(No database selected)。
4、兼容mariadb表:sql\sql_tuning.py中的参数查询,改为默认使用information_schema.global_variables,超过指定版本才替换为performance_schema.global_variables。
5、sqladvisor界面优化:MySQLTuning返回数组的部分子项为空的时候,不影响前端页面的整体布局,只是子组件为空。

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4438158544

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread sql/sql_tuning.py
Comment thread sql/sql_tuning.py Outdated
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.62%. Comparing base (03db099) to head (a080b0b).

Files with missing lines Patch % Lines
sql/engines/mysql.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3197      +/-   ##
==========================================
- Coverage   85.62%   85.62%   -0.01%     
==========================================
  Files         150      150              
  Lines       26181    26183       +2     
==========================================
+ Hits        22417    22418       +1     
- Misses       3764     3765       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RankRao

RankRao commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Run psf/black@stable

这black就有点无语了,错误一次次的报,不是一次性给出全部错误。

最主要是怎么没兼容vscode的【Black Formatter】插件?管理员格式化喜欢用什么插件呀

@LeoQuote

LeoQuote commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

本地装一个black 跑一次就自动全修了

rank added 4 commits June 12, 2026 12:05
1、兼容mariadb参数:已有mysql参数max_execution_time,增加兼容mariadb版本对应参数max_statement_time,注意单位不一致。
2、参数获取:global_variables表在mysql5.7之后在performance_schema库中,而mariadb版本一直使用information_schema.global_variables。不再考虑global_variables表是哪个库中,统一使用show global variables where variable_name in ({}); 的方式。
3、修复链接关闭问题:sql\sql_tuning.py的全局查询basic_information()、sys_parameter()、optimizer_switch()未关闭链接,导致如果方法报错,后续其他正常查询复用链接的时候,还是取默认库,而不是前端db_name传参,导致报错(No database selected)。
4、兼容mariadb表:sql\sql_tuning.py中的参数查询,改为默认使用information_schema.global_variables,超过指定版本才替换为performance_schema.global_variables。
@LeoQuote LeoQuote merged commit 6fd8bdf into hhyo:master Jun 12, 2026
8 checks passed
@RankRao RankRao deleted the fix-mariadb branch June 12, 2026 06:06
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.

2 participants