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

mysql version pattern bug #1060

Merged
merged 4 commits into from
Feb 3, 2021
Merged

mysql version pattern bug #1060

merged 4 commits into from
Feb 3, 2021

Conversation

imsahil007
Copy link
Contributor

mysql checker was recognizing version syntax 8.0.20 as 8.0.8.0.20. Currently we are only recognising the pattern
mysql\-([0-9]+\.[0-9]+\-[0-9]+\.[0-9]+\.[0-9]+)
These changes will give us the exact version

This will close #954

@@ -28,3 +28,12 @@ class MysqlChecker(Checker):
]
VERSION_PATTERNS = [r"mysql\-([0-9]+\.[0-9]+\-[0-9]+\.[0-9]+\.[0-9]+)"]
Copy link
Contributor

Choose a reason for hiding this comment

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

What you've got will work, but wouldn't it be easier to change the pattern here? the part we treat as a version is what's matched inside the round brackets () so if we want to discard the first part entirely, we could just move that first bracket:

Suggested change
VERSION_PATTERNS = [r"mysql\-([0-9]+\.[0-9]+\-[0-9]+\.[0-9]+\.[0-9]+)"]
VERSION_PATTERNS = [r"mysql\-[0-9]+\.[0-9]+\-([0-9]+\.[0-9]+\.[0-9]+)"]

Or will that break some older parsing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It didn't break the parsing. I made the changes

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

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

Looking good, thank you!

@terriko terriko merged commit 3e80f1d into intel:master Feb 3, 2021
@imsahil007 imsahil007 deleted the mysql_bug branch March 3, 2021 21:32
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.

MySQL checker error
2 participants