fix(mariadb):mariadb兼容性修复和错误修复#3197
Conversation
There was a problem hiding this comment.
💡 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".
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
|
Run psf/black@stable 这black就有点无语了,错误一次次的报,不是一次性给出全部错误。 最主要是怎么没兼容vscode的【Black Formatter】插件?管理员格式化喜欢用什么插件呀 |
|
本地装一个black 跑一次就自动全修了 |
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。
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返回数组的部分子项为空的时候,不影响前端页面的整体布局,只是子组件为空。