Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set tidb tunning variables only when connected to valid tidb #188

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MimeLyc
Copy link

@MimeLyc MimeLyc commented Feb 24, 2025

Issue Number: #187

According to System Variables | TiDB Docs, set TiDB QueryTuningVars only when connected to TiDB(>=7.1.0).

It's still a rough comparison to quickly fix the compatibility issue.

@CLAassistant
Copy link

CLAassistant commented Feb 24, 2025

CLA assistant check
All committers have signed the CLA.

@MimeLyc
Copy link
Author

MimeLyc commented Feb 24, 2025

@zanmato1984
@Yui-Song
pls cc

// isValidTuningVersion checks if the version is a valid TiDB version for query tuning params @queryTuningVars
// @version the output serverVersion of tidb using @getServerVersion
// INFO: Should be optimized if some vars are changed in the future.
func isValidTuningVersion(version string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should split this function into two: one extracting a version struct of {major int, minor int, patch string}, the other asserting if a given system variable is supported by the given version struct (func isSysVarSupported(version versionInfo, sysVar string)).

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.

3 participants