(version_str: str)
| 45 | |
| 46 | @staticmethod |
| 47 | def calc_mysql_version_value(version_str: str) -> int: |
| 48 | if not version_str or not isinstance(version_str, str): |
| 49 | return 0 |
| 50 | try: |
| 51 | major, minor, patch = version_str.split(".") |
| 52 | except ValueError: |
| 53 | return 0 |
| 54 | else: |
| 55 | return int(major) * 10_000 + int(minor) * 100 + int(patch) |
| 56 | |
| 57 | @classmethod |
| 58 | def from_version_string(cls, version_string: str) -> ServerInfo: |